> On 15 Jun 2021, at 22:59, Raphael Sanamyan <raphael.sanam...@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

Reply via email to