[ https://issues.apache.org/jira/browse/FLINK-16577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17058370#comment-17058370 ]
Shuo Cheng edited comment on FLINK-16577 at 3/13/20, 2:45 AM: -------------------------------------------------------------- I think one possible solution is when we get value from RexLiteral using FlinkRelOptUtil#getLiteralValue(..), we do not get value by its `concrete type`, but by its `broad type`. e.g., for RexLiteral(1), now we get "Integer(1)", after modifying, it'll be 'BigDecimal(1)'. was (Author: icshuo): I think one possible solution is when we get value from RexLiteral, we do not get the > Exception will be thrown when computing columnInterval relmetadata in some > case > ------------------------------------------------------------------------------- > > Key: FLINK-16577 > URL: https://issues.apache.org/jira/browse/FLINK-16577 > Project: Flink > Issue Type: Bug > Components: Table SQL / Planner > Affects Versions: 1.10.0 > Reporter: Shuo Cheng > Priority: Major > Fix For: 1.11.0 > > Attachments: image-2020-03-13-10-32-35-375.png, > image-2020-03-13-10-38-17-001.png > > > Consider the following SQL > > {code:java} > // a: INT, c: LONG > SELECT > c, SUM(a) > FROM T > WHERE a > 0.1 AND a < 1 > GROUP BY c{code} > > Here the sql type of 0.1 is Decimal and 1 is Integer, and they are both in > NUMERIC type family, and do not trigger type coercion, so the plan is: > {code:java} > FlinkLogicalAggregate(group=[{0}], EXPR$1=[SUM($1)]) > +- FlinkLogicalCalc(select=[c, a], where=[AND(>(a, 0.1:DECIMAL(2, 1)), <(a, > 1))]) > +- FlinkLogicalTableSourceScan(table=[[...]], fields=[a, b, c]) > {code} > When we calculate the filtered column interval of calc, it'll lead to > validation exception of `FiniteValueInterval`: > !image-2020-03-13-10-32-35-375.png! -- This message was sent by Atlassian Jira (v8.3.4#803005)