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

flink sql convert constant to char type cause loop

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.9.1
    • None
    • Table SQL / Planner
    • None

    Description

      sql:

      SELECT
       '公开发债' AS secondary_business
      FROM VarBondCode
      WHERE stock_type = '77';

      code is:

      org.apache.flink.table.planner.codegen.CodeGeneratorContext#addReusableStringConstants

      when it parse constant, it change to unicode, and str length is change, in this case secondary_business is char(4), and after  change it become '_UTF-16LE'\u516C\u5F00\u53D1\u503A''.

      calcite call makecast func can't remove it,and call it loop;

      org.apache.calcite.rex.RexBuilder#canRemoveCastFromLiteral

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              xiaodao xiaodao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: