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

UPDATE doesn't work

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.17.0
    • Fix Version/s: None
    • Component/s: core, jdbc-adapter
    • Labels:
      None
    • Flags:
      Important

      Description

      I tried to use UPDATE DML statements, but got exception:

      java.lang.AssertionError: UPDATE
      
      at org.apache.calcite.adapter.enumerable.EnumerableTableModify.implement(EnumerableTableModify.java:137)
      at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:100)
      at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:92)
      at org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1238)
      at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:332)
      at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:231)
      at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:772)
      at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:636)
      at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:606)
      at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:229)
      at org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement_(CalciteConnectionImpl.java:211)
      at org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement(CalciteConnectionImpl.java:200)
      at org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement(CalciteConnectionImpl.java:91)
      at org.apache.calcite.avatica.AvaticaConnection.prepareStatement(AvaticaConnection.java:175)
      ...

      The reason is that EnumerableTableModify.implement doesn't support UPDATE.

      I've tried to implement it, but it's difficult with Collection API. There is no method in Collection, that can handle it, and if you use remove/add methods to simulate update, then updated rows count will be equals to zero.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ashlanderr Alexander Shilov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: