ALIYUN::MaxCompute::Table は、テーブルを作成するために使用されます。
構文
{
"Type": "ALIYUN::MaxCompute::Table",
"Properties": {
"Comment": String,
"Project": String,
"IfNotExists": Boolean,
"Lifecycle": Number,
"Schema": Map,
"StringSchema": String,
"Name": String
}
}プロパティ
| プロパティ | タイプ | 必須 | 編集可能 | 説明 | 制約 |
| Comment | String | いいえ | いいえ | テーブルのコメント。 | なし |
| Project | String | はい | いいえ | プロジェクトの名前。 | このパラメーターが指定されていない場合は、デフォルトのプロジェクトが使用されます。 |
| IfNotExists | Boolean | いいえ | いいえ | 同じ名前のテーブルが既に存在する場合にエラーを報告するかどうかを指定します。 | このパラメーターを指定しない場合、同じ名前のテーブルが既に存在するとエラーが報告されます。 このパラメーターを指定した場合、同じ名前のテーブルが既に存在するかどうかに関係なくエラーは発生しません。既存のテーブルの名前を使用してテーブルを作成する場合、テーブルは作成されず、既存のテーブルのメタデータは変更されません。 |
| Lifecycle | Number | いいえ | いいえ | テーブルのライフサイクル。 | なし |
| Schema | Map | いいえ | いいえ | テーブルのスキーマ。 | 詳細については、スキーマのプロパティをご参照ください。 |
| StringSchema | String | いいえ | いいえ | 文字列型のフィールド名とフィールドタイプを含むテーブルを作成するために使用されるスキーマ。 | なし |
| Name | String | はい | いいえ | テーブルの名前。 | 名前は 1 ~ 128 文字で、文字、数字、およびアンダースコア(_)を含めることができます。 |
スキーマの構文
"Schema": {
"Partitions": List,
"Columns": List
}スキーマのプロパティ
| プロパティ | タイプ | 必須 | 編集可能 | 説明 | 制約 |
| Partitions | List | いいえ | いいえ | テーブルのパーティション。 | 詳細については、パーティションのプロパティをご参照ください。 |
| Columns | List | はい | いいえ | テーブルの列。 | 詳細については、列のプロパティをご参照ください。 |
パーティションの構文
"Partitions": [
{
"Comment": String,
"Type": String,
"Name": String
}
]パーティションのプロパティ
| プロパティ | タイプ | 必須 | 編集可能 | 説明 | 制約 |
| Comment | String | いいえ | いいえ | パーティションのコメント。 | なし |
| Type | String | はい | いいえ | パーティションのタイプ。 | なし |
| Name | String | はい | いいえ | パーティションの名前。 | なし |
列の構文
"Columns": [
{
"Comment": String,
"Type": String,
"Name": String
}
]列のプロパティ
| プロパティ | タイプ | 必須 | 編集可能 | 説明 | 制約 |
| Comment | String | いいえ | いいえ | 列のコメント。 | なし |
| Type | String | はい | いいえ | 列のタイプ。 | なし |
| Name | String | はい | いいえ | 列の名前。 | なし |
レスポンスパラメーター
Fn::GetAtt
- Project: プロジェクトの名前。
- Name: テーブルの名前。
例
JSON 形式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"Comment": {
"Type": "String",
"Description": "テーブルのコメント" // Table comment
},
"Project": {
"Type": "String",
"Description": "プロジェクト名。指定しない場合は、デフォルトのプロジェクトになります。" // Project name, if not provided, will be the default project
},
"IfNotExists": {
"Type": "Boolean",
"Description": "既存のテーブルの名前を使用してテーブルを作成し、\nこのパラメーターを false に設定した場合、エラーが返されます。\n if not exists パラメーターを指定した場合、既存の\nテーブルの名前を使用してテーブルを作成すると、成功メッセージが返されます。\n既存のテーブルのスキーマが作成するテーブルのスキーマと異なっていても、成功メッセージが返されます。\n既存のテーブルの名前を使用してテーブルを作成する場合、\nテーブルは作成されず、既存のテーブルのメタデータは変更されません。", // If you create a table by using the name of an existing table and \nthe parameter set to false, an error is returned. \nIf you specify the if not exists parameter, a success message \nis returned when you create a table by using the name of an \nexisting table. The success message is returned even if the \nschema of the existing table is different from that of the table you want to create. \nIf you create a table by using the name of an existing table, \nthe table is not created and the metadata of the existing table is not changed.
"AllowedValues": [
"True",
"true",
"False",
"false"
]
},
"Lifecycle": {
"Type": "Number",
"Description": "テーブルのライフサイクル。" // Table's lifecycle.
},
"Schema": {
"Type": "Json",
"Description": "テーブルスキーマ" // Table schema
},
"StringSchema": {
"Type": "String",
"Description": "フィールド名とフィールドタイプの文字列を使用してテーブルを作成します。\n例: 'num bigint, num2 double', 'pt string'" // Create a table with field names and field type strings.\nExample: 'num bigint, num2 double', 'pt string'
},
"Name": {
"Type": "String",
"Description": "テーブル名" // Table name
,
"AllowedPattern": "[A-Za-z0-9_]{1,128}"
}
},
"Resources": {
"Table": {
"Type": "ALIYUN::MaxCompute::Table",
"Properties": {
"Comment": {
"Ref": "Comment"
},
"Project": {
"Ref": "Project"
},
"IfNotExists": {
"Ref": "IfNotExists"
},
"Lifecycle": {
"Ref": "Lifecycle"
},
"Schema": {
"Ref": "Schema"
},
"StringSchema": {
"Ref": "StringSchema"
},
"Name": {
"Ref": "Name"
}
}
}
},
"Outputs": {
"Project": {
"Description": "プロジェクト名" // Project name
,
"Value": {
"Fn::GetAtt": [
"Table",
"Project"
]
}
},
"Name": {
"Description": "テーブル名" // Table name
,
"Value": {
"Fn::GetAtt": [
"Table",
"Name"
]
}
}
}
}YAML 形式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
Comment:
Description: テーブルのコメント # Table comment
Type: String
IfNotExists:
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
Description: "既存のテーブルの名前を使用してテーブルを作成し、\nこのパラメーターを false に設定した場合、エラーが返されます。\n if not exists パラメーターを指定した場合、既存の\nテーブルの名前を使用してテーブルを作成すると、成功メッセージが返されます。\n既存のテーブルのスキーマが作成するテーブルのスキーマと異なっていても、成功メッセージが返されます。\n既存のテーブルの名前を使用してテーブルを作成する場合、\nテーブルは作成されず、既存のテーブルのメタデータは変更されません。" # If you create a table by using the name of an existing table and\
\ \nthe parameter set to false, an error is returned. \nIf you specify the if\
\ not exists parameter, a success message \nis returned when you create a table\
\ by using the name of an \nexisting table. The success message is returned\
\ even if the \nschema of the existing table is different from that of the table\
\ you want to create. \nIf you create a table by using the name of an existing\
\ table, \nthe table is not created and the metadata of the existing table is\
\ not changed.
Type: Boolean
Lifecycle:
Description: テーブルのライフサイクル。 # Table's lifecycle.
Type: Number
Name:
AllowedPattern: '[A-Za-z0-9_]{1,128}'
Description: テーブル名 # Table name
Type: String
Project:
Description: プロジェクト名。指定しない場合は、デフォルトのプロジェクトになります。 # Project name, if not provided, will be the default project
Type: String
Schema:
Description: テーブルスキーマ # Table schema
Type: Json
StringSchema:
Description: 'フィールド名とフィールドタイプの文字列を使用してテーブルを作成します。\n例: ''num bigint, num2 double'', ''pt string''' # Create a table with field names and field type strings.\nExample: 'num bigint, num2 double', 'pt string'
Type: String
Resources:
Table:
Properties:
Comment:
Ref: Comment
IfNotExists:
Ref: IfNotExists
Lifecycle:
Ref: Lifecycle
Name:
Ref: Name
Project:
Ref: Project
Schema:
Ref: Schema
StringSchema:
Ref: StringSchema
Type: ALIYUN::MaxCompute::Table
Outputs:
Name:
Description: テーブル名 # Table name
Value:
Fn::GetAtt:
- Table
- Name
Project:
Description: プロジェクト名 # Project name
Value:
Fn::GetAtt:
- Table
- Project