Abacn commented on code in PR #38064:
URL: https://github.com/apache/beam/pull/38064#discussion_r3066988690


##########
sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeIO.java:
##########
@@ -424,31 +433,26 @@ public Read<T> withQuotationMark(ValueProvider<String> 
quotationMark) {
     public PCollection<T> expand(PBegin input) {
       checkArguments();
 
-      PCollection<Void> emptyCollection = input.apply(Create.of((Void) null));
       String tmpDirName = makeTmpDirName();
-      PCollection<T> output =
-          emptyCollection
-              .apply(
-                  ParDo.of(
-                      new CopyIntoStageFn(
-                          getDataSourceProviderFn(),
-                          getQuery(),
-                          getTable(),
-                          getStorageIntegrationName(),
-                          getStagingBucketName(),
-                          tmpDirName,
-                          getSnowflakeServices(),
-                          getQuotationMark())))
-              .apply(Reshuffle.viaRandomKey())
-              .apply(FileIO.matchAll())

Review Comment:
   Dataflow can do it because `FileIO.matchAll()` has a ReShuffle present by 
default: 
   
   
https://github.com/apache/beam/blob/6dd599cf3f6b40efd44fa8c084c82ca40353a051/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileIO.java#L734-L735
   
   It sounds a Flink runner bug if this does not work on Flink runner. Have you 
tried to not set useDataStreamForBatch (only availlable for Flink 1.x)?
   
   This PR essentially rewrites SnowflakeIO bounded read and would need a 
closer eye (I could help for generic Java but less experience on Snowflake 
connecor)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to