I'm trying to follow the examples of Hive connector to create hive table. I can write HQL to create a table via beeline. But wonder how to make it via prestosql.
Given table
CREATE TABLE hive.web.request_logs (
request_time varchar,
url varchar,
ip varchar,
user_agent varchar,
dt varchar
)
WITH (
format = 'CSV',
partitioned_by = ARRAY['dt'],
external_location = 's3://my-bucket/data/logs/'
)
SERDEPROPERTIES
like separatorChar
and quoteChar
?TBLPROPERTIES
like skip.header.line.count
?In Presto you do this like this:
CREATE TABLE table_name( ... columns ... )
WITH (format='CSV', csv_separator='|', skip_header_line_count=1);
You can list all supported table properties in Presto with
SELECT * FROM system.metadata.table_properties;