# Get Function

Launch stage: GA

`GET /api/2.1/unity-catalog/functions/{full_name_arg}`

Gets a function from within a parent catalog and schema.
 For the fetch to succeed, the user must satisfy one of the following requirements:
 - Is a metastore admin
 - Is an owner of the function's parent catalog
 - Have the **USE_CATALOG** privilege on the function's parent catalog and be the owner of the function
 - Have the **USE_CATALOG** privilege on the function's parent catalog, the **USE_SCHEMA** privilege on the function's parent schema, and the **EXECUTE** privilege on the function itself

API scopes: unity-catalog

## Path parameters

- `full_name_arg` (string, optional)
  The fully-qualified name of the function (of the form __catalog_name__.__schema_name__.__function__name__).

## Query parameters

- `include_browse` (boolean, optional)
  Whether to include functions in the response for which the principal can only access selective metadata for

## Returns

- `name` (string, optional)
  Name of function, relative to parent schema.
- `catalog_name` (string, optional)
  Name of parent Catalog.
- `schema_name` (string, optional)
  Name of parent Schema relative to its parent Catalog.
- `input_params` (object, optional)
  Function input parameters.
  - `parameters` (array of object, optional)
    - `name` (string, optional)
      Name of Parameter.
    - `type_text` (string, optional)
      Full data type spec, SQL/catalogString text.
    - `type_json` (string, optional)
      Full data type spec, JSON-serialized.
    - `type_name` (string, optional)
      Name of type (INT, STRUCT, MAP, etc.)
      Possible values: `BOOLEAN`, `BYTE`, `SHORT`, `INT`, `LONG`, `FLOAT`, `DOUBLE`, `DATE`, `TIMESTAMP`, `STRING`, `BINARY`, `DECIMAL`, `INTERVAL`, `ARRAY`, `STRUCT`, `MAP`, `CHAR`, `NULL`, `USER_DEFINED_TYPE`, `TIMESTAMP_NTZ`, `VARIANT`, `GEOMETRY`, `GEOGRAPHY`, `TABLE_TYPE`
    - `type_precision` (int32, optional)
      Digits of precision; required on Create for DecimalTypes.
    - `type_scale` (int32, optional)
      Digits to right of decimal; Required on Create for DecimalTypes.
    - `type_interval_type` (string, optional)
      Format of IntervalType.
    - `position` (int32, optional)
      Ordinal position of column (starting at position 0).
    - `parameter_mode` (string, optional)
      Function parameter mode.
      Possible values: `IN`
    - `parameter_type` (string, optional)
      Function parameter type.
      Possible values: `PARAM`, `COLUMN`
    - `parameter_default` (string, optional)
      Default value of the parameter.
    - `comment` (string, optional)
      User-provided free-form text description.
- `data_type` (string, optional)
  Scalar function return data type.
  Possible values: `BOOLEAN`, `BYTE`, `SHORT`, `INT`, `LONG`, `FLOAT`, `DOUBLE`, `DATE`, `TIMESTAMP`, `STRING`, `BINARY`, `DECIMAL`, `INTERVAL`, `ARRAY`, `STRUCT`, `MAP`, `CHAR`, `NULL`, `USER_DEFINED_TYPE`, `TIMESTAMP_NTZ`, `VARIANT`, `GEOMETRY`, `GEOGRAPHY`, `TABLE_TYPE`
- `full_data_type` (string, optional)
  Pretty printed function data type.
- `routine_body` (string, optional)
  Function language. When **EXTERNAL** is used, the language of the routine function should be specified in the **external_language** field, and the **return_params** of the function cannot be used (as **TABLE** return type is not supported), and the **sql_data_access** field must be **NO_SQL**.
  Possible values: `SQL`, `EXTERNAL`
- `routine_definition` (string, optional)
  Function body.
- `parameter_style` (string, optional)
  Function parameter style. **S** is the value for SQL.
  Possible values: `S`
- `is_deterministic` (boolean, optional)
  Whether the function is deterministic.
- `sql_data_access` (string, optional)
  Function SQL data access.
  Possible values: `CONTAINS_SQL`, `READS_SQL_DATA`, `NO_SQL`
- `is_null_call` (boolean, optional)
  Function null call.
- `security_type` (string, optional)
  Function security type.
  Possible values: `DEFINER`
- `specific_name` (string, optional)
  Specific name of the function; Reserved for future use.
