diff --git a/src/main/resources/com/google/cloud/spanner/jdbc/DatabaseMetaData_GetColumns.sql b/src/main/resources/com/google/cloud/spanner/jdbc/DatabaseMetaData_GetColumns.sql index e5226a83f..94d2a0e61 100644 --- a/src/main/resources/com/google/cloud/spanner/jdbc/DatabaseMetaData_GetColumns.sql +++ b/src/main/resources/com/google/cloud/spanner/jdbc/DatabaseMetaData_GetColumns.sql @@ -21,6 +21,7 @@ SELECT TABLE_CATALOG AS TABLE_CAT, TABLE_SCHEMA AS TABLE_SCHEM, TABLE_NAME, COLU WHEN SPANNER_TYPE LIKE 'BYTES%' THEN -2 WHEN SPANNER_TYPE = 'DATE' THEN 91 WHEN SPANNER_TYPE = 'FLOAT64' THEN 8 + WHEN SPANNER_TYPE = 'FLOAT32' THEN 7 WHEN SPANNER_TYPE = 'INT64' THEN -5 WHEN SPANNER_TYPE = 'NUMERIC' THEN 2 WHEN SPANNER_TYPE LIKE 'STRING%' THEN -9 @@ -34,6 +35,7 @@ SELECT TABLE_CATALOG AS TABLE_CAT, TABLE_SCHEMA AS TABLE_SCHEM, TABLE_NAME, COLU WHEN SPANNER_TYPE = 'INT64' OR SPANNER_TYPE = 'ARRAY' THEN 19 WHEN SPANNER_TYPE = 'NUMERIC' OR SPANNER_TYPE = 'ARRAY' THEN 15 WHEN SPANNER_TYPE = 'FLOAT64' OR SPANNER_TYPE = 'ARRAY' THEN 15 + WHEN SPANNER_TYPE = 'FLOAT32' OR SPANNER_TYPE = 'ARRAY' THEN 15 WHEN SPANNER_TYPE = 'BOOL' OR SPANNER_TYPE = 'ARRAY' THEN NULL WHEN SPANNER_TYPE = 'DATE' OR SPANNER_TYPE = 'ARRAY' THEN 10 WHEN SPANNER_TYPE = 'TIMESTAMP' OR SPANNER_TYPE = 'ARRAY' THEN 35 @@ -45,12 +47,14 @@ SELECT TABLE_CATALOG AS TABLE_CAT, TABLE_SCHEMA AS TABLE_SCHEM, TABLE_NAME, COLU 0 AS BUFFER_LENGTH, CASE WHEN SPANNER_TYPE LIKE '%FLOAT64%' THEN 16 + WHEN SPANNER_TYPE LIKE '%FLOAT32%' THEN 16 ELSE NULL END AS DECIMAL_DIGITS, CASE WHEN SPANNER_TYPE LIKE '%INT64%' THEN 10 WHEN SPANNER_TYPE LIKE '%NUMERIC%' THEN 10 WHEN SPANNER_TYPE LIKE '%FLOAT64%' THEN 2 + WHEN SPANNER_TYPE LIKE '%FLOAT32%' THEN 2 ELSE NULL END AS NUM_PREC_RADIX, CASE diff --git a/src/main/resources/com/google/cloud/spanner/jdbc/postgresql/DatabaseMetaData_GetColumns.sql b/src/main/resources/com/google/cloud/spanner/jdbc/postgresql/DatabaseMetaData_GetColumns.sql index 5b37e32ec..38c105108 100644 --- a/src/main/resources/com/google/cloud/spanner/jdbc/postgresql/DatabaseMetaData_GetColumns.sql +++ b/src/main/resources/com/google/cloud/spanner/jdbc/postgresql/DatabaseMetaData_GetColumns.sql @@ -21,6 +21,7 @@ SELECT TABLE_CATALOG AS "TABLE_CAT", TABLE_SCHEMA AS "TABLE_SCHEM", TABLE_NAME A WHEN DATA_TYPE LIKE 'bytea' THEN -2 WHEN DATA_TYPE = 'date' THEN 91 WHEN DATA_TYPE = 'double precision' THEN 8 + WHEN DATA_TYPE = 'real' THEN 7 WHEN DATA_TYPE = 'bigint' THEN -5 WHEN DATA_TYPE = 'numeric' THEN 2 WHEN DATA_TYPE LIKE 'character varying' THEN -9 @@ -34,6 +35,7 @@ SELECT TABLE_CATALOG AS "TABLE_CAT", TABLE_SCHEMA AS "TABLE_SCHEM", TABLE_NAME A WHEN DATA_TYPE LIKE 'bytea' THEN 10485760 WHEN DATA_TYPE = 'date' THEN 10 WHEN DATA_TYPE = 'double precision' THEN 15 + WHEN DATA_TYPE = 'real' THEN 15 WHEN DATA_TYPE = 'bigint' THEN 19 WHEN DATA_TYPE = 'numeric' THEN 15 WHEN DATA_TYPE LIKE 'character varying' THEN CHARACTER_MAXIMUM_LENGTH @@ -43,6 +45,7 @@ SELECT TABLE_CATALOG AS "TABLE_CAT", TABLE_SCHEMA AS "TABLE_SCHEM", TABLE_NAME A 0 AS "BUFFER_LENGTH", CASE WHEN DATA_TYPE LIKE 'double precision' THEN 16 + WHEN DATA_TYPE LIKE 'real' THEN 16 WHEN DATA_TYPE LIKE 'numeric' THEN 16383 ELSE NULL END AS "DECIMAL_DIGITS", @@ -50,6 +53,7 @@ SELECT TABLE_CATALOG AS "TABLE_CAT", TABLE_SCHEMA AS "TABLE_SCHEM", TABLE_NAME A WHEN DATA_TYPE LIKE 'bigint' THEN 10 WHEN DATA_TYPE LIKE 'numeric' THEN 10 WHEN DATA_TYPE LIKE 'double precision' THEN 2 + WHEN DATA_TYPE LIKE 'real' THEN 2 ELSE NULL END AS "NUM_PREC_RADIX", CASE diff --git a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcDatabaseMetaDataTest.java b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcDatabaseMetaDataTest.java index efc3934d3..94d9ad140 100644 --- a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcDatabaseMetaDataTest.java +++ b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcDatabaseMetaDataTest.java @@ -149,6 +149,7 @@ private Column( Arrays.asList( new Column("ColInt64", Types.BIGINT, "INT64", 19, null, 10, false, null), new Column("ColFloat64", Types.DOUBLE, "FLOAT64", 15, 16, 2, false, null), + new Column("ColFloat32", Types.REAL, "FLOAT32", 15, 16, 2, false, null), new Column("ColBool", Types.BOOLEAN, "BOOL", null, null, null, false, null), new Column("ColString", Types.NVARCHAR, "STRING(100)", 100, null, null, false, 100), new Column( @@ -162,6 +163,7 @@ private Column( new Column("ColJson", Types.NVARCHAR, "JSON", 2621440, null, null, false, 2621440), new Column("ColInt64Array", Types.ARRAY, "ARRAY", 19, null, 10, true, null), new Column("ColFloat64Array", Types.ARRAY, "ARRAY", 15, 16, 2, true, null), + new Column("ColFloat32Array", Types.ARRAY, "ARRAY", 15, 16, 2, true, null), new Column("ColBoolArray", Types.ARRAY, "ARRAY", null, null, null, true, null), new Column( "ColStringArray", Types.ARRAY, "ARRAY", 100, null, null, true, 100), diff --git a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPgDatabaseMetaDataTest.java b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPgDatabaseMetaDataTest.java index 033ff27e4..1984ccb51 100644 --- a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPgDatabaseMetaDataTest.java +++ b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPgDatabaseMetaDataTest.java @@ -148,6 +148,7 @@ private Column( Arrays.asList( new Column("colint64", Types.BIGINT, "bigint", 19, null, 10, false, null), new Column("colfloat64", Types.DOUBLE, "double precision", 15, 16, 2, false, null), + new Column("colfloat32", Types.REAL, "real", 15, 16, 2, false, null), new Column("colbool", Types.BOOLEAN, "boolean", null, null, null, false, null), new Column("colstring", Types.NVARCHAR, "character varying", 100, null, null, false, 100), new Column( diff --git a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPgNumericTest.java b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPgNumericTest.java index 35dd2dfda..a7c7a206d 100644 --- a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPgNumericTest.java +++ b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPgNumericTest.java @@ -226,9 +226,7 @@ public void testPreparedStatement() throws Exception { preparedStatement.setShort(3, (short) 1); preparedStatement.setInt(4, 1); preparedStatement.setLong(5, 1L); - // TODO: Change to setFloat(..) when float32 is supported. - // preparedStatement.setFloat(6, 1f); - preparedStatement.setDouble(6, 1d); + preparedStatement.setFloat(6, 1f); preparedStatement.setDouble(7, 1D); preparedStatement.setBigDecimal(8, new BigDecimal("1")); preparedStatement.setObject(9, (byte) 1); @@ -240,9 +238,7 @@ public void testPreparedStatement() throws Exception { preparedStatement.setObject(15, new BigDecimal("1")); preparedStatement.setObject(16, Value.pgNumeric("1")); - // TODO: Change to setFloat(..) when float32 is supported. - // preparedStatement.setFloat(17, Float.NaN); - preparedStatement.setDouble(17, Double.NaN); + preparedStatement.setFloat(17, Float.NaN); preparedStatement.setDouble(18, Double.NaN); preparedStatement.setObject(19, Value.pgNumeric("NaN")); diff --git a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPreparedStatementTest.java b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPreparedStatementTest.java index 2fb170a98..31a1a7f17 100644 --- a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPreparedStatementTest.java +++ b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPreparedStatementTest.java @@ -922,16 +922,17 @@ public void test08_InsertAllColumnTypes() throws SQLException { dialect.dialect == Dialect.POSTGRESQL); String sql = "INSERT INTO TableWithAllColumnTypes (" - + "ColInt64, ColFloat64, ColBool, ColString, ColStringMax, ColBytes, ColBytesMax, ColDate, ColTimestamp, ColCommitTS, ColNumeric, ColJson, " - + "ColInt64Array, ColFloat64Array, ColBoolArray, ColStringArray, ColStringMaxArray, ColBytesArray, ColBytesMaxArray, ColDateArray, ColTimestampArray, ColNumericArray, ColJsonArray" - + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, PENDING_COMMIT_TIMESTAMP(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + + "ColInt64, ColFloat64, ColFloat32, ColBool, ColString, ColStringMax, ColBytes, ColBytesMax, ColDate, ColTimestamp, ColCommitTS, ColNumeric, ColJson, " + + "ColInt64Array, ColFloat64Array, ColFloat32Array, ColBoolArray, ColStringArray, ColStringMaxArray, ColBytesArray, ColBytesMaxArray, ColDateArray, ColTimestampArray, ColNumericArray, ColJsonArray" + + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, PENDING_COMMIT_TIMESTAMP(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; try (Connection con = createConnection(env, database)) { try (PreparedStatement ps = con.prepareStatement(sql)) { ParameterMetaData metadata = ps.getParameterMetaData(); - assertEquals(22, metadata.getParameterCount()); + assertEquals(24, metadata.getParameterCount()); int index = 0; assertEquals(Types.BIGINT, metadata.getParameterType(++index)); assertEquals(Types.DOUBLE, metadata.getParameterType(++index)); + assertEquals(Types.REAL, metadata.getParameterType(++index)); assertEquals(Types.BOOLEAN, metadata.getParameterType(++index)); assertEquals(Types.NVARCHAR, metadata.getParameterType(++index)); assertEquals(Types.NVARCHAR, metadata.getParameterType(++index)); @@ -952,10 +953,12 @@ public void test08_InsertAllColumnTypes() throws SQLException { assertEquals(Types.ARRAY, metadata.getParameterType(++index)); assertEquals(Types.ARRAY, metadata.getParameterType(++index)); assertEquals(Types.ARRAY, metadata.getParameterType(++index)); + assertEquals(Types.ARRAY, metadata.getParameterType(++index)); index = 0; ps.setLong(++index, 1L); ps.setDouble(++index, 2D); + ps.setFloat(++index, 3.14f); ps.setBoolean(++index, true); ps.setString(++index, "test"); ps.setObject(++index, UUID.fromString("2d37f522-e0a5-4f22-8e09-4d77d299c967")); @@ -968,6 +971,7 @@ public void test08_InsertAllColumnTypes() throws SQLException { ps.setArray(++index, con.createArrayOf("INT64", new Long[] {1L, 2L, 3L})); ps.setArray(++index, con.createArrayOf("FLOAT64", new Double[] {1.1D, 2.2D, 3.3D})); + ps.setArray(++index, con.createArrayOf("FLOAT32", new Float[] {1.1f, 2.2f, 3.3f})); ps.setArray( ++index, con.createArrayOf("BOOL", new Boolean[] {Boolean.TRUE, null, Boolean.FALSE})); ps.setArray(++index, con.createArrayOf("STRING", new String[] {"1", "2", "3"})); @@ -1006,6 +1010,7 @@ public void test08_InsertAllColumnTypes() throws SQLException { assertTrue(rs.next()); assertEquals(1L, rs.getLong(++index)); assertEquals(2d, rs.getDouble(++index), 0.0d); + assertEquals(3.14f, rs.getFloat(++index), 0.0f); assertTrue(rs.getBoolean(++index)); assertEquals("test", rs.getString(++index)); assertEquals("2d37f522-e0a5-4f22-8e09-4d77d299c967", rs.getString(++index)); @@ -1020,6 +1025,8 @@ public void test08_InsertAllColumnTypes() throws SQLException { assertArrayEquals(new Long[] {1L, 2L, 3L}, (Long[]) rs.getArray(++index).getArray()); assertArrayEquals( new Double[] {1.1D, 2.2D, 3.3D}, (Double[]) rs.getArray(++index).getArray()); + assertArrayEquals( + new Float[] {1.1f, 2.2f, 3.3f}, (Float[]) rs.getArray(++index).getArray()); assertArrayEquals( new Boolean[] {true, null, false}, (Boolean[]) rs.getArray(++index).getArray()); assertArrayEquals(new String[] {"1", "2", "3"}, (String[]) rs.getArray(++index).getArray()); @@ -1049,13 +1056,14 @@ public void test08_PGInsertAllColumnTypes() throws SQLException { String sql = "INSERT INTO TableWithAllColumnTypes (" - + "ColInt64, ColFloat64, ColBool, ColString, ColStringMax, ColBytes, ColDate, ColTimestamp, ColNumeric, ColJson" - + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + + "ColInt64, ColFloat64, ColFloat32, ColBool, ColString, ColStringMax, ColBytes, ColDate, ColTimestamp, ColNumeric, ColJson" + + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; try (Connection con = createConnection(env, database)) { try (PreparedStatement ps = con.prepareStatement(sql)) { int index = 0; ps.setLong(++index, 1L); ps.setDouble(++index, 2D); + ps.setFloat(++index, 3.14f); ps.setBoolean(++index, true); ps.setString(++index, "test"); ps.setObject(++index, UUID.fromString("2d37f522-e0a5-4f22-8e09-4d77d299c967")); @@ -1074,6 +1082,7 @@ public void test08_PGInsertAllColumnTypes() throws SQLException { assertTrue(rs.next()); assertEquals(1L, rs.getLong(++index)); assertEquals(2d, rs.getDouble(++index), 0.0d); + assertEquals(3.14f, rs.getFloat(++index), 0.0f); assertTrue(rs.getBoolean(++index)); assertEquals("test", rs.getString(++index)); assertEquals("2d37f522-e0a5-4f22-8e09-4d77d299c967", rs.getString(++index)); @@ -1097,10 +1106,11 @@ public void test09_MetaData_FromQuery() throws SQLException { try (PreparedStatement ps = con.prepareStatement("SELECT * FROM TableWithAllColumnTypes WHERE ColInt64=?")) { ResultSetMetaData metadata = ps.getMetaData(); - assertEquals(24, metadata.getColumnCount()); + assertEquals(26, metadata.getColumnCount()); int index = 0; assertEquals("ColInt64", metadata.getColumnLabel(++index)); assertEquals("ColFloat64", metadata.getColumnLabel(++index)); + assertEquals("ColFloat32", metadata.getColumnLabel(++index)); assertEquals("ColBool", metadata.getColumnLabel(++index)); assertEquals("ColString", metadata.getColumnLabel(++index)); assertEquals("ColStringMax", metadata.getColumnLabel(++index)); @@ -1113,6 +1123,7 @@ public void test09_MetaData_FromQuery() throws SQLException { assertEquals("ColJson", metadata.getColumnLabel(++index)); assertEquals("ColInt64Array", metadata.getColumnLabel(++index)); assertEquals("ColFloat64Array", metadata.getColumnLabel(++index)); + assertEquals("ColFloat32Array", metadata.getColumnLabel(++index)); assertEquals("ColBoolArray", metadata.getColumnLabel(++index)); assertEquals("ColStringArray", metadata.getColumnLabel(++index)); assertEquals("ColStringMaxArray", metadata.getColumnLabel(++index)); @@ -1149,14 +1160,15 @@ public void test11_InsertDataUsingSpannerValue() throws SQLException { dialect.dialect == Dialect.POSTGRESQL); String sql = "INSERT INTO TableWithAllColumnTypes (" - + "ColInt64, ColFloat64, ColBool, ColString, ColStringMax, ColBytes, ColBytesMax, ColDate, ColTimestamp, ColCommitTS, ColNumeric, ColJson, " - + "ColInt64Array, ColFloat64Array, ColBoolArray, ColStringArray, ColStringMaxArray, ColBytesArray, ColBytesMaxArray, ColDateArray, ColTimestampArray, ColNumericArray, ColJsonArray" - + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, PENDING_COMMIT_TIMESTAMP(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + + "ColInt64, ColFloat64, ColFloat32, ColBool, ColString, ColStringMax, ColBytes, ColBytesMax, ColDate, ColTimestamp, ColCommitTS, ColNumeric, ColJson, " + + "ColInt64Array, ColFloat64Array, ColFloat32Array, ColBoolArray, ColStringArray, ColStringMaxArray, ColBytesArray, ColBytesMaxArray, ColDateArray, ColTimestampArray, ColNumericArray, ColJsonArray" + + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, PENDING_COMMIT_TIMESTAMP(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; try (Connection con = createConnection(env, database)) { try (PreparedStatement ps = con.prepareStatement(sql)) { int index = 1; ps.setObject(index++, Value.int64(2L)); ps.setObject(index++, Value.float64(2D)); + ps.setObject(index++, Value.float32(3.14f)); ps.setObject(index++, Value.bool(true)); ps.setObject(index++, Value.string("testvalues")); ps.setObject(index++, Value.string("2d37f522-e0a5-4f22-8e09-4d77d299c967")); @@ -1170,6 +1182,7 @@ public void test11_InsertDataUsingSpannerValue() throws SQLException { ps.setObject(index++, Value.int64Array(new long[] {1L, 2L, 3L})); ps.setObject(index++, Value.float64Array(new double[] {1.1D, 2.2D, 3.3D})); + ps.setObject(index++, Value.float32Array(new float[] {1.1f, 2.2f, 3.3f})); ps.setObject(index++, Value.boolArray(Arrays.asList(Boolean.TRUE, null, Boolean.FALSE))); ps.setObject(index++, Value.stringArray(Arrays.asList("1", "2", "3"))); ps.setObject(index++, Value.stringArray(Arrays.asList("3", "2", "1"))); @@ -1207,6 +1220,7 @@ public void test11_InsertDataUsingSpannerValue() throws SQLException { int index = 1; assertEquals(Value.int64(2L), rs.getObject(index++, Value.class)); assertEquals(Value.float64(2d), rs.getObject(index++, Value.class)); + assertEquals(Value.float32(3.14f), rs.getObject(index++, Value.class)); assertEquals(Value.bool(true), rs.getObject(index++, Value.class)); assertEquals(Value.string("testvalues"), rs.getObject(index++, Value.class)); assertEquals( @@ -1229,6 +1243,8 @@ public void test11_InsertDataUsingSpannerValue() throws SQLException { assertEquals( Value.float64Array(new double[] {1.1D, 2.2D, 3.3D}), rs.getObject(index++, Value.class)); + assertEquals( + Value.float32Array(new float[] {1.1f, 2.2f, 3.3f}), rs.getObject(index++, Value.class)); assertEquals( Value.boolArray(Arrays.asList(true, null, false)), rs.getObject(index++, Value.class)); assertEquals( @@ -1448,9 +1464,9 @@ public void test13_InsertUntypedNullValues() throws SQLException { try (PreparedStatement preparedStatement = connection.prepareStatement( "insert into all_nullable_types (" - + "ColInt64, ColFloat64, ColBool, ColString, ColBytes, ColDate, ColTimestamp, ColNumeric, ColJson, " + + "ColInt64, ColFloat64, ColFloat32, ColBool, ColString, ColBytes, ColDate, ColTimestamp, ColNumeric, ColJson, " + "ColInt64Array, ColFloat64Array, ColBoolArray, ColStringArray, ColBytesArray, ColDateArray, ColTimestampArray, ColNumericArray, ColJsonArray) " - + "values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) { + + "values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) { for (int param = 1; param <= preparedStatement.getParameterMetaData().getParameterCount(); param++) { diff --git a/src/test/resources/com/google/cloud/spanner/jdbc/it/CreateMusicTables.sql b/src/test/resources/com/google/cloud/spanner/jdbc/it/CreateMusicTables.sql index 153dd773d..51f7d1ea1 100644 --- a/src/test/resources/com/google/cloud/spanner/jdbc/it/CreateMusicTables.sql +++ b/src/test/resources/com/google/cloud/spanner/jdbc/it/CreateMusicTables.sql @@ -70,6 +70,7 @@ CREATE TABLE Concerts ( CREATE TABLE TableWithAllColumnTypes ( ColInt64 INT64 NOT NULL, ColFloat64 FLOAT64 NOT NULL, + ColFloat32 FLOAT32 NOT NULL, ColBool BOOL NOT NULL, ColString STRING(100) NOT NULL, ColStringMax STRING(MAX) NOT NULL, @@ -83,6 +84,7 @@ CREATE TABLE TableWithAllColumnTypes ( ColInt64Array ARRAY, ColFloat64Array ARRAY, + ColFloat32Array ARRAY, ColBoolArray ARRAY, ColStringArray ARRAY, ColStringMaxArray ARRAY, @@ -100,6 +102,7 @@ CREATE TABLE TableWithAllColumnTypes ( CREATE TABLE all_nullable_types ( ColInt64 INT64, ColFloat64 FLOAT64, + ColFloat32 FLOAT32, ColBool BOOL, ColString STRING(100), ColBytes BYTES(100), @@ -110,6 +113,7 @@ CREATE TABLE all_nullable_types ( ColInt64Array ARRAY, ColFloat64Array ARRAY, + ColFloat32Array ARRAY, ColBoolArray ARRAY, ColStringArray ARRAY, ColBytesArray ARRAY, diff --git a/src/test/resources/com/google/cloud/spanner/jdbc/it/CreateMusicTables_PG.sql b/src/test/resources/com/google/cloud/spanner/jdbc/it/CreateMusicTables_PG.sql index 3aafc5722..43b16bb50 100644 --- a/src/test/resources/com/google/cloud/spanner/jdbc/it/CreateMusicTables_PG.sql +++ b/src/test/resources/com/google/cloud/spanner/jdbc/it/CreateMusicTables_PG.sql @@ -71,6 +71,7 @@ CREATE TABLE Concerts ( CREATE TABLE TableWithAllColumnTypes ( ColInt64 BIGINT PRIMARY KEY, ColFloat64 FLOAT8 NOT NULL, + ColFloat32 FLOAT4 NOT NULL, ColBool BOOL NOT NULL, ColString VARCHAR(100) NOT NULL, ColStringMax TEXT, @@ -83,6 +84,7 @@ CREATE TABLE TableWithAllColumnTypes ( CREATE TABLE all_nullable_types ( ColInt64 bigint primary key, ColFloat64 float8, + ColFloat32 float4, ColBool boolean, ColString varchar(100), ColBytes bytea, @@ -93,6 +95,7 @@ CREATE TABLE all_nullable_types ( ColInt64Array bigint[], ColFloat64Array float8[], + ColFloat32Array float4[], ColBoolArray boolean[], ColStringArray varchar(100)[], ColBytesArray bytea[],