You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Raphael Sanamyan <ra...@akvelon.com> on 2021/06/15 20:59:35 UTC

Re: [EXTERNAL] Re: [EXTERNAL]

Hello,

Is it somehow related to this work [1]?

No, this work adds the ability to return values from a sql insert query. There are no improvements to work with row and schema in it.

Not sure that I got it. Could you elaborate a bit on this?

When we using "Write" with table and without statement, "Write.expand" is called, which automatically generates statement and provides input to "WriteVoid.expand", but when we using "Write.withResults", only "WriteVoid.expand" is called, which can't automatically generate statement. If we add conditions there similar to those in "Write.Expand" and move the statement generation in "WriteVoid.expand", we'll fix this case

I analyzed the Write class again and it seems to be the only case where there is no full support for automatic work with "row". I think it makes sense to delete todo<https://github.com/apache/beam/blob/master/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcSchemaIOProvider.java#L142> and close the the task<https://issues.apache.org/jira/browse/BEAM-10396>, to not confuse people. And create a task, to solve this case. What do you think about that?


Thanks,
Raphael.

Re: [EXTERNAL] [EXTERNAL]

Posted by Raphael Sanamyan <ra...@akvelon.com>.
Hello!

I've made a PR[1] and created a task[2] in Jira. Could someone please review the PR?

Thanks,
Raphael

[1] https://github.com/akvelon/beam/pull/17<https://github.com/akvelon/beam/pull/17>
[2] https://issues.apache.org/jira/browse/BEAM-12511<https://issues.apache.org/jira/browse/BEAM-12511>


Re: [EXTERNAL] [EXTERNAL]

Posted by Alexey Romanenko <ar...@gmail.com>.

> On 15 Jun 2021, at 22:59, Raphael Sanamyan <ra...@akvelon.com> wrote:
> 
> Hello,
> 
>> Is it somehow related to this work [1]? 
> 
> 
> No, this work adds the ability to return values from a sql insert query. There are no improvements to work with row and schema in it.
> 
>> Not sure that I got it. Could you elaborate a bit on this? 
> 
> 
> When we using "Write" with table and without statement, "Write.expand" is called, which automatically generates statement and provides input to "WriteVoid.expand", but when we using "Write.withResults", only "WriteVoid.expand" is called, which can't automatically generate statement. If we add conditions there similar to those in "Write.Expand" and move the statement generation in "WriteVoid.expand", we'll fix this case

Yes, I think we can do it there in the same way as we do for "Write.expand()". 

> I analyzed the Write class again and it seems to be the only case where there is no full support for automatic work with "row". I think it makes sense to delete todo <https://github.com/apache/beam/blob/master/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcSchemaIOProvider.java#L142> and close the the task <https://issues.apache.org/jira/browse/BEAM-10396>, to not confuse people. And create a task, to solve this case. What do you think about that?

I agree on this. 

Back to https://github.com/apache/beam/pull/14856/
It should kind of replace WriteVoid since it does the same job but also returns the results of write and I suggested to deprecate WriteVoid. So, we will need to add automatic statement generating there too.

—
Alexey