- `return_params` (object, optional)
  Table function return parameters.
  - `parameters` (array of object, optional)
    - `name` (string, optional)
      Name of Parameter.
    - `type_text` (string, optional)
      Full data type spec, SQL/catalogString text.
    - `type_json` (string, optional)
      Full data type spec, JSON-serialized.
    - `type_name` (string, optional)
      Name of type (INT, STRUCT, MAP, etc.)
      Possible values: `BOOLEAN`, `BYTE`, `SHORT`, `INT`, `LONG`, `FLOAT`, `DOUBLE`, `DATE`, `TIMESTAMP`, `STRING`, `BINARY`, `DECIMAL`, `INTERVAL`, `ARRAY`, `STRUCT`, `MAP`, `CHAR`, `NULL`, `USER_DEFINED_TYPE`, `TIMESTAMP_NTZ`, `VARIANT`, `GEOMETRY`, `GEOGRAPHY`, `TABLE_TYPE`
    - `type_precision` (int32, optional)
      Digits of precision; required on Create for DecimalTypes.
    - `type_scale` (int32, optional)
      Digits to right of decimal; Required on Create for DecimalTypes.
    - `type_interval_type` (string, optional)
      Format of IntervalType.
    - `position` (int32, optional)
      Ordinal position of column (starting at position 0).
    - `parameter_mode` (string, optional)
      Function parameter mode.
      Possible values: `IN`
    - `parameter_type` (string, optional)
      Function parameter type.
      Possible values: `PARAM`, `COLUMN`
    - `parameter_default` (string, optional)
      Default value of the parameter.
    - `comment` (string, optional)
      User-provided free-form text description.
- `external_name` (string, optional)
  External function name.
- `external_language` (string, optional)
  External function language.
- `sql_path` (string, optional)
  List of schemes whose objects can be referenced without qualification.
- `owner` (string, optional)
  Username of current owner of the function.
- `comment` (string, optional)
  User-provided free-form text description.
- `properties` (string, optional)
  JSON-serialized key-value pair map, encoded (escaped) as a string.
- `routine_dependencies` (object, optional)
  function dependencies.
  - `dependencies` (array of object, optional)
    Array of dependencies.
    - `table` (object, required)
      - `table_full_name` (string, optional)
        Full name of the dependent table, in the form of __catalog_name__.__schema_name__.__table_name__.
    - `function` (object, required)
      - `function_full_name` (string, optional)
        Full name of the dependent function, in the form of __catalog_name__.__schema_name__.__function_name__.
    - `connection` (object, required)
      - `connection_name` (string, optional)
        Full name of the dependent connection, in the form of __connection_name__.
    - `credential` (object, required)
      - `credential_name` (string, optional)
        Full name of the dependent credential, in the form of __credential_name__.
- `metastore_id` (string, optional)
  Unique identifier of parent metastore.
- `full_name` (string, optional)
  Full name of Function, in form of **catalog_name**.**schema_name**.**function_name**
- `created_at` (int64, optional)
  Time at which this function was created, in epoch milliseconds.
- `created_by` (string, optional)
  Username of function creator.
- `updated_at` (int64, optional)
  Time at which this function was last modified, in epoch milliseconds.
- `updated_by` (string, optional)
  Username of user who last modified the function.
- `function_id` (string, optional)
  Id of Function, relative to parent schema.
- `browse_only` (boolean, optional)
  Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request.

## Response

```json
{
  "name": "string",
  "catalog_name": "string",
  "schema_name": "string",
  "input_params": {
    "parameters": [
      {}
    ]
  },
  "data_type": "string",
  "full_data_type": "string",
  "routine_body": "string",
  "routine_definition": "string",
  "parameter_style": "string",
  "is_deterministic": true,
  "sql_data_access": "string",
  "is_null_call": true,
  "security_type": "string",
  "specific_name": "string",
  "return_params": {
    "parameters": [
      {}
    ]
  },
  "external_name": "string",
  "external_language": "string",
  "sql_path": "string",
  "owner": "string",
  "comment": "string",
  "properties": "string",
  "routine_dependencies": {
    "dependencies": [
      {}
    ]
  },
  "metastore_id": "string",
  "full_name": "string",
  "created_at": 0,
  "created_by": "string",
  "updated_at": 0,
  "updated_by": "string",
  "function_id": "string",
  "browse_only": true
}
```

