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

When the DDL statement was executed, the column names of the Derived Columns were not validated

    XMLWordPrintableJSON

Details

    Description

      When I execute the DDL statement, I mistakenly use the duplicate field name in THE SQL, but the execution result of the program does not throw any exception or prompt. In MergeTableLikeUtilTest. Java# mergePhysicalColumns add repeated the TableColumn (), also do not throw any exceptions, review the code logic found only on the source table schema fields, It is not a duplicate and derived tables and fields of the source table is verified, and no field of derived tables if repeated verification, adding physicalFieldNamesToTypes, there will be a repeating field coverage,The following are the execution statements and the results

      DDL sql:

      CREATE TABLE test1 (
        `log_version` string COMMENT '日志版本',
        `log_version` INTEGER COMMENT '日志版本',
        `pv_time` string COMMENT '日志时间'
      ) with(
              'connector' = 'kafka',
              'topic' = 'xxx',
              'properties.bootstrap.servers' = 'xxx:9110',
              'scan.startup.mode'='latest-offset',
              'format' = 'json',
      )

      StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
      TableResult result = tEnv.executeSql(
      CREATE TABLE test1 (
        `log_version` string COMMENT '日志版本',
        `log_version` INTEGER COMMENT '日志版本',
        `pv_time` string COMMENT '日志时间'
      ) with(
              'connector' = 'kafka',
              'topic' = 'xxx',
              'properties.bootstrap.servers' = 'xxx:9110',
              'scan.startup.mode'='latest-offset',
              'format' = 'json',
      )
      ) 
      
      

      Attachments

        1. 5261638775663_.pic.jpg
          24 kB
          shouzuo meng

        Issue Links

          Activity

            People

              m_jelly shouzuo meng
              m_jelly shouzuo meng
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: