blob: 66d28b6bba2ad643e4d5727817dd2d60980ced83 [file] [log] [blame]
-- Set a default storage handler class
SET hive.default.storage.handler.class=org.apache.hadoop.hive.ql.log.syslog.SyslogStorageHandler;
CREATE EXTERNAL TABLE test_tbl_with_default(a string, b int);
DESCRIBE FORMATTED test_tbl_with_default;
-- Set a default storage handler class,
-- create table command contains a STORED AS clause to be ignored
SET hive.default.storage.handler.class=org.apache.hadoop.hive.ql.log.syslog.SyslogStorageHandler;
CREATE EXTERNAL TABLE test_tbl_with_default_orc(a string, b int) STORED AS ORC;
DESCRIBE FORMATTED test_tbl_with_default_orc;
-- Default storage handler is set, but overridden explicitly in the create table command
SET hive.default.storage.handler.class=org.apache.hadoop.hive.ql.log.syslog.SyslogStorageHandler;
CREATE EXTERNAL TABLE test_tbl_overridden(DB_ID bigint, NAME STRING)
STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler'
TBLPROPERTIES (
"hive.sql.database.type" = "METASTORE",
"hive.sql.query" = "SELECT DB_ID, NAME FROM DBS"
);
DESCRIBE FORMATTED test_tbl_overridden;
-- Unset default storage handler prop
SET hive.default.storage.handler.class=;
CREATE EXTERNAL TABLE test_tbl_no_default(a string, b int) STORED AS ORC;
DESCRIBE FORMATTED test_tbl_no_default;