[
https://issues.apache.org/jira/browse/FLINK-29445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17610463#comment-17610463
]
Martijn Visser commented on FLINK-29445:
----------------------------------------
[~maskainv] Can you please verify this with Flink 1.15, since the Flink
community doesn't support Flink 1.12 anymore
> When the decimal table column field is printed,program is error
> ---------------------------------------------------------------
>
> Key: FLINK-29445
> URL: https://issues.apache.org/jira/browse/FLINK-29445
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / API, Table SQL / Runtime
> Affects Versions: 1.12.0
> Environment: <flink.version>1.12.0</flink.version>
> flink-table-api-java-bridge_2.11
> flink-table-planner_2.11
> flink-streaming-scala_2.11
> Reporter: liuzhiyong
> Priority: Major
> Labels: flink, table-api
> Attachments: image-2022-09-28-16-18-17-953.png, pom.xml
>
> Original Estimate: 168h
> Remaining Estimate: 168h
>
> runtime is java
> error code:
> tEnv.executeSql("select `openScore` from demo").print();
> openScore field is BigDecimal
> error log is:
> Exception in thread "main" java.lang.ClassCastException:
> org.apache.flink.table.types.logical.LegacyTypeInformationType cannot be cast
> to org.apache.flink.table.types.logical.DecimalType
> at
> org.apache.flink.table.utils.PrintUtils.columnWidthsByType(PrintUtils.java:264)
> at
> org.apache.flink.table.utils.PrintUtils.printAsTableauForm(PrintUtils.java:127)
> at
> org.apache.flink.table.api.internal.TableResultImpl.print(TableResultImpl.java:149)
> at com.mask.maintest.TestTableEnv.main(TestTableEnv.java:74)
>
> source code position:
> class : PrintUtils
> line: 177
> len = ((DecimalType)type).getPrecision() + 2;
>
> !image-2022-09-28-16-18-17-953.png!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)