

# ユーザー定義関数 API
<a name="aws-glue-api-catalog-functions"></a>

ユーザー定義関数 API では、関数の処理に使用する AWS Glue データ型およびオペレーションについて説明します。

## データ型
<a name="aws-glue-api-catalog-functions-objects"></a>
+ [UserDefinedFunction 構造](#aws-glue-api-catalog-functions-UserDefinedFunction)
+ [UserDefinedFunctionInput 構造](#aws-glue-api-catalog-functions-UserDefinedFunctionInput)

## UserDefinedFunction 構造
<a name="aws-glue-api-catalog-functions-UserDefinedFunction"></a>

Hive ユーザー定義関数 (`UDF`) 定義と同等のものを表します。

**フィールド**
+ `FunctionName` – UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数の名前
+ `DatabaseName` – UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数を含むカタログデータベースの名前。
+ `ClassName` – UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数コードを含む Java クラス。
+ `OwnerName` – UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数の所有者。
+ `OwnerType` – UTF-8 文字列 (有効な値: `USER` \$1 `ROLE` \$1 `GROUP`)。

  所有者のタイプ。
+ `CreateTime` – タイムスタンプ。

  関数の作成時刻。
+ `ResourceUris` – [ResourceUri](aws-glue-api-common.md#aws-glue-api-common-ResourceUri) オブジェクトの配列。構造 1000 個以下。

  関数のリソース URI。
+ `CatalogId` – カタログ ID 文字列、1～255 バイト長、[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数が存在する Data Catalog の ID。

## UserDefinedFunctionInput 構造
<a name="aws-glue-api-catalog-functions-UserDefinedFunctionInput"></a>

ユーザー定義関数の作成または更新に使用される構造。

**フィールド**
+ `FunctionName` – UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数の名前
+ `ClassName` – UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数コードを含む Java クラス。
+ `OwnerName` – UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数の所有者。
+ `OwnerType` – UTF-8 文字列 (有効な値: `USER` \$1 `ROLE` \$1 `GROUP`)。

  所有者のタイプ。
+ `ResourceUris` – [ResourceUri](aws-glue-api-common.md#aws-glue-api-common-ResourceUri) オブジェクトの配列。構造 1000 個以下。

  関数のリソース URI。

## 操作
<a name="aws-glue-api-catalog-functions-actions"></a>
+ [CreateUserDefinedFunction アクション (Python: create\$1user\$1defined\$1function)](#aws-glue-api-catalog-functions-CreateUserDefinedFunction)
+ [UpdateUserDefinedFunction アクション (Python: update\$1user\$1defined\$1function)](#aws-glue-api-catalog-functions-UpdateUserDefinedFunction)
+ [DeleteUserDefinedFunction アクション (Python: delete\$1user\$1defined\$1function)](#aws-glue-api-catalog-functions-DeleteUserDefinedFunction)
+ [GetUserDefinedFunction アクション (Python: get\$1user\$1defined\$1function)](#aws-glue-api-catalog-functions-GetUserDefinedFunction)
+ [GetUserDefinedFunctions アクション (Python: get\$1user\$1defined\$1functions)](#aws-glue-api-catalog-functions-GetUserDefinedFunctions)

## CreateUserDefinedFunction アクション (Python: create\$1user\$1defined\$1function)
<a name="aws-glue-api-catalog-functions-CreateUserDefinedFunction"></a>

データカタログで新しい関数定義を作成します。

**リクエスト**
+ `CatalogId` – カタログ ID 文字列、1～255 バイト長、「[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)」に一致。

  関数を作成するデータカタログの ID。設定しない場合は、AWS アカウント ID がデフォルトで使用されます。
+ `DatabaseName` – *必須:* UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数を作成するカタログデータベースの名前。
+ `FunctionInput` – *必須:* [UserDefinedFunctionInput](#aws-glue-api-catalog-functions-UserDefinedFunctionInput) オブジェクト。

  データカタログで作成する関数を定義する `FunctionInput` オブジェクト。

**レスポンス**
+ *応答パラメータはありません。*

**エラー**
+ `AlreadyExistsException`
+ `InvalidInputException`
+ `InternalServiceException`
+ `EntityNotFoundException`
+ `OperationTimeoutException`
+ `ResourceNumberLimitExceededException`
+ `GlueEncryptionException`

## UpdateUserDefinedFunction アクション (Python: update\$1user\$1defined\$1function)
<a name="aws-glue-api-catalog-functions-UpdateUserDefinedFunction"></a>

データカタログで既存の関数定義を更新します。

**リクエスト**
+ `CatalogId` – カタログ ID 文字列、1～255 バイト長、「[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)」に一致。

  更新する関数が存在するデータカタログの ID。設定しない場合は、AWS アカウント ID がデフォルトで使用されます。
+ `DatabaseName` – *必須:* UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  更新する関数が存在するカタログデータベースの名前。
+ `FunctionName` – *必須:* UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数の名前
+ `FunctionInput` – *必須:* [UserDefinedFunctionInput](#aws-glue-api-catalog-functions-UserDefinedFunctionInput) オブジェクト。

  データカタログで関数を再定義する `FunctionInput` オブジェクト。

**レスポンス**
+ *応答パラメータはありません。*

**エラー**
+ `EntityNotFoundException`
+ `InvalidInputException`
+ `InternalServiceException`
+ `OperationTimeoutException`
+ `GlueEncryptionException`

## DeleteUserDefinedFunction アクション (Python: delete\$1user\$1defined\$1function)
<a name="aws-glue-api-catalog-functions-DeleteUserDefinedFunction"></a>

データカタログから既存の関数定義を削除します。

**リクエスト**
+ `CatalogId` – カタログ ID 文字列、1～255 バイト長、「[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)」に一致。

  削除する関数が存在するデータカタログの ID。提供されない場合は、AWS アカウント ID がデフォルトで使用されます。
+ `DatabaseName` – *必須:* UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  削除する関数が存在するカタログデータベースの名前。
+ `FunctionName` – *必須:* UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  削除する関数定義の名前。

**レスポンス**
+ *応答パラメータはありません。*

**エラー**
+ `EntityNotFoundException`
+ `InvalidInputException`
+ `InternalServiceException`
+ `OperationTimeoutException`

## GetUserDefinedFunction アクション (Python: get\$1user\$1defined\$1function)
<a name="aws-glue-api-catalog-functions-GetUserDefinedFunction"></a>

データカタログから指定された関数定義を取得します。

**リクエスト**
+ `CatalogId` – カタログ ID 文字列、1～255 バイト長、「[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)」に一致。

  取得する関数が存在するデータカタログの ID。設定しない場合は、AWS アカウント ID がデフォルトで使用されます。
+ `DatabaseName` – *必須:* UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  削除する関数が存在するカタログデータベースの名前。
+ `FunctionName` – *必須:* UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数の名前

**レスポンス**
+ `UserDefinedFunction` – [UserDefinedFunction](#aws-glue-api-catalog-functions-UserDefinedFunction) オブジェクト。

  リクエストされた関数定義。

**エラー**
+ `EntityNotFoundException`
+ `InvalidInputException`
+ `InternalServiceException`
+ `OperationTimeoutException`
+ `GlueEncryptionException`

## GetUserDefinedFunctions アクション (Python: get\$1user\$1defined\$1functions)
<a name="aws-glue-api-catalog-functions-GetUserDefinedFunctions"></a>

データカタログから複数の関数定義を取得します。

**リクエスト**
+ `CatalogId` – カタログ ID 文字列、1～255 バイト長、「[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine)」に一致。

  取得する関数が存在するデータカタログの ID。設定しない場合は、AWS アカウント ID がデフォルトで使用されます。
+ `DatabaseName` – UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  関数が存在するカタログデータベースの名前。何も指定されていない場合は、カタログ全体のすべてのデータベースからの関数が返されます。
+ `Pattern` – *必須:* UTF-8 文字列。1～255 バイト長。[Single-line string pattern](aws-glue-api-common.md#aws-glue-api-regex-oneLine) に一致。

  返される関数定義をフィルタリングするオプションの function-name パターン文字列。
+ `NextToken` – UTF-8 文字列。

  継続トークン (これが継続呼び出しの場合)。
+ `MaxResults` – 数値 (integer)。1～100。

  1 回の応答で返す関数の最大数。

**応答**
+ `UserDefinedFunctions` – [UserDefinedFunction](#aws-glue-api-catalog-functions-UserDefinedFunction) オブジェクトの配列。

  リクエストされた関数定義のリスト。
+ `NextToken` – UTF–8 文字列。

  戻された関数のリストに最後のリクエストされた関数が含まれていない場合は、継続トークン。

**エラー**
+ `EntityNotFoundException`
+ `InvalidInputException`
+ `OperationTimeoutException`
+ `InternalServiceException`
+ `GlueEncryptionException`