Skip to content

Commit

Permalink
Apply review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RustedBones committed Sep 24, 2024
1 parent d251f07 commit ae4d089
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.io.Serializable;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.extensions.avro.io.AvroSource;
import org.apache.beam.sdk.schemas.Schema;
import org.apache.beam.sdk.transforms.SerializableFunction;

/**
Expand Down Expand Up @@ -53,15 +52,4 @@ <T> BigQuerySourceBase<T> toSource(
* @throws BigQuerySchemaRetrievalException if schema retrieval fails
*/
TableSchema getTableSchema(BigQueryOptions bqOptions);

/**
* Extract the Beam {@link Schema} corresponding to this source.
*
* @param bqOptions BigQueryOptions
* @return Beam schema of the source
* @throws BigQuerySchemaRetrievalException if schema retrieval fails
*/
default Schema getBeamSchema(BigQueryOptions bqOptions) {
return BigQueryUtils.fromTableSchema(getTableSchema(bqOptions));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ private void doQuerySourceInitialSplit(
.setReadSession(
ReadSession.newBuilder()
.setTable(BigQueryHelpers.toTableResourceName(tempTableReference))
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build()))
.setReadOptions(ReadSession.TableReadOptions.newBuilder()))
.setMaxStreamCount(requestedStreamCount)
.build();

Expand Down Expand Up @@ -484,7 +484,7 @@ public void testQuerySourceInitialSplit_NoReferencedTables() throws Exception {
.setReadSession(
ReadSession.newBuilder()
.setTable(BigQueryHelpers.toTableResourceName(tempTableReference))
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build()))
.setReadOptions(ReadSession.TableReadOptions.newBuilder()))
.setMaxStreamCount(1024)
.build();

Expand Down Expand Up @@ -655,7 +655,7 @@ public void testQuerySourceInitialSplitWithBigQueryProject_EmptyResult() throws
ReadSession.newBuilder()
.setTable(BigQueryHelpers.toTableResourceName(tempTableReference))
.setDataFormat(DataFormat.AVRO)
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build()))
.setReadOptions(ReadSession.TableReadOptions.newBuilder()))
.setMaxStreamCount(10)
.build();

Expand Down Expand Up @@ -728,7 +728,7 @@ public void testQuerySourceInitialSplit_EmptyResult() throws Exception {
.setReadSession(
ReadSession.newBuilder()
.setTable(BigQueryHelpers.toTableResourceName(tempTableReference))
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build()))
.setReadOptions(ReadSession.TableReadOptions.newBuilder()))
.setMaxStreamCount(10)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ private void doTableSourceInitialSplitTest(long bundleSize, int streamCount) thr
.setReadSession(
ReadSession.newBuilder()
.setTable("projects/foo.com:project/datasets/dataset/tables/table")
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build()))
.setReadOptions(ReadSession.TableReadOptions.newBuilder()))
.setMaxStreamCount(streamCount)
.build();

Expand Down Expand Up @@ -553,7 +553,7 @@ public void testTableSourceInitialSplit_WithDefaultProject() throws Exception {
.setReadSession(
ReadSession.newBuilder()
.setTable("projects/project-id/datasets/dataset/tables/table")
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build()))
.setReadOptions(ReadSession.TableReadOptions.newBuilder()))
.setMaxStreamCount(1024)
.build();

Expand Down Expand Up @@ -602,7 +602,7 @@ public void testTableSourceInitialSplit_EmptyTable() throws Exception {
.setReadSession(
ReadSession.newBuilder()
.setTable("projects/foo.com:project/datasets/dataset/tables/table")
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build()))
.setReadOptions(ReadSession.TableReadOptions.newBuilder()))
.setMaxStreamCount(1024)
.build();

Expand Down Expand Up @@ -1486,7 +1486,7 @@ public void testReadFromBigQueryIO() throws Exception {
ReadSession.newBuilder()
.setTable("projects/foo.com:project/datasets/dataset/tables/table")
.setDataFormat(DataFormat.AVRO)
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build()))
.setReadOptions(ReadSession.TableReadOptions.newBuilder()))
.setMaxStreamCount(10)
.build();

Expand Down Expand Up @@ -1698,7 +1698,7 @@ public void testReadFromBigQueryIOArrow() throws Exception {
ReadSession.newBuilder()
.setTable("projects/foo.com:project/datasets/dataset/tables/table")
.setDataFormat(DataFormat.ARROW)
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build()))
.setReadOptions(ReadSession.TableReadOptions.newBuilder()))
.setMaxStreamCount(10)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public void testDirectRead() throws Exception {
ReadSession.newBuilder()
.setTable("projects/my-project/datasets/dataset/tables/table")
.setDataFormat(DataFormat.AVRO)
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build()))
.setReadOptions(ReadSession.TableReadOptions.newBuilder()))
.setMaxStreamCount(10)
.build();

Expand Down

0 comments on commit ae4d089

Please sign in to comment.