Loading...
Loading...
Compare original and translation side by side
aws glue get-tables --database-name <NAME>| What you find | Action |
|---|---|
| Fuzzy database name ("our analytics db") | You MUST STOP. Delegate to |
| Non-S3-Tables table with matching name | You MUST STOP. Delegate to |
| Existing S3 Tables table with matching name | You MUST check schema match. Reuse if compatible, recreate only if user confirms. |
| No matching tables | Proceed with creation (Steps 1-8). |
| User explicitly requests new S3 Tables table | Skip checks, proceed with creation. |
ingesting-into-data-lakereferences/table-creation-glue-etl.md"S3 Tables integration with Lake Formation"aws glue get-tables --database-name <NAME>| 检查结果 | 操作 |
|---|---|
| 模糊数据库名称(如“我们的分析数据库”) | 必须停止操作。委托给 |
| 存在同名非S3-Tables表 | 必须停止操作。委托给 |
| 存在同名S3 Tables表 | 必须检查Schema是否匹配。若兼容则复用,仅在用户确认后重新创建。 |
| 无匹配表 | 继续创建流程(步骤1-8)。 |
| 用户明确要求创建新的S3 Tables表 | 跳过检查,直接进入创建流程。 |
ingesting-into-data-lakereferences/table-creation-glue-etl.md"S3 Tables integration with Lake Formation"aws sts get-caller-identityaws sts get-caller-identityingesting-into-data-lakereferences/best-practices.mdreferences/athena-ddl-path.mdGENERIC_INTERNAL_ERRORingesting-into-data-lakereferences/best-practices.mdreferences/athena-ddl-path.mdGENERIC_INTERNAL_ERRORaws s3tables create-table-bucket --name <BUCKET_NAME> --region <REGION>table-bucket-arnreferences/best-practices.mdaws s3tables list-table-buckets"S3 Tables KMS key policy"references/best-practices.mdaws s3tables create-table-bucket --name <BUCKET_NAME> --region <REGION>table-bucket-arnreferences/best-practices.mdaws s3tables list-table-buckets"S3 Tables KMS key policy"references/best-practices.mdaws s3tables create-namespace --table-bucket-arn <ARN> --namespace <NAMESPACE>aws s3tables create-namespace --table-bucket-arn <ARN> --namespace <NAMESPACE>s3tablescatalogaws glue get-catalog --catalog-id s3tablescatalogglue:CreateCatalogglue:passConnectionaws glue create-catalog --name "s3tablescatalog" --catalog-input '{
"FederatedCatalog": {
"Identifier": "arn:aws:s3tables:<REGION>:<ACCOUNT_ID>:bucket/*",
"ConnectionName": "aws:s3tables"
},
"CreateDatabaseDefaultPermissions": [{"Principal": {"DataLakePrincipalIdentifier": "IAM_ALLOWED_PRINCIPALS"}, "Permissions": ["ALL"]}],
"CreateTableDefaultPermissions": [{"Principal": {"DataLakePrincipalIdentifier": "IAM_ALLOWED_PRINCIPALS"}, "Permissions": ["ALL"]}],
"AllowFullTableExternalDataAccess": "True"
}'aws glue get-catalogs --parent-catalog-id s3tablescatalogs3tablescatalogaws glue get-catalog --catalog-id s3tablescatalogglue:CreateCatalogglue:passConnectionaws glue create-catalog --name "s3tablescatalog" --catalog-input '{
"FederatedCatalog": {
"Identifier": "arn:aws:s3tables:<REGION>:<ACCOUNT_ID>:bucket/*",
"ConnectionName": "aws:s3tables"
},
"CreateDatabaseDefaultPermissions": [{"Principal": {"DataLakePrincipalIdentifier": "IAM_ALLOWED_PRINCIPALS"}, "Permissions": ["ALL"]}],
"CreateTableDefaultPermissions": [{"Principal": {"DataLakePrincipalIdentifier": "IAM_ALLOWED_PRINCIPALS"}, "Permissions": ["ALL"]}],
"AllowFullTableExternalDataAccess": "True"
}'aws glue get-catalogs --parent-catalog-id s3tablescatalogs3tables:*s3:*s3tables:GetTableBuckets3tables:GetNamespaces3tables:GetTables3tables:GetTableMetadataLocations3tables:GetTableDataglue:GetCatalogglue:GetDatabaseglue:GetTablereferences/access-control.mds3tables:*s3:*s3tables:GetTableBuckets3tables:GetNamespaces3tables:GetTables3tables:GetTableMetadataLocations3tables:GetTableDataglue:GetCatalogglue:GetDatabaseglue:GetTablereferences/access-control.md| Context | Path |
|---|---|
| Default (any user) | S3 Tables API (below) |
| User specifically wants SQL DDL | Athena DDL (see |
| Glue ETL pipeline | Spark DDL via |
aws s3tables create-table \
--table-bucket-arn <ARN> \
--namespace <NAMESPACE> \
--name <TABLE_NAME> \
--format ICEBERG \
--metadata '<METADATA_JSON>'"iceberg"{"iceberg":{"schema":{"fields":[
{"name":"order_date","type":"date","required":true},
{"name":"customer_id","type":"string","required":true},
{"name":"amount","type":"double","required":false}
]},
"partitionSpec":{"fields":[
{"sourceId":1,"fieldId":1000,"transform":"month","name":"order_date_month"}
]}}}partitionSpec.sourceIdreferences/athena-ddl-path.mdschemaV2references/best-practices.md"IcebergPartitionField S3 Tables"| 场景 | 实现方式 |
|---|---|
| 默认(任意用户) | S3 Tables API(如下) |
| 用户明确要求使用SQL DDL | Athena DDL(查看 |
| Glue ETL管道 | 通过 |
aws s3tables create-table \
--table-bucket-arn <ARN> \
--namespace <NAMESPACE> \
--name <TABLE_NAME> \
--format ICEBERG \
--metadata '<METADATA_JSON>'"iceberg"{"iceberg":{"schema":{"fields":[
{"name":"order_date","type":"date","required":true},
{"name":"customer_id","type":"string","required":true},
{"name":"amount","type":"double","required":false}
]},
"partitionSpec":{"fields":[
{"sourceId":1,"fieldId":1000,"transform":"month","name":"order_date_month"}
]}}}partitionSpec.sourceIdreferences/athena-ddl-path.mdschemaV2references/best-practices.md"IcebergPartitionField S3 Tables"aws s3tables get-tableDESCRIBE <table_name>--query-execution-context '{"Catalog":"s3tablescatalog/<BUCKET_NAME>","Database":"<NAMESPACE>"}'aws s3tables get-tableDESCRIBE <table_name>--query-execution-context '{"Catalog":"s3tablescatalog/<BUCKET_NAME>","Database":"<NAMESPACE>"}'| Error | Cause | Fix |
|---|---|---|
| "Table location can not be specified" | LOCATION in CREATE TABLE | Remove LOCATION clause. S3 Tables manages storage automatically. |
| Using | S3 Tables uses |
| 错误信息 | 原因 | 修复方案 |
|---|---|---|
| "Table location can not be specified" | CREATE TABLE语句中包含LOCATION | 删除LOCATION子句。S3 Tables会自动管理存储位置。 |
| 使用了 | S3 Tables使用 |
ingesting-into-data-lakeingesting-into-data-lake