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

types with precision can't be executed in sql client with blink planner

    XMLWordPrintableJSON

Details

    Description

      I created a table in sql client with blink planner:  

      create table t (
          a int,
          b varchar,
          c decimal(10, 5))
      with (
          'connector.type' = 'filesystem',
          'format.type' = 'csv',
          'format.derive-schema' = 'true',
          'connector.path' = 'xxxxxxx'
      );
      

      The table description looks good:

      Flink SQL> describe t; 
      root 
        |-- a: INT 
        |-- b: STRING 
        |-- c: DECIMAL(10, 5)

      But the select query failed:

      Flink SQL> select * from t;
      [ERROR] Could not execute SQL statement. Reason: org.apache.flink.table.planner.codegen.CodeGenException: Incompatible types of expression and result type. Expression[GeneratedExpression(field$3,isNull$3,,DECIMAL(38, 18),None)] type is [DECIMAL(38, 18)], result type is [DECIMAL(10, 5)]
      

       

      Attachments

        Issue Links

          Activity

            People

              jark Jark Wu
              ykt836 Kurt Young
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m