gong commented on code in PR #8096:
URL: https://github.com/apache/inlong/pull/8096#discussion_r1208776632
##########
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/hive/src/main/java/org/apache/inlong/sort/hive/HiveTableSink.java:
##########
@@ -170,23 +188,50 @@ private DataStreamSink<?> consume(
try (HiveMetastoreClientWrapper client =
HiveMetastoreClientFactory.create(HiveConfUtils.create(jobConf), hiveVersion)) {
- Table table = client.getTable(dbName, identifier.getObjectName());
- StorageDescriptor sd = table.getSd();
-
- Class hiveOutputFormatClz =
-
hiveShim.getHiveOutputFormatClass(Class.forName(sd.getOutputFormat()));
+ StorageDescriptor sd;
+ Properties tableProps = new Properties();
+ Class hiveOutputFormatClz;
+ HiveWriterFactory writerFactory;
+ boolean sinkMultipleEnable = Boolean.parseBoolean(
+
catalogTable.getOptions().getOrDefault(SINK_MULTIPLE_ENABLE.key(), "false"));
boolean isCompressed =
jobConf.getBoolean(HiveConf.ConfVars.COMPRESSRESULT.varname, false);
- HiveWriterFactory writerFactory =
- new HiveWriterFactory(
- jobConf,
- hiveOutputFormatClz,
- sd.getSerdeInfo(),
- tableSchema,
- getPartitionKeyArray(),
- HiveReflectionUtils.getTableMetadata(hiveShim,
table),
- hiveShim,
- isCompressed);
+ if (sinkMultipleEnable) {
+ sd = new StorageDescriptor();
+ SerDeInfo serDeInfo = new SerDeInfo();
+
serDeInfo.setSerializationLib("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe");
Review Comment:
Maybe, this param can be passed by HiveOptions, deafult valuse is
"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe";
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]