lirui-apache commented on a change in pull request #11492: [FLINK-16740][orc]
OrcSplitReaderUtil::logicalTypeToOrcType fails to …
URL: https://github.com/apache/flink/pull/11492#discussion_r396956810
##########
File path:
flink-formats/flink-orc/src/main/java/org/apache/flink/orc/OrcSplitReaderUtil.java
##########
@@ -158,8 +158,8 @@ static TypeDescription logicalTypeToOrcType(LogicalType
type) {
case DECIMAL:
DecimalType decimalType = (DecimalType) type;
return TypeDescription.createDecimal()
-
.withPrecision(decimalType.getPrecision())
-
.withScale(decimalType.getScale());
+
.withScale(decimalType.getScale())
Review comment:
I had some explanations in the description of this PR. In short, it's
because ORC `TypeDescription` assumes default scale to be 10, and asserts
`scale < precision` when we set the precision.
It'd be better if they provide an interface to set precision and scale in
one go.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services