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

Failed to CAST('abcde', VARBINARY)

    XMLWordPrintableJSON

Details

    Description

      Please add test in the CalcITCase

      @Test
        def testCalc(): Unit = {
          val sql =
            """
              |SELECT CAST('abcde' AS VARBINARY(6))
              |""".stripMargin
          val result = tEnv.executeSql(sql)
          print(result.getResolvedSchema)
          result.print()
        }
      

      The exception is

      Caused by: org.apache.flink.table.api.TableException: Odd number of characters.
      	at org.apache.flink.table.utils.EncodingUtils.decodeHex(EncodingUtils.java:203)
      	at StreamExecCalc$33.processElement(Unknown Source)
      	at org.apache.flink.streaming.runtime.tasks.ChainingOutput.pushToOperator(ChainingOutput.java:99)
      	at org.apache.flink.streaming.runtime.tasks.ChainingOutput.collect(ChainingOutput.java:80)
      	at org.apache.flink.streaming.runtime.tasks.ChainingOutput.collect(ChainingOutput.java:39)
      	at org.apache.flink.streaming.api.operators.CountingOutput.collect(CountingOutput.java:56)
      	at org.apache.flink.streaming.api.operators.CountingOutput.collect(CountingOutput.java:29)
      	at org.apache.flink.streaming.api.operators.StreamSourceContexts$ManualWatermarkContext.processAndCollect(StreamSourceContexts.java:418)
      	at org.apache.flink.streaming.api.operators.StreamSourceContexts$WatermarkContext.collect(StreamSourceContexts.java:513)
      	at org.apache.flink.streaming.api.operators.StreamSourceContexts$SwitchingOnClose.collect(StreamSourceContexts.java:103)
      	at org.apache.flink.streaming.api.functions.source.InputFormatSourceFunction.run(InputFormatSourceFunction.java:92)
      	at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:110)
      	at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:67)
      	at org.apache.flink.streaming.runtime.tasks.SourceStreamTask$LegacySourceFunctionThread.run(SourceStreamTask.java:332)
      
      

      Attachments

        Activity

          People

            matriv Marios Trivyzas
            fsk119 Shengkai Fang
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: