xuefuz commented on a change in pull request #9390: [FLINK-13534][hive] Unable to query Hive table with decimal column URL: https://github.com/apache/flink/pull/9390#discussion_r312205426
########## File path: flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/TableEnvHiveConnectorTest.java ########## @@ -138,6 +138,34 @@ private void readWriteFormat(String format) throws Exception { hiveShell.execute("drop database db1 cascade"); } + @Test + public void testDecimal() throws Exception { + hiveShell.execute("create database db1"); + try { + // Hive's default decimal is decimal(10, 0) + hiveShell.execute("create table db1.src1 (x decimal)"); + hiveShell.execute("create table db1.src2 (x decimal)"); + hiveShell.execute("create table db1.dest (x decimal)"); + // populate src1 from Hive + hiveShell.execute("insert into db1.src1 values (1),(2.0),(5.4),(5.5),(123456789123)"); + + TableEnvironment tableEnv = getTableEnvWithHiveCatalog(); + // populate src2 with same data from Flink + tableEnv.sqlUpdate("insert into db1.src2 values (cast(1 as decimal(10,0))), (cast(2.0 as decimal(10,0))), " + Review comment: could we have some non-zero scale decimal types? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services