Copilot commented on code in PR #6707:
URL: https://github.com/apache/hive/pull/6707#discussion_r3829049023
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/vector/HiveBatchIterator.java:
##########
@@ -99,24 +113,14 @@ private void advance() {
int idx = vrbCtx.findVirtualColumnNum(vc);
switch (vc) {
case PARTITION_SPEC_ID:
- value = idToConstant.get(MetadataColumns.SPEC_ID.fieldId());
- vrbCtx.addPartitionColsToBatch(batch.cols[idx], value, idx);
+ vrbCtx.addPartitionColsToBatch(batch.cols[idx], specId, idx);
break;
case PARTITION_HASH:
- value = IcebergAcidUtil.computeHash(
- (StructProjection)
idToConstant.get(MetadataColumns.PARTITION_COLUMN_ID));
- vrbCtx.addPartitionColsToBatch(batch.cols[idx], value, idx);
+ vrbCtx.addPartitionColsToBatch(batch.cols[idx], partitionHash,
idx);
break;
case FILE_PATH:
- value = idToConstant.get(MetadataColumns.FILE_PATH.fieldId());
BytesColumnVector bcv = (BytesColumnVector) batch.cols[idx];
- if (value == null) {
- bcv.noNulls = false;
- bcv.isNull[0] = true;
- bcv.isRepeating = true;
- } else {
- bcv.fill(((String) value).getBytes());
- }
+ bcv.fill(filePath.getBytes());
break;
Review Comment:
`BytesColumnVector.fill` does not reset `noNulls`, and using
`String#getBytes()` relies on the platform default charset. Since `FILE_PATH`
is always populated here, set `noNulls=true` explicitly and encode
deterministically (UTF-8) to avoid extra null-handling overhead and
platform-dependent behavior.
This issue also appears on line 133 of the same file.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]