Aitozi commented on code in PR #21522:
URL: https://github.com/apache/flink/pull/21522#discussion_r1122954392


##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveTableSink.java:
##########
@@ -558,14 +559,14 @@ private HadoopFileSystemFactory fsFactory() {
     }
 
     private Optional<BulkWriter.Factory<RowData>> createBulkWriterFactory(
-            String[] partitionColumns, StorageDescriptor sd) {
+            List<String> partitionColumns, StorageDescriptor sd) {
         String serLib = sd.getSerdeInfo().getSerializationLib().toLowerCase();
-        int formatFieldCount = tableSchema.getFieldCount() - 
partitionColumns.length;
+        int formatFieldCount = resolvedSchema.getColumns().size() - 
partitionColumns.size();
         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();
+            formatNames[i] = resolvedSchema.getColumn(i).get().getName();

Review Comment:
   fixed



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

Reply via email to