1、hive 同步到 holo,数据量不一致,可能是 holo 的主键不唯一导致的,即hive的粒度不唯一。
2、sql文件注释 不能有 分号。不然会报找不到字段错误,且非常不明显。
3、查看hdfs文件大小: hdfs dfs -du -h -s hdfs路径
4、holo主键的任一字段不能为 null 值,否则 hive 2 holo 会失败,数据量会对不齐,可在aiflow的Log 上看到 first err:Put primary key cannot be null:field_name
5、kafka 一个消费组可以订阅多个不同的topic
6、hive 2 holo的 sql必须字段名对齐holo的表字段名,如果没对齐,会报很奇怪的错误: NullPointerException / Interger2Int。如果表结构字段名不一致,通过 as holo_field_name 解决。
7、意外将hive表某分区数据删掉了怎么恢复?
hdfs dfs -mkdir -p table_hdfs_path/partition_name=xxx
hdfs dfs -mv /user/hadoop/.Trash/Current/table_hdfs_path/partition_name=xxx/* table_hdfs_path/partition_name=xxx/
8、group by 的字段里,能含null值
with t as (
select 1 as id,null as name,5 as score
union all
select 1 as id,null as name,15 as score
)
select id,name,sum(score)
from t
group by id,name
9、去掉左边的空格,以0替换
select replace(ltrim(replace(field,'0'