【详述】
hive表为hive外表数据存在oss中
CREATE EXTERNAL TABLE xq_ods.xq_ods_pay_data_o_gooddetail_incr_d
(
id
bigint COMMENT ‘id标识’,
good_id
string COMMENT ‘商品id’,
good_name
string COMMENT ‘商品名称’,
price
double COMMENT ‘商品单价’,
quantity
bigint COMMENT ‘商品数量’,
category
string COMMENT ‘商品类别’,
create_date
string COMMENT ‘创建时间’,
modify_date
string COMMENT ‘最后更新时间’,
extend1
string COMMENT ‘扩展字段1’,
extend2
string COMMENT ‘扩展字段2’,
extend3
string COMMENT ‘扩展字段3’)
COMMENT ‘订单详情表’
PARTITIONED BY (
pt_d
string,
pt_db
string,
pt_t
string)
ROW FORMAT SERDE
‘org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe’
STORED AS INPUTFORMAT
‘org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat’
OUTPUTFORMAT
‘org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat’
LOCATION
‘oss://test-data/xq_ods_pay_data_o_gooddetail_incr_d’;
StarRocks外表:
CREATE EXTERNAL TABLE xq_ods_pay_data_o_gooddetail_incr_d(
id
bigint COMMENT ‘id标识’,
good_id
varchar(1000) COMMENT ‘商品id’,
good_name
varchar(1000) COMMENT ‘商品名称’,
price
double COMMENT ‘商品单价’,
quantity
bigint COMMENT ‘商品数量’,
category
varchar(1000) COMMENT ‘商品类别’,
create_date
varchar(1000) COMMENT ‘创建时间’,
modify_date
varchar(1000) COMMENT ‘最后更新时间’,
extend1
varchar(1000) COMMENT ‘扩展字段1’,
extend2
varchar(1000) COMMENT ‘扩展字段2’,
extend3
varchar(1000) COMMENT ‘扩展字段3’,
p__pt_d
varchar(1000),
p__pt_db
varchar(1000),
p__pt_t
varchar(1000)
)ENGINE=HIVE
COMMENT ‘订单详情表’
PROPERTIES (
“resource” = “hive0”,
“database” = “xq_ods”,
“table” = “xq_ods_pay_data_o_gooddetail_incr_d”
);
报错信息:
Caused by: java.lang.ClassNotFoundException: Class org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2329) ~[hadoop-common-2.10.1.jar:?]
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2423) ~[hadoop-common-2.10.1.jar:?]
… 27 more
【业务影响】 无法使用
【StarRocks版本】starrocks 1.9