flyrain commented on code in PR #4588:
URL: https://github.com/apache/iceberg/pull/4588#discussion_r854465525
##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ColumnVectorWithFilter.java:
##########
@@ -97,9 +97,18 @@ public byte[] getBinary(int rowId) {
return accessor().getBinary(rowIdMapping[rowId]);
}
+ static ConstantColumnVector constantColumnVector(VectorHolder holder, int
numRows) {
+ Object constant = ((ConstantVectorHolder) holder).getConstant();
+ if (constant instanceof Boolean) {
+ return new ConstantColumnVector(Types.BooleanType.get(), numRows,
constant);
+ } else {
+ return new ConstantColumnVector(Types.IntegerType.get(), numRows,
constant);
+ }
+ }
+
public static ColumnVector forHolder(VectorHolder holder, int[]
rowIdMapping, int numRows) {
return holder.isDummy() ?
- new ConstantColumnVector(Types.IntegerType.get(), numRows,
((ConstantVectorHolder) holder).getConstant()) :
Review Comment:
I copied some code from class `IcebergArrowColumnVector`, and didn't change
its construction logic. But I agreed with you that we shouldn't hard-code to
int type.
--
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]