Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-4666

Google translator throws SpreadsheetOperationException for query DELETE FROM table

      Query "DELETE FROM smalla" where smalla is table throws exception:

      07:06:52,219 ERROR [org.teiid.CONNECTOR] (Worker1_QueryProcessorQueue20) Connector worker process failed for atomic-request=IlMZP21M8Gwr.8.0.2: org.teiid.resource.adapter.google.common.SpreadsheetOperationException: Error getting spreadsheet feed. Possibly bad authentication or connection problems. com.google.gdata.util.InvalidEntryException: Bad Request
      Invalid query parameter value for sq.

      Please see server.log, standalone.xml and vdb for other information.

        1. googlespreadsheetcrud-vdb.xml
          5 kB
        2. server.log
          219 kB
        3. standalone.xml
          35 kB
        4. teiid-4666.png
          teiid-4666.png
          42 kB

            [TEIID-4666] Google translator throws SpreadsheetOperationException for query DELETE FROM table

            Updated the logic to recognize a null predicate for update/delete.

            Steven Hawkins added a comment - Updated the logic to recognize a null predicate for update/delete.

            Based upon the comments below, this can be reopened to cover the case when delete/update has no predicate. Another issue will be captured to handle the scenario when all non-header rows are deleted.

            Steven Hawkins added a comment - Based upon the comments below, this can be reopened to cover the case when delete/update has no predicate. Another issue will be captured to handle the scenario when all non-header rows are deleted.

            Deleting all rows is possible, but highlights a new issue. Once the non-header rows are gone, google will automatically interpret the header row as a data row instead. This causes issues with subsequent select/update/delete operations or with a re-import of the metadata.

            Steven Hawkins added a comment - Deleting all rows is possible, but highlights a new issue. Once the non-header rows are gone, google will automatically interpret the header row as a data row instead. This causes issues with subsequent select/update/delete operations or with a re-import of the metadata.

            To clarify Q1 was causing a NPE on our side with the initial fix for TEIID-4468. It does appear that google expects a predicate for the delete and thus an exception on their side. We'll have to see if there is a workaround for this, such as a dummy predicate. If not, then that will simply be an unsupported operation.

            Steven Hawkins added a comment - To clarify Q1 was causing a NPE on our side with the initial fix for TEIID-4468 . It does appear that google expects a predicate for the delete and thus an exception on their side. We'll have to see if there is a workaround for this, such as a dummy predicate. If not, then that will simply be an unsupported operation.

            Lucie Krejcirova added a comment - - edited

            I tested queries Q1: "delete from smalla", Q2: "SELECT intnum FROM SmallA where smalla.intnum <> 0" on WildFly 10.0.0 + teiid 9.1.1:

            • Q1 failed with same exception as in attachment (it differs in line number: at org.teiid.resource.adapter.google.SpreadsheetConnectionImpl.deleteRows(SpreadsheetConnectionImpl.java:137))
            • Q2 passed (returned only not-null values)

            Lucie Krejcirova added a comment - - edited I tested queries Q1: "delete from smalla", Q2: "SELECT intnum FROM SmallA where smalla.intnum <> 0" on WildFly 10.0.0 + teiid 9.1.1: Q1 failed with same exception as in attachment (it differs in line number: at org.teiid.resource.adapter.google.SpreadsheetConnectionImpl.deleteRows(SpreadsheetConnectionImpl.java:137)) Q2 passed (returned only not-null values)

            TEIID-4468 addressed this as it needed to handle null predicates on delete for the not equals handling. The whole fix should be considered for inclusion in earlier branches.

            Steven Hawkins added a comment - TEIID-4468 addressed this as it needed to handle null predicates on delete for the not equals handling. The whole fix should be considered for inclusion in earlier branches.

            I think this is not the case - see the attached screenshot of the table (teiid-4666.png)

            And I can run successfully queries like "delete from smalla where intkey=0", "insert into smalla(intkey) values(556)".

            Lucie Krejcirova added a comment - I think this is not the case - see the attached screenshot of the table (teiid-4666.png) And I can run successfully queries like "delete from smalla where intkey=0", "insert into smalla(intkey) values(556)".

            Look at TEIID-3216 and it mentions:

            headers - update, delete and and insert statements will be supported only for the spreadsheets that have a header for each column (headers are in the first row of a spreadsheet)

            Is this the case with this issue that your spreadsheet doesn't have column headers?

            Van Halbert (Inactive) added a comment - Look at TEIID-3216 and it mentions: headers - update, delete and and insert statements will be supported only for the spreadsheets that have a header for each column (headers are in the first row of a spreadsheet) Is this the case with this issue that your spreadsheet doesn't have column headers?

              rhn-engineering-shawkins Steven Hawkins
              lfabriko@redhat.com Lucie Krejcirova
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: