diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryWriteManualClientTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryWriteManualClientTest.java index 8823a7a422..4f05c50480 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryWriteManualClientTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/ITBigQueryWriteManualClientTest.java @@ -569,63 +569,4 @@ public void testStreamReconnect() throws IOException, InterruptedException, Exec // assertEquals(1L, response.get().getOffset()); } } - - @Test - public void testFlushRows() throws IOException, InterruptedException, ExecutionException { - String tableName = "BufferTable"; - TableInfo tableInfo = - TableInfo.newBuilder( - TableId.of(DATASET, tableName), - StandardTableDefinition.of( - Schema.of( - com.google.cloud.bigquery.Field.newBuilder("foo", LegacySQLTypeName.STRING) - .build()))) - .build(); - bigquery.create(tableInfo); - TableName parent = TableName.of(ServiceOptions.getDefaultProjectId(), DATASET, tableName); - WriteStream writeStream = - client.createWriteStream( - CreateWriteStreamRequest.newBuilder() - .setParent(parent.toString()) - .setWriteStream(WriteStream.newBuilder().setType(WriteStream.Type.BUFFERED).build()) - .build()); - try (StreamWriter streamWriter = StreamWriter.newBuilder(writeStream.getName()).build()) { - ApiFuture response = - streamWriter.append( - createAppendRequest(writeStream.getName(), new String[] {"aaa"}) - .setOffset(Int64Value.of(0L)) - .build()); - response.get(); - // Waiting for API breaking change to be generated in new client. - // assertEquals(0L, response.get().getOffset()); - FlushRowsRequest flushRequest = - FlushRowsRequest.newBuilder() - .setWriteStream(writeStream.getName()) - .setOffset(Int64Value.of(0)) - .build(); - client.flushRows(flushRequest); - try { - flushRequest = flushRequest.toBuilder().setOffset(Int64Value.of(1)).build(); - client.flushRows(flushRequest); - fail("Expected Out Of Range exception"); - } catch (com.google.api.gax.rpc.OutOfRangeException ex) { - assertThat(ex.getMessage()) - .contains("OUT_OF_RANGE: Offset 1 is beyond the end of the stream"); - } - } - String query = "SELECT * from " + DATASET + "." + tableName; - LOG.info("Querying: " + query); - TableResult queryResult = bigquery.query(QueryJobConfiguration.newBuilder(query).build()); - Iterator iter = queryResult.getValues().iterator(); - - // We cannot read from tabledata.list yet. - // TableResult result = - // bigquery.listTableData(tableInfo.getTableId(), - // BigQuery.TableDataListOption.startIndex(0L)); - // Iterator iter = result.getValues().iterator(); - // Why I cannot get result? - assertFalse(iter.hasNext()); - // assertEquals("aaa", iter.next().get(0).getStringValue()); - // assertEquals(false, iter.hasNext()); - } }