Tal Sofer
11/21/2021, 9:43 AMdocker compose --profile client run --rm hive-client
to enable the hive-client.
Now, I would like to create my first table in the metastore. How do I use the hive-client to do that?
@Guy Hardonag you can probably point me to the right directionGuy Hardonag
11/21/2021, 9:52 AMdocker compose --profile client run --rm hive-client
In Hive:
CREATE EXTERNAL TABLE `inventory`(
`inv_item_sk` int,
`inv_warehouse_sk` int,
`inv_quantity_on_hand` int)
PARTITIONED BY (
`inv_date_sk` int) STORED AS ORC
LOCATION
'<s3://REPO_NAME/BRANCH_NAME/PATH_TO_TABLE>';
Trino
Run:
docker compose --profile client run --rm trino-client
in Trino:
CREATE TABLE request_logs (
request_time timestamp,
url varchar,
ip varchar,
user_agent varchar
)
WITH (
format = 'PARQUET',
external_location = '<s3://REPO_NAME/BRANCH_NAME/PATH_TO_TABLE>'
)
Tal Sofer
11/21/2021, 10:19 AMTal Sofer
11/21/2021, 10:26 AMtrino:default> CREATE TABLE request_logs (
-> request_time timestamp,
-> url varchar,
-> ip varchar,
-> user_agent varchar
-> )
-> WITH (
-> format = 'PARQUET',
-> external_location = '<s3://example/main>'
-> )
-> ;
Query 20211121_102532_00007_gvtka failed: Got exception: java.io.FileNotFoundException PUT 0-byte object on main/: com.amazonaws.services.s3.model.AmazonS3Exception: Not Found (Service: Amazon S3; Status Code: 404; Error Code: 404 Not Found; Request ID: null; S3 Extended Request ID: null), S3 Extended Request ID: null:404 Not Found
Tal Sofer
11/21/2021, 10:27 AMGuy Hardonag
11/21/2021, 10:54 AM<s3://example/main/request_logs>
Tal Sofer
11/21/2021, 10:56 AM