Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1854,42 +1854,6 @@ void testSimpleReadWithOtelTracing() throws IOException {
}
}

void testUniverseDomain() throws IOException {
// This test is not yet part presubmit integration test as it requires the apis-tpclp.goog
// universe domain credentials.
// Test a valid domain using the default credentials and Google default universe domain.
BigQueryReadSettings bigQueryReadSettings =
BigQueryReadSettings.newBuilder().setUniverseDomain("apis-tpclp.goog").build();
BigQueryReadClient localClient = BigQueryReadClient.create(bigQueryReadSettings);

String table =
BigQueryResource.formatTableResource(
/* projectId= */ "google-tpc-testing-environment:cloudsdk-test-project",
/* datasetId= */ "tpc_demo_dataset",
/* tableId= */ "new_table");

ReadSession session =
localClient.createReadSession(
/* parent= */ parentProjectId,
/* readSession= */ ReadSession.newBuilder()
.setTable(table)
.setDataFormat(DataFormat.AVRO)
.build(),
/* maxStreamCount= */ 1);

ReadRowsRequest readRowsRequest =
ReadRowsRequest.newBuilder().setReadStream(session.getStreams(0).getName()).build();

long rowCount = 0;
ServerStream<ReadRowsResponse> stream = localClient.readRowsCallable().call(readRowsRequest);
for (ReadRowsResponse response : stream) {
rowCount += response.getRowCount();
}

assertEquals(1, rowCount);
localClient.close();
}

/**
* Reads to the specified row offset within the stream. If the stream does not have the desired
* rows to read, it will read all of them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1137,43 +1137,6 @@ void testUniverseDomainWithMatchingDomain() throws IOException {
localClient.close();
}

void testUniverseDomain() throws IOException {
// This test is not yet part presubmit integration test as it requires the apis-tpclp.goog
// universe domain credentials.
// Test a valid domain using the default credentials and Google default universe domain.
BigQueryStorageSettings bigQueryStorageSettings =
BigQueryStorageSettings.newBuilder().setUniverseDomain("apis-tpclp.goog").build();
BigQueryStorageClient localClient = BigQueryStorageClient.create(bigQueryStorageSettings);

TableReference tableReference =
TableReference.newBuilder()
.setProjectId("google-tpc-testing-environment:cloudsdk-test-project")
.setDatasetId("tpc_demo_dataset")
.setTableId("new_table")
.build();

ReadSession session =
localClient.createReadSession(
/* tableReference= */ tableReference,
/* parent= */ parentProjectId,
/* requestedStreams= */ 1);

StreamPosition readPosition =
StreamPosition.newBuilder().setStream(session.getStreams(0)).build();

ReadRowsRequest readRowsRequest =
ReadRowsRequest.newBuilder().setReadPosition(readPosition).build();

long rowCount = 0;
ServerStream<ReadRowsResponse> stream = localClient.readRowsCallable().call(readRowsRequest);
for (ReadRowsResponse response : stream) {
rowCount += response.getRowCount();
}

assertEquals(1, rowCount);
localClient.close();
}

/**
* Reads to the specified row offset within the stream. If the stream does not have the desired
* rows to read, it will read all of them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1117,42 +1117,6 @@ void testUniverseDomainWithMatchingDomain() throws IOException {
localClient.close();
}

void testUniverseDomain() throws IOException {
// This test is not yet part presubmit integration test as it requires the apis-tpclp.goog
// universe domain credentials.
// Test a valid domain using the default credentials and Google default universe domain.
BigQueryReadSettings bigQueryReadSettings =
BigQueryReadSettings.newBuilder().setUniverseDomain("apis-tpclp.goog").build();
BigQueryReadClient localClient = BigQueryReadClient.create(bigQueryReadSettings);

String table =
BigQueryResource.FormatTableResource(
/* projectId= */ "google-tpc-testing-environment:cloudsdk-test-project",
/* datasetId= */ "tpc_demo_dataset",
/* tableId= */ "new_table");

ReadSession session =
localClient.createReadSession(
/* parent= */ parentProjectId,
/* readSession= */ ReadSession.newBuilder()
.setTable(table)
.setDataFormat(DataFormat.AVRO)
.build(),
/* maxStreamCount= */ 1);

ReadRowsRequest readRowsRequest =
ReadRowsRequest.newBuilder().setReadStream(session.getStreams(0).getName()).build();

long rowCount = 0;
ServerStream<ReadRowsResponse> stream = localClient.readRowsCallable().call(readRowsRequest);
for (ReadRowsResponse response : stream) {
rowCount += response.getRowCount();
}

assertEquals(1, rowCount);
localClient.close();
}

/**
* Reads to the specified row offset within the stream. If the stream does not have the desired
* rows to read, it will read all of them.
Expand Down
Loading