GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(bqjdbc): update metadata values for GEOGRAPHY/JSON/INTERVAL types… · GaoleMeng/google-cloud-java@d08691a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • java-bigquery/google-cloud-bigquery-jdbc/src
    • main/java/com/google/cloud/bigquery/jdbc
      • BigQueryDatabaseMetaData.java
    • test/java/com/google/cloud/bigquery/jdbc
      • BigQueryDatabaseMetaDataTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4855,9 +4855,11 @@ private ColumnTypeInfo getColumnTypeInfoForSqlType(StandardSQLTypeName bqType) {
48554855
case TIME:
48564856
return new ColumnTypeInfo(Types.TIME, "TIME", 15, null, null);
48574857
case GEOGRAPHY:
4858+
return new ColumnTypeInfo(Types.OTHER, "GEOGRAPHY", null, null, null);
48584859
case JSON:
4860+
return new ColumnTypeInfo(Types.OTHER, "JSON", null, null, null);
48594861
case INTERVAL:
4860-
return new ColumnTypeInfo(Types.VARCHAR, "VARCHAR", null, null, null);
4862+
return new ColumnTypeInfo(Types.OTHER, "INTERVAL", null, null, null);
48614863
case BYTES:
48624864
return new ColumnTypeInfo(Types.VARBINARY, "VARBINARY", null, null, null);
48634865
case STRUCT:
Collapse file

‎java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java‎

Copy file name to clipboardExpand all lines: java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java
+24-3Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,16 +342,37 @@ public void testMapBigQueryTypeToJdbc_ScalarTypes() {
342342
assertEquals(Integer.valueOf(38), infoBigNumeric.decimalDigits);
343343
assertEquals(Integer.valueOf(10), infoBigNumeric.numPrecRadix);
344344

345-
// GEOGRAPHY -> VARCHAR
345+
// GEOGRAPHY -> OTHER
346346
Field fieldGeo =
347347
Field.newBuilder("test_geo", StandardSQLTypeName.GEOGRAPHY)
348348
.setMode(Field.Mode.NULLABLE)
349349
.build();
350350
BigQueryDatabaseMetaData.ColumnTypeInfo infoGeo = dbMetadata.mapBigQueryTypeToJdbc(fieldGeo);
351-
assertEquals(Types.VARCHAR, infoGeo.jdbcType);
352-
assertEquals("VARCHAR", infoGeo.typeName);
351+
assertEquals(Types.OTHER, infoGeo.jdbcType);
352+
assertEquals("GEOGRAPHY", infoGeo.typeName);
353353
assertNull(infoGeo.columnSize);
354354

355+
// JSON -> OTHER
356+
Field fieldJson =
357+
Field.newBuilder("test_json", StandardSQLTypeName.JSON)
358+
.setMode(Field.Mode.NULLABLE)
359+
.build();
360+
BigQueryDatabaseMetaData.ColumnTypeInfo infoJson = dbMetadata.mapBigQueryTypeToJdbc(fieldJson);
361+
assertEquals(Types.OTHER, infoJson.jdbcType);
362+
assertEquals("JSON", infoJson.typeName);
363+
assertNull(infoJson.columnSize);
364+
365+
// INTERVAL -> OTHER
366+
Field fieldInterval =
367+
Field.newBuilder("test_interval", StandardSQLTypeName.INTERVAL)
368+
.setMode(Field.Mode.NULLABLE)
369+
.build();
370+
BigQueryDatabaseMetaData.ColumnTypeInfo infoInterval =
371+
dbMetadata.mapBigQueryTypeToJdbc(fieldInterval);
372+
assertEquals(Types.OTHER, infoInterval.jdbcType);
373+
assertEquals("INTERVAL", infoInterval.typeName);
374+
assertNull(infoInterval.columnSize);
375+
355376
// DATE
356377
Field fieldDate =
357378
Field.newBuilder("test_date", StandardSQLTypeName.DATE)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.