File tree 2 files changed +15
-0
lines changed
google-cloud-bigquerystorage/src
main/java/com/google/cloud/bigquery/storage/v1
test/java/com/google/cloud/bigquery/storage/v1 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -561,6 +561,11 @@ public static void setMaxRequestCallbackWaitTime(Duration waitTime) {
561
561
ConnectionWorker .MAXIMUM_REQUEST_CALLBACK_WAIT_TIME = waitTime ;
562
562
}
563
563
564
+ /** @return the default stream name associated with tableName */
565
+ public static String getDefaultStreamName (TableName tableName ) {
566
+ return tableName + defaultStreamMatching ;
567
+ }
568
+
564
569
long getCreationTimestamp () {
565
570
return creationTimestamp ;
566
571
}
Original file line number Diff line number Diff line change @@ -2224,4 +2224,14 @@ public void testExclusiveAppendSuccessAndNonRetryableError() throws Exception {
2224
2224
Status .Code .INVALID_ARGUMENT ,
2225
2225
((StatusRuntimeException ) ex .getCause ()).getStatus ().getCode ());
2226
2226
}
2227
+
2228
+ @ Test
2229
+ public void testGetDefaultStreamName () {
2230
+ TableName tableName = TableName .of ("projectId" , "datasetId" , "tableId" );
2231
+
2232
+ String actualDefaultName = StreamWriter .getDefaultStreamName (tableName );
2233
+
2234
+ assertEquals (
2235
+ "projects/projectId/datasets/datasetId/tables/tableId/_default" , actualDefaultName );
2236
+ }
2227
2237
}
You can’t perform that action at this time.
0 commit comments