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 @@ -21,6 +21,7 @@

import com.google.cloud.bigquery.Field;
import com.google.cloud.bigquery.FieldList;
import com.google.cloud.bigquery.StandardSQLTypeName;
import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException;
import java.sql.Date;
import java.sql.SQLException;
Expand All @@ -42,7 +43,7 @@ abstract class BigQueryBaseStruct implements java.sql.Struct {

@Override
public final String getSQLTypeName() throws SQLException {
throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
return StandardSQLTypeName.STRUCT.name();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,27 +515,27 @@ public boolean supportsSchemasInPrivilegeDefinitions() {

@Override
public boolean supportsCatalogsInDataManipulation() {
return false;
return true;
}

@Override
public boolean supportsCatalogsInProcedureCalls() {
return false;
return true;
}

@Override
public boolean supportsCatalogsInTableDefinitions() {
return false;
return true;
}

@Override
public boolean supportsCatalogsInIndexDefinitions() {
return false;
return true;
}

@Override
public boolean supportsCatalogsInPrivilegeDefinitions() {
return false;
return true;
}

@Override
Expand Down Expand Up @@ -3305,7 +3305,7 @@ public boolean insertsAreDetected(int type) {

@Override
public boolean supportsBatchUpdates() {
return false;
return true;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,8 @@ public void structOfStructs() throws SQLException {
}

@Test
public void getSQLTypeNameIsNotSupported() {
Exception exception =
assertThrows(
SQLFeatureNotSupportedException.class, structWithPrimitiveValues::getSQLTypeName);
assertThat(exception.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
public void getSQLTypeNameReturnsStruct() throws SQLException {
assertThat(structWithPrimitiveValues.getSQLTypeName()).isEqualTo("STRUCT");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,8 @@ public void structWithNullValue() throws SQLException {
}

@Test
public void getSQLTypeNameIsNotSupported() {
Exception exception =
assertThrows(
SQLFeatureNotSupportedException.class, structWithPrimitiveValues::getSQLTypeName);
assertThat(exception.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
public void getSQLTypeName() throws SQLException {
assertThat(structWithPrimitiveValues.getSQLTypeName()).isEqualTo("STRUCT");
}

@Test
Expand Down
Loading