[jira] [Commented] (BEAM-9953) Beam ZetaSQL supports multiple statements in a query

2020-07-10 Thread Kyle Weaver (Jira)


[ 
https://issues.apache.org/jira/browse/BEAM-9953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17155718#comment-17155718
 ] 

Kyle Weaver commented on BEAM-9953:
---

This was resolved by [https://github.com/apache/beam/pull/12153].

> Beam ZetaSQL supports multiple statements in a query
> 
>
> Key: BEAM-9953
> URL: https://issues.apache.org/jira/browse/BEAM-9953
> Project: Beam
>  Issue Type: Task
>  Components: dsl-sql-zetasql
>Reporter: Rui Wang
>Assignee: Kyle Weaver
>Priority: P2
>  Time Spent: 5h 50m
>  Remaining Estimate: 0h
>
> One example of multiple  statements query:
> {code:java}
> CREATE FUNCTION fun_a (param_1 INT64); SELECT fun_a(10);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (BEAM-9953) Beam ZetaSQL supports multiple statements in a query

2020-06-04 Thread Rui Wang (Jira)


[ 
https://issues.apache.org/jira/browse/BEAM-9953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17126232#comment-17126232
 ] 

Rui Wang commented on BEAM-9953:


Better to check the open sourced Java Analyzer: 
https://github.com/google/zetasql/blob/master/java/com/google/zetasql/Analyzer.java


I am not seeing a API that returns a ResolvedStatment but that is not really 
analyzing. 

Also Kyle added an API discussed above (which we need) at: 
https://github.com/google/zetasql/blob/master/java/com/google/zetasql/Analyzer.java#L214.
 So it's no longer a problem

> Beam ZetaSQL supports multiple statements in a query
> 
>
> Key: BEAM-9953
> URL: https://issues.apache.org/jira/browse/BEAM-9953
> Project: Beam
>  Issue Type: Task
>  Components: dsl-sql-zetasql
>Reporter: Rui Wang
>Assignee: Kyle Weaver
>Priority: P2
>
> One example of multiple  statements query:
> {code:java}
> CREATE FUNCTION fun_a (param_1 INT64); SELECT fun_a(10);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (BEAM-9953) Beam ZetaSQL supports multiple statements in a query

2020-06-04 Thread Kenneth Knowles (Jira)


[ 
https://issues.apache.org/jira/browse/BEAM-9953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17126229#comment-17126229
 ] 

Kenneth Knowles commented on BEAM-9953:
---

Is there a parse-by-don't-analyze that makes it easy to identify the statement 
type? (obviously internal to the library, there is)

> Beam ZetaSQL supports multiple statements in a query
> 
>
> Key: BEAM-9953
> URL: https://issues.apache.org/jira/browse/BEAM-9953
> Project: Beam
>  Issue Type: Task
>  Components: dsl-sql-zetasql
>Reporter: Rui Wang
>Assignee: Kyle Weaver
>Priority: P2
>
> One example of multiple  statements query:
> {code:java}
> CREATE FUNCTION fun_a (param_1 INT64); SELECT fun_a(10);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (BEAM-9953) Beam ZetaSQL supports multiple statements in a query

2020-06-01 Thread Rui Wang (Jira)


[ 
https://issues.apache.org/jira/browse/BEAM-9953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17121347#comment-17121347
 ] 

Rui Wang commented on BEAM-9953:


Agreed. Though hacker way can help us develop faster for SQL UDF, having 
"extractTableNamesFromNextStatement" will make this feature production-ready. 

> Beam ZetaSQL supports multiple statements in a query
> 
>
> Key: BEAM-9953
> URL: https://issues.apache.org/jira/browse/BEAM-9953
> Project: Beam
>  Issue Type: Task
>  Components: dsl-sql-zetasql
>Reporter: Rui Wang
>Assignee: Kyle Weaver
>Priority: P2
>
> One example of multiple  statements query:
> {code:java}
> CREATE FUNCTION fun_a (param_1 INT64); SELECT fun_a(10);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (BEAM-9953) Beam ZetaSQL supports multiple statements in a query

2020-06-01 Thread Kyle Weaver (Jira)


[ 
https://issues.apache.org/jira/browse/BEAM-9953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17121333#comment-17121333
 ] 

Kyle Weaver commented on BEAM-9953:
---

While it's true we only need to get table names from the last SELECT statement, 
parsing out the last SELECT statement is non-trivial. analyzeNextStatement 
depends on the extracted tables. We might be able to do this:
 # analyze next statement
 # if analyze succeeded, continue.
 # if analyze failed due to "table not found," extract tables and re-analyze 
with the extracted tables.

But that seems hacky.

> Beam ZetaSQL supports multiple statements in a query
> 
>
> Key: BEAM-9953
> URL: https://issues.apache.org/jira/browse/BEAM-9953
> Project: Beam
>  Issue Type: Task
>  Components: dsl-sql-zetasql
>Reporter: Rui Wang
>Assignee: Kyle Weaver
>Priority: P2
>
> One example of multiple  statements query:
> {code:java}
> CREATE FUNCTION fun_a (param_1 INT64); SELECT fun_a(10);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (BEAM-9953) Beam ZetaSQL supports multiple statements in a query

2020-06-01 Thread Rui Wang (Jira)


[ 
https://issues.apache.org/jira/browse/BEAM-9953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17121237#comment-17121237
 ] 

Rui Wang commented on BEAM-9953:


Hello. I am wondering why you need `extractTableNamesFromNextStatement` API for 
this Jira?

Seems to me that only the last SELECT has table names to parse?

> Beam ZetaSQL supports multiple statements in a query
> 
>
> Key: BEAM-9953
> URL: https://issues.apache.org/jira/browse/BEAM-9953
> Project: Beam
>  Issue Type: Task
>  Components: dsl-sql-zetasql
>Reporter: Rui Wang
>Assignee: Kyle Weaver
>Priority: P2
>
> One example of multiple  statements query:
> {code:java}
> CREATE FUNCTION fun_a (param_1 INT64); SELECT fun_a(10);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)