本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
將資料庫和資料表新增至 S3 Tables 目錄
請確定您擁有必要的許可,以列出和建立 區域中 Data Catalog 中的目錄、資料庫和資料表。確保已在 AWS 您的帳戶和區域中啟用 S3 Tables 整合。
將資料庫新增至 S3 Tables 目錄
新增資料庫 (主控台)
-
在 https://https://console.aws.amazon.com/glue/home
開啟 AWS Glue 主控台。 -
在左側的導覽窗格中,選擇資料庫。
-
選擇新增資料庫。
-
在 S3 Tables 聯合目錄中選擇 Glue 資料庫。
-
輸入資料庫的唯一名稱。
-
選取映射至 S3 Tables 中資料表儲存貯體的目標目錄。
-
選擇 Create Database (建立資料庫)。
新增資料庫 (AWS CLI)
aws glue create-database \ --regionregion\ --catalog-id "account-id:s3tablescatalog/my-catalog" \ --database-input '{"Name": "my-database"}'
將資料表新增至 S3 Tables 目錄
新增資料表 (主控台)
-
在 https://https://console.aws.amazon.com/glue/home
開啟 AWS Glue 主控台。 -
在左側導覽窗格中,選擇 Tables (資料表)。
-
在目錄下拉式清單中選取適當的 S3 Tables 目錄。
-
選擇新增資料表。
-
輸入資料表的唯一名稱。
-
在目錄下拉式清單中確認已選取正確的 S3 Tables 目錄。
-
在資料庫下拉式清單中選取資料庫。
-
透過輸入 JSON 或個別新增每個資料欄來輸入資料表結構描述。
-
選擇 Create Table (建立資料表)。
新增資料表 (AWS CLI)
aws glue create-table \ --regionregion\ --catalog-id "account-id:s3tablescatalog/my-catalog" \ --database-name "my-database" \ --table-input '{ "Name": "my-table", "Parameters": { "classification": "", "format": "ICEBERG" }, "StorageDescriptor": { "Columns": [ {"Name": "id", "Type": "int", "Parameters": {}}, {"Name": "val", "Type": "string", "Parameters": {}} ] } }'