google / google/googlesql

Extract column names and functions from statement

Open
#77 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.6k
Forks
260
PR merge metrics
No merged PRs in 30d

Description

Hi everyone,

I am currently using ZetaSQL, and I didn't find my answers in the Java unit tests.

I am using ZetaSQL in order to extract column names and function from SQL statement.

Exemple:
`SELECT col_1 as my_alias, SUM(col_2) FROM a_schema.a_table GROUP BY my_alias`
Output:
`col1_, SUM(col_2) `

But I am absolutely lost.
I know how works **Catalog** and Analyzer of statatement, and it's works good.
But after when I want to extract columns from my **ResolvedStatement**... I am lost.
I tried a Visitor, but when I get ResolvedColumn I can't make the difference between column names and alias on column.

Can you help me, and show me a good way to use ZetaSQL correctly ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.