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

the 'create table [if not exists]' syntax is not supported

    XMLWordPrintableJSON

Details

    Description

      The 'create table [if not exists]' syntax is not supported by FlinkSqlParserImpl. For example, the following example will throw an error:

       

      CREATE TABLE IF NOT EXISTS default_catalog.default_database.access_log_hive (
           source_ip VARCHAR,
           target_ip VARCHAR,
           behavior VARCHAR,
           comm VARCHAR,
           ts TIMESTAMP(3)
       ) WITH (
           'key' = 'value',
            ...
       )
      

      The error message is like this:

      Caused by: org.apache.flink.table.api.SqlParserException: SQL parse failed. Encountered "NOT" at line 1, column 17.
       Was expecting one of:
       {{ <EOF> }}
       {{ "WITH" ...}}
       {{ "COMMENT" ...}}
       {{ "PARTITIONED" ...}}
       {{ "(" ...}}
       {{ "." ...}}

       

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            muzimusi muzimusi
            Votes:
            0 Vote for this issue
            Watchers:
            6 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 - 10m
                10m