You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "luoyuxia (Jira)" <ji...@apache.org> on 2022/04/07 10:00:00 UTC

[jira] [Created] (FLINK-27116) Supports Hive table partitioned by decimal

luoyuxia created FLINK-27116:
--------------------------------

             Summary: Supports Hive table partitioned by decimal
                 Key: FLINK-27116
                 URL: https://issues.apache.org/jira/browse/FLINK-27116
             Project: Flink
          Issue Type: Sub-task
          Components: Connectors / Hive
            Reporter: luoyuxia


When create a table partitioned by decimal, then when try to read the table, it will throw the exception "Can not convert xxx to type decimal for partition value".

It can be reproduces using the following code in HiveDialectITCase
{code:java}
@Test
public void t1() throws Exception {
    tableEnv.executeSql("create table src (x int,y string)");
    tableEnv.executeSql("insert into src values (1,'a'),(2,'b'),(3,'c')").await();
    // test table partitioned by decimal
    tableEnv.executeSql(
            "create table dest3 (key int, value string) partitioned by (p1 decimal(5, 2)) ");
    tableEnv.executeSql("insert overwrite dest3 partition (p1) select 1,y,100.45 from src")
            .await();
    List<Row> results = queryResult(tableEnv.sqlQuery("select * from dest3"));
    System.out.println(results);
} {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)