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

Rui Wang edited comment on BEAM-7758 at 7/20/19 9:22 PM:
---------------------------------------------------------

Yes. I think your code shows expected workflow with a modification:


{code:java}
Pipeline pipeline = Pipeline.create(options);

SqlTransform query =
        SqlTransform.query("join_query")
            .withDefaultTableProvider("your_table_provider_name", create your 
table_provider);

PCollection<Row> queryResult = pipeline.apply("Run SQL Query", query);
{code}



You don't need to apply sql query to unbounded PCollection. Your unbounded 
Pcollection are created within SqlTransform from a Table which is gotten from 
table provider.

All existing table provider can be used in this programmatic way. SqlTransform 
is not limited to "SELECT * FROM PCOLLECTION" but can do "SELECT * FROM 
TABLE_A", if you have a TABLE_A in table provider.


was (Author: amaliujia):
Yes. I think your code shows expected workflow with some a modification:


{code:java}
Pipeline pipeline = Pipeline.create(options);

SqlTransform query =
        SqlTransform.query("join_query")
            .withDefaultTableProvider("your_table_provider_name", create your 
table_provider);

PCollection<Row> queryResult = pipeline.apply("Run SQL Query", query);
{code}



You don't need to apply sql query to unbounded PCollection. Your unbounded 
Pcollection are created within SqlTransform from a Table which is gotten from 
table provider.

All existing table provider can be used in this programmatic way. SqlTransform 
is not limited to "SELECT * FROM PCOLLECTION" but can do "SELECT * FROM 
TABLE_A", if you have a TABLE_A in table provider.

> Table returns PCollectionView in BeamSQL
> ----------------------------------------
>
>                 Key: BEAM-7758
>                 URL: https://issues.apache.org/jira/browse/BEAM-7758
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Rahul Patwari
>            Priority: Major
>
> We might be able to define a table with properties that says this table 
> return a PCollectionView. By doing so we will have a trigger based 
> PCollectionView available in SQL rel nodes. 
> Relevant thread: 
> https://lists.apache.org/thread.html/602121ee49886590ce4975f66aa0d270b4a5d64575337fca8bef1232@%3Cdev.beam.apache.org%3E



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to