Skip to content

Commit a0fdf6c

Browse files
committed
fix(bqjdbc): metadata methods & getSqlTypeName for struct
1 parent 85f51b2 commit a0fdf6c

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseStruct.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ abstract class BigQueryBaseStruct implements java.sql.Struct {
4242

4343
@Override
4444
public final String getSQLTypeName() throws SQLException {
45-
throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
45+
return "STRUCT";
4646
}
4747

4848
@Override

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,27 +515,27 @@ public boolean supportsSchemasInPrivilegeDefinitions() {
515515

516516
@Override
517517
public boolean supportsCatalogsInDataManipulation() {
518-
return false;
518+
return true;
519519
}
520520

521521
@Override
522522
public boolean supportsCatalogsInProcedureCalls() {
523-
return false;
523+
return true;
524524
}
525525

526526
@Override
527527
public boolean supportsCatalogsInTableDefinitions() {
528-
return false;
528+
return true;
529529
}
530530

531531
@Override
532532
public boolean supportsCatalogsInIndexDefinitions() {
533-
return false;
533+
return true;
534534
}
535535

536536
@Override
537537
public boolean supportsCatalogsInPrivilegeDefinitions() {
538-
return false;
538+
return true;
539539
}
540540

541541
@Override
@@ -3305,7 +3305,7 @@ public boolean insertsAreDetected(int type) {
33053305

33063306
@Override
33073307
public boolean supportsBatchUpdates() {
3308-
return false;
3308+
return true;
33093309
}
33103310

33113311
@Override

java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowStructTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,8 @@ public void structOfStructs() throws SQLException {
227227
}
228228

229229
@Test
230-
public void getSQLTypeNameIsNotSupported() {
231-
Exception exception =
232-
assertThrows(
233-
SQLFeatureNotSupportedException.class, structWithPrimitiveValues::getSQLTypeName);
234-
assertThat(exception.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
230+
public void getSQLTypeNameReturnsStruct() throws SQLException {
231+
assertThat(structWithPrimitiveValues.getSQLTypeName()).isEqualTo("STRUCT");
235232
}
236233

237234
@Test

0 commit comments

Comments
 (0)