JingsongLi commented on a change in pull request #11492: [FLINK-16740][orc] 
OrcSplitReaderUtil::logicalTypeToOrcType fails to …
URL: https://github.com/apache/flink/pull/11492#discussion_r396957658
 
 

 ##########
 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:
   ```
   public TypeDescription withPrecision(int precision) {
       if (precision < 1 || precision > MAX_PRECISION || **scale > precision**){
         throw new IllegalArgumentException("precision " + precision +
             " is out of range 1 .. " + scale);
       }
       this.precision = precision;
       return this;
     }
   ```
   There is check in `withPrecision`, and default scale is 10.

----------------------------------------------------------------
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

Reply via email to