You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2021/03/27 15:52:17 UTC

[GitHub] [drill] luocooong commented on a change in pull request #2193: DRILL-7887: JDBC plugin returns incorrect precision for SUM(DECIMAL) queries

luocooong commented on a change in pull request #2193:
URL: https://github.com/apache/drill/pull/2193#discussion_r602734638



##########
File path: contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcRecordReader.java
##########
@@ -210,8 +212,8 @@ public void setup(OperatorContext operatorContext, OutputMutator output) {
         String name = columns.get(i - 1).getRootSegmentPath();
         // column index in ResultSetMetaData starts from 1
         int jdbcType = meta.getColumnType(i);
-        int width = meta.getPrecision(i);
-        int scale = meta.getScale(i);
+        int width = Math.min(meta.getPrecision(i), DRILL_REL_DATATYPE_SYSTEM.getMaxNumericPrecision());

Review comment:
       The function of `min()` is to prevent the precision of the back-end database from exceeding the limit of Drill, so a selection is required, Is right?




-- 
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:
users@infra.apache.org