文章目录
StarRocks数据导入
Broker Load
使用 broker load 导入 hdfs 文件,需要在 Be 和 Broker 的 conf 目录中添加 HDFS的 hdfs-site.xml、core-site.xml、hive-site.xml ,配置HDFS集群 hosts 。
-- hive建表 creation_month为分区字段
CREATE TABLE `ads_crm_sales_visit_statistics_details2`(
`id` string COMMENT '拜访id',
`sales_id` bigint COMMENT '销售id',
...
`exception_elimination` bigint COMMENT '客户统计异常拜访1表示是要排除的0表示不排除',
`row_id` bigint COMMENT '虚拟主键')
COMMENT '销售异常拜访-拜访临时表'
PARTITIONED BY (
`creation_month` string COMMENT '创建月份')
-- 查看hive表分区
show partitions ads_crm_sales_visit_statistics_details2;
-- SR建表 creation_month为排序键和分区字段
CREATE TABLE `ads_crm_sales_visit_statistics_details2` (
`creation_month` date ,
`creation_date` string ,
`id` string ,
`sales_id` bigint ,
.....
`exception_elimination` bigint ,
`row_id` bigint
) ENGINE=OLAP
DUPLICATE KEY(`creation_month`, `creation_date`)
PARTITION BY RANGE(`creation_month`)
(
START ("2022-05-01") END ("2023-02-01") EVERY (INTERVAL 1 MONTH)
)
DISTRIBUTED BY HASH(`row_id`) BUCKETS 6
;
ETL 集群导数
使用 broker load 导入 hdfs 文件,需要在 Be 和 Broker 的 conf 目录中添加 HDFS的 hdfs-site.xml、core-site.xml、hive-site.xml ,配置HDFS集群 hosts 。
[ 开通 S

最低0.47元/天 解锁文章
566

被折叠的 条评论
为什么被折叠?



