hive - Nifi PutHive3Streaming - 写入分区表
问题描述
我正在使用 Nifi 1.7.1 写入分区的配置单元表。尽管数据已成功流式传输,但我在 hive 元存储日志中看到了几条消息:
2018-10-29T17:09:40,682 ERROR [pool-10-thread-198]: metastore.RetryingHMSHandler (RetryingHMSHandler.java:invokeInternal(201)) - AlreadyExistsException(message:Partition already exists: Partition(values:[2018, 3, 28], dbName:default, tableName:myTable, createTime:0, lastAccessTime:0, sd:StorageDescriptor(cols:[FieldSchema(name:type, type:string, comment:null), FieldSchema(name:id, type:string, comment:null), FieldSchema(name:referenced_event_id, type:string, comment:null), FieldSchema(name:happened, type:string, comment:null), FieldSchema(name:processed, type:string, comment:null), FieldSchema(name:tracking_id, type:string, comment:null), FieldSchema(name:source_attributes, type:struct<id:string,origin:string,data:map<string,string>,external_data:map<string,string>>, comment:null), FieldSchema(name:event_data, type:struct<service:struct<name:string,version:string>,result:struct<mno:string,mvno:string,mcc:string,mnc:string,country:string>>, comment:null)], location:hdfs://node-master:8020/user/hive/warehouse/myTable/year=2018/month=3/day=28, inputFormat:org.apache.hadoop.hive.ql.io.orc.OrcInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat, compressed:false, numBuckets:6, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.ql.io.orc.OrcSerde, parameters:{serialization.format=1}), bucketCols:[tracking_id], sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), parameters:null, catName:hive))
我已经尝试过:
"hive3-stream-part-vals": "${year},${month},${day}",
"hive3-stream-autocreate-partition": "false",
并且还与
"hive3-stream-autocreate-partition": "true",
有没有人清楚为什么要记录这些错误?
解决方案
我认为您遇到了https://issues.apache.org/jira/browse/HIVE-18931。您对处理器的 Max Concurrent Tasks 属性的设置是什么?如果大于1,你可以尝试将其设置为1,看看你是否仍然收到消息?如果为 1,是否有多个客户端(NiFi、beeline 等)试图同时写入该表?
推荐阅读
- python-sphinx - 如何将徽标添加到我的 readthedocs - 0px 宽的徽标渲染
- python - 条件计数分组计算
- javascript - 从绑定函数调用函数总是给我相同的值?
- docker - 在 Docker 中安装 GCP Profiler 代理时遇到问题
- c++ - “void *”类型的值不能分配给“RANDOMSTRUCT *”类型的实体
- mysql - 如果在 MySQL 中不存在,是否可以使用没有主键的 where-in 子句更新或插入?
- postgresql - PostgreSQL 10 对 config_file 和 data_directory 使用不同的目录
- reactjs - React Material-Table,如何绑定远程获取的数据?
- javascript - 提交时触发 php 和 javascript 的 HTML 表单
- javascript - 在全日历中如何禁止在我的自定义视图中选择