0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Athena Iceberg設定

Posted at
  • Step 2️⃣ CSV 外部テーブル作成
CREATE EXTERNAL TABLE IF NOT EXISTS schedule_csv (
  date date,
  rank int,
  assignee string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
  'separatorChar' = ',',
  'quoteChar' = '"'
)
LOCATION 's3://athena-iceberg-demo-bucket/csv/'
TBLPROPERTIES ('skip.header.line.count'='1');


-Step 3️⃣ Iceberg テーブル作成

CREATE TABLE IF NOT EXISTS schedule (
  date date,
  rank int,
  assignee string
)
PARTITIONED BY (date)
LOCATION 's3://athena-iceberg-demo-bucket/athena-warehouse/schedule/'
TBLPROPERTIES (
  'table_type' = 'ICEBERG',
  'format' = 'PARQUET'
);

\

  • Step 4️⃣ データをCSV→Icebergへ投入
INSERT INTO schedule
SELECT date, rank, assignee FROM schedule_csv;

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?