google/zetasql

ResolvedStatement - ResolvedTableScan not getting the full table name due to backtick placement

leoch20 opened this issue · 0 comments

Hello,

I implemented sub catalogs as recommended here #125 to analyze queries with different table names backtick placements.

While looking to extract the columns, along with their table, from a query the ResolvedNodes.Visitor() does not return the fully qualified table name:

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

.getFullName() returns table_name.

Is there a way to get the project and dataset?


Here is my visitor in scala

    statement.accept(new ResolvedNodes.Visitor() {
      override def visit(node: ResolvedNodes.ResolvedTableScan): Unit = {
        val table = node.getTable
        table.getColumnList.forEach(col => (table.getFullName, col.getName))
        super.visit(node)
      }
    })