You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ch...@apache.org on 2020/05/28 16:46:31 UTC

[beam] branch master updated: Reject fractional values outside of (0.0, 1.0)

This is an automated email from the ASF dual-hosted git repository.

chamikara pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 04c2a2d  Reject fractional values outside of (0.0, 1.0)
     new e42d217  Merge pull request #11580 from kmjung/bigquery_split
04c2a2d is described below

commit 04c2a2d06a450cb08e63bce890c99d347d0b9b4c
Author: Kenneth Jung <km...@gmail.com>
AuthorDate: Thu Apr 30 11:05:08 2020 -0700

    Reject fractional values outside of (0.0, 1.0)
---
 .../apache/beam/sdk/io/gcp/bigquery/BigQueryStorageStreamSource.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryStorageStreamSource.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryStorageStreamSource.java
index f76a432..d460c5d 100644
--- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryStorageStreamSource.java
+++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryStorageStreamSource.java
@@ -288,6 +288,11 @@ public class BigQueryStorageStreamSource<T> extends BoundedSource<T> {
           source.stream.getName(),
           fraction);
 
+      if (fraction <= 0.0 || fraction >= 1.0) {
+        LOG.info("BigQuery Storage API does not support splitting at fraction {}", fraction);
+        return null;
+      }
+
       SplitReadStreamRequest splitRequest =
           SplitReadStreamRequest.newBuilder()
               .setOriginalStream(source.stream)