这里建的是外部分区表 字段 database 、table 、type 是关键字用 瓢号引上
CREATE EXTERNAL TABLE ods_kyy_db_rt.ods_xx_db_binlog_rt( database string COMMENT ‘’, table string COMMENT ‘’, type string COMMENT ‘’, ts bigint COMMENT ‘’, xid bigint COMMENT ‘’, xoffset bigint COMMENT ‘’, commit boolean COMMENT ‘’, primary_key string COMMENT ‘’, primary_key_columns string COMMENT ‘’, data string COMMENT ‘’, old string COMMENT ‘’) COMMENT ‘xxbinlog日志数据’ PARTITIONED BY ( dt string) ROW FORMAT SERDE ‘org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe’ WITH SERDEPROPERTIES ( ‘field.delim’=‘’, ‘serialization.format’=‘’) STORED AS INPUTFORMAT ‘org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat’ OUTPUTFORMAT ‘org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat’ LOCATION ‘oss://bigdata-oss-xx/user/hive/warehouse/ods_xx_db.db/offline/ods_xx_db_binlog’
|