soumyakanti3578 commented on code in PR #6274:
URL: https://github.com/apache/hive/pull/6274#discussion_r2718378862
##########
ql/src/java/org/apache/hadoop/hive/ql/io/parquet/write/DataWritableWriter.java:
##########
@@ -180,6 +183,23 @@ private DataWriter createWriter(ObjectInspector inspector,
Type type) {
}
}
+ /**
+ * Return the decimal type information defined by the Parquet schema. This
ensures the writer
+ * uses the declared precision/scale.
+ * @param type Type that contains information about the type schema.
+ * @param inspector The object inspector used to get the value type.
+ * @return DecimalTypeInfo The decimal type info object with proper
precision and scale.
+ */
+ private DecimalTypeInfo getSchemaDecimalTypeInfo(Type type,
HiveDecimalObjectInspector inspector) {
+ LogicalTypeAnnotation logicalType = type.getLogicalTypeAnnotation();
+ if (logicalType instanceof DecimalLogicalTypeAnnotation) {
+ LogicalTypeAnnotation.DecimalLogicalTypeAnnotation decimal =
(DecimalLogicalTypeAnnotation) logicalType;
Review Comment:
nit: a cleaner way with newer java feature (https://openjdk.org/jeps/394) is:
```
if (logicalType instanceof DecimalLogicalTypeAnnotation decimal) {
```
But this is not strictly needed and this can be merged without this change.
--
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]