Skip to content

Commit 2638cd4

Browse files
committed
unittest & feedback
1 parent a0fdf6c commit 2638cd4

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import com.google.cloud.bigquery.Field;
2323
import com.google.cloud.bigquery.FieldList;
24+
import com.google.cloud.bigquery.StandardSQLTypeName;
2425
import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException;
2526
import java.sql.Date;
2627
import java.sql.SQLException;
@@ -42,7 +43,7 @@ abstract class BigQueryBaseStruct implements java.sql.Struct {
4243

4344
@Override
4445
public final String getSQLTypeName() throws SQLException {
45-
return "STRUCT";
46+
return StandardSQLTypeName.STRUCT.name();
4647
}
4748

4849
@Override

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,8 @@ public void structWithNullValue() throws SQLException {
246246
}
247247

248248
@Test
249-
public void getSQLTypeNameIsNotSupported() {
250-
Exception exception =
251-
assertThrows(
252-
SQLFeatureNotSupportedException.class, structWithPrimitiveValues::getSQLTypeName);
253-
assertThat(exception.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
249+
public void getSQLTypeName() throws SQLException{
250+
assertThat(structWithPrimitiveValues.getSQLTypeName()).isEqualTo("STRUCT");
254251
}
255252

256253
@Test

0 commit comments

Comments
 (0)