我正在尝试通过Storm-Hive集成将数据插入到Hive表中。
使用的风暴版本是1.2.3。 我收到以下错误消息:
必填字段“ open_txns”未设置!结构:GetOpenTxnsResponse(txn_high_water_mark:116623,open_txns:null) 在org.apache.hadoop.hive.metastore.api.GetOpenTxnsResponse.validate(GetOpenTxnsResponse.java:393)〜[hive-metastore-0
// Define the record mapper
logger.info("HIVEBOLT: Configuring the HiveBolt");
String[] colNames = { "ts", "uid", "apip", "apname", "apmac", "apmodel", "devicemac", "ssid", "status" };
DelimitedRecordHiveMapper mapper = new DelimitedRecordHiveMapper()
.withColumnFields(new Fields(colNames))
.withPartitionFields(new Fields("day"));
// Defind the Hive options
String metastoreURI = "thrift://XYZ:9083";
HiveOptions hiveOptions = new HiveOptions(metastoreURI, "default", "test_logwifi", mapper).withAutoCreatePartitions(true)
.withTxnsPerBatch(1000)
.withMaxOpenConnections(2)
.withBatchSize(2);
HiveBolt hiveBolt = new HiveBolt(hiveOptions);