Skip to content

Commit 3297e4d

Browse files
committed
Added Attribute to for ArrowSchema
1 parent c1743c9 commit 3297e4d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultSetImpl.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.cloud.bigquery;
1818

19+
import com.google.cloud.bigquery.storage.v1.ArrowSchema;
1920
import java.math.BigDecimal;
2021
import java.sql.Date;
2122
import java.sql.ResultSet;
@@ -28,19 +29,25 @@
2829
// TODO: This implementation deals with the JSON response. We can have respective implementations
2930
public class BigQueryResultSetImpl<T> implements BigQueryResultSet<T> {
3031

31-
private final Schema schema;
32+
private Schema schema;
33+
private ArrowSchema arrowSchema;
3234
private final long totalRows;
3335
private final BlockingQueue<T> buffer;
3436
private T cursor;
3537
private final ResultSetWrapper underlyingResultSet;
3638
private final BigQueryResultSetStats bigQueryResultSetStats;
3739

3840
public BigQueryResultSetImpl(
39-
Schema schema,
41+
Object schema,
4042
long totalRows,
4143
BlockingQueue<T> buffer,
4244
BigQueryResultSetStats bigQueryResultSetStats) {
43-
this.schema = schema;
45+
if (schema instanceof Schema) {
46+
this.schema = (Schema) schema;
47+
} else if (schema instanceof ArrowSchema) {
48+
this.arrowSchema = (ArrowSchema) schema;
49+
}
50+
4451
this.totalRows = totalRows;
4552
this.buffer = buffer;
4653
this.underlyingResultSet = new ResultSetWrapper();
@@ -52,6 +59,8 @@ public Schema getSchema() {
5259
return schema;
5360
}
5461

62+
// TODO(prasmish): Implement a method to return ArrowSchema
63+
5564
@Override
5665
public long getTotalRows() {
5766
return totalRows;

0 commit comments

Comments
 (0)