Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15616

Calcite. Failed to parse UPDATE query.

Details

    • Bug
    • Status: Reopened
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • sql

    Description

      Seems we need to support DEFAULT in Parser.jj or extend it

      SqlNode SqlUpdate() :
      ...
          <SET> id = SimpleIdentifier() {
              targetColumnList.add(id);
          }
          // TODO:  support DEFAULT also
      

       

      statement ok
      UPDATE integers i1 SET i=DEFAULT WHERE i=(SELECT MIN(i) FROM integers WHERE i1.id<id);
      
      query II
      SELECT id, i FROM integers ORDER BY id
      ----
      1	NULL
      2	NULL
      3	2
      4	3
      
      Statement [queries=ArrayList [UPDATE integers i1 SET i=DEFAULT WHERE i=(SELECT MIN(i) FROM integers WHERE i1.id<id);], expected=OK]
      
      	at org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner$Statement.execute(SqlScriptRunner.java:404)
      	at org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner.run(SqlScriptRunner.java:115)
      	at org.apache.ignite.internal.processors.query.calcite.logical.ScriptTestRunner$1.run(ScriptTestRunner.java:219)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to parse query.
      	at org.apache.ignite.internal.processors.query.calcite.util.Commons.parse(Commons.java:205)
      
      /subquery/scalar/test_update_subquery.test[_ignore]
      

      Attachments

        Issue Links

          Activity

            vladsz83 Vladimir Steshin added a comment - - edited

            There is no support for 'DEFAULT' in 'update' statement in Calcite: `// TODO: support DEFAULT also` in Parser.jj#SqlUpdate().

            vladsz83 Vladimir Steshin added a comment - - edited There is no support for 'DEFAULT' in 'update' statement in Calcite: `// TODO: support DEFAULT also` in Parser.jj#SqlUpdate().

            The issue is still actual and it doesn't matter implemented it in Calcite or not

            jooger Iurii Gerzhedovich added a comment - The issue is still actual and it doesn't matter implemented it in Calcite or not

            People

              Unassigned Unassigned
              zstan Evgeny Stanilovsky
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: