You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "jackye1995 (via GitHub)" <gi...@apache.org> on 2023/03/23 20:35:57 UTC

[GitHub] [iceberg] jackye1995 commented on a diff in pull request #3249: Optimized spark vectorized read parquet decimal

jackye1995 commented on code in PR #3249:
URL: https://github.com/apache/iceberg/pull/3249#discussion_r1146803677


##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/GenericArrowVectorAccessorFactory.java:
##########
@@ -166,12 +169,20 @@ public ArrowVectorAccessor<DecimalT, Utf8StringT, ArrayT, ChildVectorT> getVecto
 
   @SuppressWarnings("checkstyle:CyclomaticComplexity")
   private ArrowVectorAccessor<DecimalT, Utf8StringT, ArrayT, ChildVectorT> getPlainVectorAccessor(
-      FieldVector vector) {
+      FieldVector vector, PrimitiveType primitive) {
+    boolean isDecimal =
+        primitive != null && OriginalType.DECIMAL.equals(primitive.getOriginalType());
     if (vector instanceof BitVector) {
       return new BooleanAccessor<>((BitVector) vector);
     } else if (vector instanceof IntVector) {
+      if (isDecimal) {

Review Comment:
   can we move `isDecimal` to a private method and only invoke it in the specific if branches? Because these branches are mutually exclusive, we don't need to compute it for all the other cases.



-- 
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@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org