JingsongLi commented on a change in pull request #12206:
URL: https://github.com/apache/flink/pull/12206#discussion_r426350298



##########
File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveTableSink.java
##########
@@ -143,21 +206,51 @@ public HiveTableSink(JobConf jobConf, ObjectPath 
tablePath, CatalogTable table)
                }
        }
 
-       @Override
-       public TableSink<Row> configure(String[] fieldNames, 
TypeInformation<?>[] fieldTypes) {
-               return new HiveTableSink(jobConf, tablePath, catalogTable);
+       private BulkWriter.Factory<RowData> createBulkWriterFactory(String[] 
partitionColumns,
+                       StorageDescriptor sd) {
+               String serLib = 
sd.getSerdeInfo().getSerializationLib().toLowerCase();
+               int formatFieldCount = tableSchema.getFieldCount() - 
partitionColumns.length;
+               String[] formatNames = new String[formatFieldCount];
+               LogicalType[] formatTypes = new LogicalType[formatFieldCount];
+               for (int i = 0; i < formatFieldCount; i++) {
+                       formatNames[i] = tableSchema.getFieldName(i).get();
+                       formatTypes[i] = 
tableSchema.getFieldDataType(i).get().getLogicalType();
+               }
+               RowType formatType = RowType.of(formatTypes, formatNames);
+               Configuration formatConf = new Configuration(jobConf);
+               sd.getSerdeInfo().getParameters().forEach(formatConf::set);
+               BulkWriter.Factory<RowData> bulkFactory;
+               if (serLib.contains("parquet")) {

Review comment:
       I created a JIRA for this refactor: 
https://issues.apache.org/jira/browse/FLINK-17784




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to