DESCRIBE FUNCTION (DMF)¶

Describes the specified data metric function (DMF), including the signature (arguments), return value, language, and body (definition).

See also:

DMF command reference

Syntax¶

{ DESC | DESCRIBE } FUNCTION [ IF EXISTS ] <name>(
  TABLE ( <arg_data_type> [ , ... ] )
  )
Copy

Parameters¶

name

Specifies the identifier for the function to describe.

If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.

For more information, see Identifier requirements.

TABLE( [ arg_data_type ] [ , ... ] )

Specifies the data type of the argument(s), if any, for the DMF. The argument types are necessary because DMFs support name overloading (that is, two DMFs in the same schema can have the same name), and the argument types are used to identify the DMF you want to describe.

Access control requirements¶

A role used to execute this SQL command must have the following privileges at a minimum:

Privilege

Object

Notes

USAGE

Data metric function

The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Example¶

Describe the DMF to view its properties:

DESC FUNCTION governance.dmfs.count_positive_numbers(
  TABLE(
    NUMBER, NUMBER, NUMBER
  )
);
Copy
+-----------+---------------------------------------------------------------------+
| property  | value                                                               |
+-----------+---------------------------------------------------------------------+
| signature | (ARG_T TABLE(ARG_C1 NUMBER, ARG_C2 NUMBER, ARG_C3 NUMBER))          |
| returns   | NUMBER(38,0)                                                        |
| language  | SQL                                                                 |
| body      | SELECT COUNT(*) FROM arg_t WHERE arg_c1>0 AND arg_c2>0 AND arg_c3>0 |
+-----------+---------------------------------------------------------------------+