CREATE TABLE FIREWALL_LOGS(
time STRING,
ip STRING,
country STRING,
status INT
)
CLUSTERED BY (time) into 25 buckets
STORED AS ORC
FIELDS TERMINATED BY '|'
LOCATION '/tmp/server-logs'
TBLPROPERTIES("transactional"="true");
Results in:
java.lang.Exception: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 9:0 missing EOF at 'FIELDS' near ')'
CREATE TABLE FIREWALL AS STORED AS ORC SELECT * FROM FIREWALL_LOGS;
Results in:
org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:25 cannot recognize input near 'STORED' 'AS' 'ORC' in select clause
CREATE TABLE FIREWALL STORED AS ORC SELECT * FROM FIREWALL_LOGS;
should work, but doesn't. Still get parser error:
Error while compiling statement: FAILED: ParseException line 1:36 missing EOF at 'SELECT' near 'ORC' (state=42000,code=40000)
NOTE: not supported for external tables