Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-26360 [Umbrella] Improvement for Hive Query Syntax Compatibility
  3. FLINK-27015

Fix exception for casting timestamp to decimal in Hive dialect

    XMLWordPrintableJSON

Details

    Description

      In hive, it's support to cast timestamp to decimal implictly with following sql:

      create table t1 (c1 DECIMAL(38,6));
      create table t2 (c2 TIMESTAMP);
      insert into t1 select * from t2;
      -- or
      select cast(cast('2012-12-19 11:12:19.1234567' as timestamp) as decimal(30,8))

      But it'll throw exception "The cast conversion from TIMESTAMP type to NUMERIC type is not allowed" with Hive dialect in Flink. 

      Attachments

        Activity

          People

            luoyuxia luoyuxia
            luoyuxia luoyuxia
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: