bhat-vinay commented on code in PR #10272:
URL: https://github.com/apache/hudi/pull/10272#discussion_r1421923242
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/table/action/commit/BulkInsertDataInternalWriterHelper.java:
##########
@@ -124,7 +129,31 @@ public void write(InternalRow row) throws IOException {
lastKnownPartitionPath = partitionPath.clone();
}
- handle.write(row);
+ boolean shouldDropPartitionColumns =
writeConfig.shouldDropPartitionColumns();
+ if (shouldDropPartitionColumns) {
+ // Drop the partition columns from the row
+ List<String> partitionCols =
JavaConverters.<String>seqAsJavaList(HoodieDatasetBulkInsertHelper.getPartitionPathCols(this.writeConfig));
+ Set<Integer> partitionIdx = new HashSet<Integer>();
+ for (String col : partitionCols) {
+ partitionIdx.add(this.structType.fieldIndex(col));
+ }
+
+ // TODO: Assumes that InternalRow::toSeq(...) preserves the column
ordering based on
+ // the supplied schema
Review Comment:
Tested with a few different sizes and types. It preserved the column
ordering.
--
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]