mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.44k stars 291 forks source link

Unable to show table records for Athena driver when not select on 'default' schema #1120

Closed Hilllander closed 1 year ago

Hilllander commented 1 year ago

Describe the bug By using Athena driver, seems that the extension only fix for use 'default' schema to preview data. Anyway, when browse to another schema and try to "Show Table Records" it returns error since the 'default' schema name has been fixed to the extensions' generated query.

[1678932086202] ERROR (Error): Error: SYNTAX_ERROR: line 2:6: Table awsdatacatalog.default.my_table does not exist at AthenaDriver.rawQuery (c:\Users\User.vscode\extensions\brunoventura.sqltools-athena-driver-0.3.0\out\ls\driver.js:38:23) at async AthenaDriver.query (c:\Users\User.vscode\extensions\brunoventura.sqltools-athena-driver-0.3.0\out\ls\driver.js:58:29) at async Promise.all (index 0) [1678932086204] ERROR (ext): ERROR: Execute query error SYNTAX_ERROR: line 2:6: Table awsdatacatalog.default.my_table does does not exist, 'SYNTAX_ERROR: line 2:6: Table awsdatacatalog.default.my_table does does not exist' ns: "error-handler" [1678932086204] ERROR (ext): ERROR: Error while showing table records SYNTAX_ERROR: line 2:6: Table awsdatacatalog.default.my_table does does not exist, {"code":-1,"data":{"driver":"driver.athena","driverOptions":{}}} ns: "error-handler" [1678932087537] INFO (ext): EXECUTING COMMAND => sqltools.showOutputChannel

To Reproduce Steps to reproduce the behavior:

  1. Create a new Glue database on data catalog name 'my_db'
  2. Create a new table e.g. 'my_table' (by a crawler or Glue job)
  3. Configure the VSCode profile and SQLTools extension connection to this data source
  4. When connected successfully, browse to node -Catalogs -> choose 'AwsDataCatalog' -> Databases -> choose 'my_db'->Tables
  5. Right-click on 'my_table' and select 'Show Table Records'
  6. See the error above

Expected behavior The auto-generated query should be applied with a selected schema's (database) name instead of 'default'

Screenshots n/a

Desktop (please complete the following information):

Additional context

gjsjohnmurray commented 1 year ago

Please report this to the author of the Athena driver extension. VS Code"s Report Issue option from the Help menu can probably assist you to do this.