Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-7596

fix bug when Set Operation handles ANY type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.4, 1.4.0
    • Table SQL / API
    • None

    Description

      If two inputs with Any(GenericRelDataType), when they comes to Set Operation(UNION, MINUS,...), it will cause a TableException with info is "Type is not supported: ANY"
      Here is the test case:

      @Test
        def testUnion(): Unit = {
          val list = List((1, new NODE), (2, new NODE))
          val list2 = List((3, new NODE), (4, new NODE))
          val env = StreamExecutionEnvironment.getExecutionEnvironment
          val tEnv = TableEnvironment.getTableEnvironment(env)
          val s1 = tEnv.fromDataStream(env.fromCollection(list))
          val s2 = tEnv.fromDataStream(env.fromCollection(list2))
          val result = s1.unionAll(s2).toAppendStream[Row]
          result.addSink(new StreamITCase.StringSink[Row])
          env.execute()
        }
      
        class NODE {
        val x = new util.HashMap[String, String]()
      }
      

      This bug happens because Flink doesn't handle createSqlType(ANY) and Calcite doesn't know the differences between ANY and ANY(GenericRelDataType), so the createSqlType(ANY) of Calcite will return a BasicSqlType instead.

      Attachments

        Activity

          People

            RuidongLi Ruidong Li
            RuidongLi Ruidong Li
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: