Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-16987 FLIP-95: Add new table source and sink interfaces
  3. FLINK-26712

Metadata keys should not conflict with physical columns

    XMLWordPrintableJSON

Details

    Description

      If you have an field called timestamp and in addition want to read the timestamp from the metadata:

      CREATE TABLE animal_sightings_with_metadata (
        `timestamp` TIMESTAMP(3),
        `name` STRING,
        `country` STRING,
        `number` INT,
        `append_time` TIMESTAMP(3) METADATA FROM 'timestamp',
        `partition` BIGINT METADATA VIRTUAL,
        `offset` BIGINT METADATA VIRTUAL,
        `headers` MAP<STRING, BYTES> METADATA,
        `timestamp-type` STRING METADATA,
        `leader-epoch` INT METADATA,
        `topic` STRING METADATA
      )
      

      This gives:

      [ERROR] Could not execute SQL statement. Reason:
      org.apache.flink.table.api.ValidationException: Field names must be unique. Found duplicates: [timestamp]
      

      Attachments

        Issue Links

          Activity

            People

              twalthr Timo Walther
              twalthr Timo Walther
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: