Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2310

SqlParser parse multiple sql statements split by semicolon

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • None
    • 1.20.0
    • core
    • None

    Description

      Current, SqlParser only supports parse single sql statement to single SqlNode. But since we have server module, and support DDL syntax, It is common to write DDL statement and DML statement together to build a complete logic. 

      For example:

      • Table orders is a source table;
      • Table output_console is a sink table;
      • Read data from source table, do some project and filter, then write to sink table. 
      CREATE TABLE orders (
       createTime TIMESTAMP,
       productId bigint,
       orderId bigint,
       units bigint,
       user_name VARCHAR
      ); 
      
      CREATE TABLE output_console(
       createTime TIMESTAMP,
       productId bigint,
       orderId bigint,
       units bigint,
       user_name VARCHAR
      );
      
      INSERT INTO output_console
      SELECT
       createTime,
       productId,
       orderId,
       units,
       user_name
      FROM orders
      WHERE (productId>3) AND (productId<8);
      

      So, I think it really helps if SqlParser support parse multiple sql statements.

       

       

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              xu fei Fei Xu
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: