google / zetasql

ZetaSQL - Analyzer Framework for SQL
Apache License 2.0
2.28k stars 214 forks source link

analyzeStatement cant recognize the table due to backtick placement #125

Closed leoch20 closed 1 year ago

leoch20 commented 1 year ago

Hello,

I created a simpleCatalog and added simpleTables with names like some-project.ds.table_name. If I use the analyzeStatement with a query with backtick only around the project or project and dataset I get a Table not found error.

select * from `some-project`.ds.table_name 
-- or
select * from `some-project.ds`.table_name 

Any tips?

pgrivachev commented 1 year ago

As I understand, for the case

select * from `some-project`.ds.table_name

the following structure should work: rootCatalog (simpleCatalog) <-- some-project (simpleCatalog) <-- ds (simpleCatalog) <-- table_name (simpleTable) and for

select * from `some-project.ds`.table_name

try to use: rootCatalog (simpleCatalog) <-- some-project.ds (simpleCatalog) <-- table_name (simpleTable)

leoch20 commented 1 year ago

Thanks! That got it going