[ https://issues.apache.org/jira/browse/FLINK-36378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17885288#comment-17885288 ]
Dylan He edited comment on FLINK-36378 at 9/29/24 10:14 AM: ------------------------------------------------------------ There is already a PR about this issue: [https://github.com/apache/flink/pull/24981|https://github.com/apache/flink/pull/24981] And I think we need to first define the meaning of {{{}precision{}}}. If we follow Calcite, what does it mean when {{{}scale = precision{}}}, considering the DecimalType constructor allows {{{}scale <= precision{}}}. WDYT? [~empathy87] [~lincoln.86xy] was (Author: JIRAUSER305836): There is already a PR about this issue: [https://github.com/apache/flink/pull/2498|https://github.com/apache/flink/pull/24981] And I think we need to first define the meaning of {{{}precision{}}}. If we follow Calcite, what does it mean when {{{}scale = precision{}}}, considering the DecimalType constructor allows {{{}scale <= precision{}}}. WDYT? [~empathy87] [~lincoln.86xy] > type extraction problem between java BigDecimal and sql decimal > --------------------------------------------------------------- > > Key: FLINK-36378 > URL: https://issues.apache.org/jira/browse/FLINK-36378 > Project: Flink > Issue Type: Bug > Components: Table SQL / Planner > Affects Versions: 2.0-preview > Reporter: Jacky Lau > Assignee: Jacky Lau > Priority: Major > Labels: pull-request-available > Fix For: 2.0-preview > > > add following to ValueDataTypeConverterTest > of(new BigDecimal("0.000"), DataTypes.DECIMAL(4, 3)) > org.apache.flink.table.api.ValidationException: > Decimal scale must be between 0 and the precision 1 (both inclusive). > > spark > 0.000 -> decimal(3, 3) > calcite > 0.000 -> decimal(4, 3) > so follow the calcite -- This message was sent by Atlassian Jira (v8.20.10#820010)