XMLWordPrintableJSON

Details

    Description

      When in hive dialect, it's found that the expression `cast null as bigint` will result in string type. Then it will cause the following sql fail:

      create table t(a ARRAY<BIGINT>)
      insert into t select array(cast(null as bigint)) 

      The exception is:

      org.apache.flink.table.api.ValidationException: Column types of query result and sink for 'test-catalog.default.t' do not match.
      Cause: Incompatible types for sink column 'a' at position 0.Query schema: [_o__c0: ARRAY<STRING>]
      Sink schema:  [a: ARRAY<BIGINT>] 

      Introduce by FLINK-26474, after that we will fold `cast null as bigint` to `null `which will then considered as the null type. And for null type as argument, the function `array` will get a result type of array<string>. 

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: