yirutang commented on a change in pull request #15810:
URL: https://github.com/apache/beam/pull/15810#discussion_r741490133



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/testing/FakeDatasetService.java
##########
@@ -249,7 +254,21 @@ public void createTable(Table table) throws IOException {
             "Tried to get a dataset %s:%s, but no such table was set",
             tableReference.getProjectId(), tableReference.getDatasetId());
       }
-      dataset.computeIfAbsent(tableReference.getTableId(), k -> new 
TableContainer(table));
+      dataset.computeIfAbsent(
+          tableReference.getTableId(),
+          k -> {
+            TableContainer tableContainer = new TableContainer(table);
+            // Create the default stream.
+            String streamName =
+                String.format(
+                    "projects/%s/datasets/%s/tables/%s/streams/_default",
+                    tableReference.getProjectId(),
+                    tableReference.getDatasetId(),
+                    
BigQueryHelpers.stripPartitionDecorator(tableReference.getTableId()));
+            writeStreams.put(streamName, new Stream(tableContainer, 
Type.COMMITTED));

Review comment:
       I think client side can introduce a new type DEFAULT_STREAM instead of 
reusing COMMITTED or maybe COMMITED_AT_LEAST_ONCE or something to be clear.

##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/testing/FakeDatasetService.java
##########
@@ -412,9 +431,6 @@ public Table patchTableDescription(
   @Override
   public WriteStream createWriteStream(String tableUrn, Type type)
       throws IOException, InterruptedException {
-    if (type != Type.PENDING && type != Type.BUFFERED) {

Review comment:
       We could check for COMMIT_AT_LEAST_ONCE explicitly.




-- 
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