You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Aitozi (via GitHub)" <gi...@apache.org> on 2023/03/02 11:30:06 UTC

[GitHub] [flink] Aitozi commented on a diff in pull request #21522: [FLINK-29585][hive] Migrate TableSchema to Schema for Hive connector

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: issues-unsubscribe@flink.apache.org

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