amogh-jahagirdar commented on code in PR #12102:
URL: https://github.com/apache/iceberg/pull/12102#discussion_r1932562952


##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetValueReaders.java:
##########
@@ -52,6 +59,81 @@ public static <T> ParquetValueReader<T> option(
     return reader;
   }
 
+  public static ParquetValueReader<Integer> unboxed(ColumnDescriptor desc) {
+    return new UnboxedReader<>(desc);
+  }
+
+  public static ParquetValueReader<String> strings(ColumnDescriptor desc) {
+    return new StringReader(desc);
+  }
+
+  public static ParquetValueReader<ByteBuffer> byteBuffers(ColumnDescriptor 
desc) {
+    return new BytesReader(desc);
+  }
+
+  public static ParquetValueReader<Long> intsAsLongs(ColumnDescriptor desc) {
+    return new IntAsLongReader(desc);
+  }
+
+  public static ParquetValueReader<Double> floatsAsDoubles(ColumnDescriptor 
desc) {
+    return new FloatAsDoubleReader(desc);
+  }
+
+  public static ParquetValueReader<BigDecimal> bigDecimals(ColumnDescriptor 
desc) {
+    LogicalTypeAnnotation decimal = 
desc.getPrimitiveType().getLogicalTypeAnnotation();
+    Preconditions.checkArgument(
+        decimal instanceof DecimalLogicalTypeAnnotation,
+        "Invalid timestamp logical type: " + decimal);
+
+    int scale = ((DecimalLogicalTypeAnnotation) decimal).getScale();
+
+    switch (desc.getPrimitiveType().getPrimitiveTypeName()) {
+      case FIXED_LEN_BYTE_ARRAY:
+      case BINARY:
+        return new BinaryAsDecimalReader(desc, scale);
+      case INT64:
+        return new LongAsDecimalReader(desc, scale);
+      case INT32:
+        return new IntegerAsDecimalReader(desc, scale);
+    }
+    throw new IllegalArgumentException(

Review Comment:
   Good catch, I think we should to make it consistent with the formatting in 
other parts of the code base



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

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


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

Reply via email to