Skip to content

Commit 84da9f1

Browse files
authored
test: enable integration tests for float32 (#1792)
* test: enable integration tests for float32 * fix: add missing test column definitions * fix: the type name returned by Spanner is 'real' * test: also enable float32 null test
1 parent 748e417 commit 84da9f1

File tree

8 files changed

+48
-18
lines changed

8 files changed

+48
-18
lines changed

src/main/resources/com/google/cloud/spanner/jdbc/DatabaseMetaData_GetColumns.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SELECT TABLE_CATALOG AS TABLE_CAT, TABLE_SCHEMA AS TABLE_SCHEM, TABLE_NAME, COLU
2121
WHEN SPANNER_TYPE LIKE 'BYTES%' THEN -2
2222
WHEN SPANNER_TYPE = 'DATE' THEN 91
2323
WHEN SPANNER_TYPE = 'FLOAT64' THEN 8
24+
WHEN SPANNER_TYPE = 'FLOAT32' THEN 7
2425
WHEN SPANNER_TYPE = 'INT64' THEN -5
2526
WHEN SPANNER_TYPE = 'NUMERIC' THEN 2
2627
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
3435
WHEN SPANNER_TYPE = 'INT64' OR SPANNER_TYPE = 'ARRAY<INT64>' THEN 19
3536
WHEN SPANNER_TYPE = 'NUMERIC' OR SPANNER_TYPE = 'ARRAY<NUMERIC>' THEN 15
3637
WHEN SPANNER_TYPE = 'FLOAT64' OR SPANNER_TYPE = 'ARRAY<FLOAT64>' THEN 15
38+
WHEN SPANNER_TYPE = 'FLOAT32' OR SPANNER_TYPE = 'ARRAY<FLOAT32>' THEN 15
3739
WHEN SPANNER_TYPE = 'BOOL' OR SPANNER_TYPE = 'ARRAY<BOOL>' THEN NULL
3840
WHEN SPANNER_TYPE = 'DATE' OR SPANNER_TYPE = 'ARRAY<DATE>' THEN 10
3941
WHEN SPANNER_TYPE = 'TIMESTAMP' OR SPANNER_TYPE = 'ARRAY<TIMESTAMP>' THEN 35
@@ -45,12 +47,14 @@ SELECT TABLE_CATALOG AS TABLE_CAT, TABLE_SCHEMA AS TABLE_SCHEM, TABLE_NAME, COLU
4547
0 AS BUFFER_LENGTH,
4648
CASE
4749
WHEN SPANNER_TYPE LIKE '%FLOAT64%' THEN 16
50+
WHEN SPANNER_TYPE LIKE '%FLOAT32%' THEN 16
4851
ELSE NULL
4952
END AS DECIMAL_DIGITS,
5053
CASE
5154
WHEN SPANNER_TYPE LIKE '%INT64%' THEN 10
5255
WHEN SPANNER_TYPE LIKE '%NUMERIC%' THEN 10
5356
WHEN SPANNER_TYPE LIKE '%FLOAT64%' THEN 2
57+
WHEN SPANNER_TYPE LIKE '%FLOAT32%' THEN 2
5458
ELSE NULL
5559
END AS NUM_PREC_RADIX,
5660
CASE

src/main/resources/com/google/cloud/spanner/jdbc/postgresql/DatabaseMetaData_GetColumns.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SELECT TABLE_CATALOG AS "TABLE_CAT", TABLE_SCHEMA AS "TABLE_SCHEM", TABLE_NAME A
2121
WHEN DATA_TYPE LIKE 'bytea' THEN -2
2222
WHEN DATA_TYPE = 'date' THEN 91
2323
WHEN DATA_TYPE = 'double precision' THEN 8
24+
WHEN DATA_TYPE = 'real' THEN 7
2425
WHEN DATA_TYPE = 'bigint' THEN -5
2526
WHEN DATA_TYPE = 'numeric' THEN 2
2627
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
3435
WHEN DATA_TYPE LIKE 'bytea' THEN 10485760
3536
WHEN DATA_TYPE = 'date' THEN 10
3637
WHEN DATA_TYPE = 'double precision' THEN 15
38+
WHEN DATA_TYPE = 'real' THEN 15
3739
WHEN DATA_TYPE = 'bigint' THEN 19
3840
WHEN DATA_TYPE = 'numeric' THEN 15
3941
WHEN DATA_TYPE LIKE 'character varying' THEN CHARACTER_MAXIMUM_LENGTH
@@ -43,13 +45,15 @@ SELECT TABLE_CATALOG AS "TABLE_CAT", TABLE_SCHEMA AS "TABLE_SCHEM", TABLE_NAME A
4345
0 AS "BUFFER_LENGTH",
4446
CASE
4547
WHEN DATA_TYPE LIKE 'double precision' THEN 16
48+
WHEN DATA_TYPE LIKE 'real' THEN 16
4649
WHEN DATA_TYPE LIKE 'numeric' THEN 16383
4750
ELSE NULL
4851
END AS "DECIMAL_DIGITS",
4952
CASE
5053
WHEN DATA_TYPE LIKE 'bigint' THEN 10
5154
WHEN DATA_TYPE LIKE 'numeric' THEN 10
5255
WHEN DATA_TYPE LIKE 'double precision' THEN 2
56+
WHEN DATA_TYPE LIKE 'real' THEN 2
5357
ELSE NULL
5458
END AS "NUM_PREC_RADIX",
5559
CASE

src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcDatabaseMetaDataTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ private Column(
149149
Arrays.asList(
150150
new Column("ColInt64", Types.BIGINT, "INT64", 19, null, 10, false, null),
151151
new Column("ColFloat64", Types.DOUBLE, "FLOAT64", 15, 16, 2, false, null),
152+
new Column("ColFloat32", Types.REAL, "FLOAT32", 15, 16, 2, false, null),
152153
new Column("ColBool", Types.BOOLEAN, "BOOL", null, null, null, false, null),
153154
new Column("ColString", Types.NVARCHAR, "STRING(100)", 100, null, null, false, 100),
154155
new Column(
@@ -162,6 +163,7 @@ private Column(
162163
new Column("ColJson", Types.NVARCHAR, "JSON", 2621440, null, null, false, 2621440),
163164
new Column("ColInt64Array", Types.ARRAY, "ARRAY<INT64>", 19, null, 10, true, null),
164165
new Column("ColFloat64Array", Types.ARRAY, "ARRAY<FLOAT64>", 15, 16, 2, true, null),
166+
new Column("ColFloat32Array", Types.ARRAY, "ARRAY<FLOAT32>", 15, 16, 2, true, null),
165167
new Column("ColBoolArray", Types.ARRAY, "ARRAY<BOOL>", null, null, null, true, null),
166168
new Column(
167169
"ColStringArray", Types.ARRAY, "ARRAY<STRING(100)>", 100, null, null, true, 100),

src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPgDatabaseMetaDataTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ private Column(
148148
Arrays.asList(
149149
new Column("colint64", Types.BIGINT, "bigint", 19, null, 10, false, null),
150150
new Column("colfloat64", Types.DOUBLE, "double precision", 15, 16, 2, false, null),
151+
new Column("colfloat32", Types.REAL, "real", 15, 16, 2, false, null),
151152
new Column("colbool", Types.BOOLEAN, "boolean", null, null, null, false, null),
152153
new Column("colstring", Types.NVARCHAR, "character varying", 100, null, null, false, 100),
153154
new Column(

src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPgNumericTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,7 @@ public void testPreparedStatement() throws Exception {
226226
preparedStatement.setShort(3, (short) 1);
227227
preparedStatement.setInt(4, 1);
228228
preparedStatement.setLong(5, 1L);
229-
// TODO: Change to setFloat(..) when float32 is supported.
230-
// preparedStatement.setFloat(6, 1f);
231-
preparedStatement.setDouble(6, 1d);
229+
preparedStatement.setFloat(6, 1f);
232230
preparedStatement.setDouble(7, 1D);
233231
preparedStatement.setBigDecimal(8, new BigDecimal("1"));
234232
preparedStatement.setObject(9, (byte) 1);
@@ -240,9 +238,7 @@ public void testPreparedStatement() throws Exception {
240238
preparedStatement.setObject(15, new BigDecimal("1"));
241239
preparedStatement.setObject(16, Value.pgNumeric("1"));
242240

243-
// TODO: Change to setFloat(..) when float32 is supported.
244-
// preparedStatement.setFloat(17, Float.NaN);
245-
preparedStatement.setDouble(17, Double.NaN);
241+
preparedStatement.setFloat(17, Float.NaN);
246242
preparedStatement.setDouble(18, Double.NaN);
247243
preparedStatement.setObject(19, Value.pgNumeric("NaN"));
248244

src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcPreparedStatementTest.java

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -922,16 +922,17 @@ public void test08_InsertAllColumnTypes() throws SQLException {
922922
dialect.dialect == Dialect.POSTGRESQL);
923923
String sql =
924924
"INSERT INTO TableWithAllColumnTypes ("
925-
+ "ColInt64, ColFloat64, ColBool, ColString, ColStringMax, ColBytes, ColBytesMax, ColDate, ColTimestamp, ColCommitTS, ColNumeric, ColJson, "
926-
+ "ColInt64Array, ColFloat64Array, ColBoolArray, ColStringArray, ColStringMaxArray, ColBytesArray, ColBytesMaxArray, ColDateArray, ColTimestampArray, ColNumericArray, ColJsonArray"
927-
+ ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, PENDING_COMMIT_TIMESTAMP(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
925+
+ "ColInt64, ColFloat64, ColFloat32, ColBool, ColString, ColStringMax, ColBytes, ColBytesMax, ColDate, ColTimestamp, ColCommitTS, ColNumeric, ColJson, "
926+
+ "ColInt64Array, ColFloat64Array, ColFloat32Array, ColBoolArray, ColStringArray, ColStringMaxArray, ColBytesArray, ColBytesMaxArray, ColDateArray, ColTimestampArray, ColNumericArray, ColJsonArray"
927+
+ ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, PENDING_COMMIT_TIMESTAMP(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
928928
try (Connection con = createConnection(env, database)) {
929929
try (PreparedStatement ps = con.prepareStatement(sql)) {
930930
ParameterMetaData metadata = ps.getParameterMetaData();
931-
assertEquals(22, metadata.getParameterCount());
931+
assertEquals(24, metadata.getParameterCount());
932932
int index = 0;
933933
assertEquals(Types.BIGINT, metadata.getParameterType(++index));
934934
assertEquals(Types.DOUBLE, metadata.getParameterType(++index));
935+
assertEquals(Types.REAL, metadata.getParameterType(++index));
935936
assertEquals(Types.BOOLEAN, metadata.getParameterType(++index));
936937
assertEquals(Types.NVARCHAR, metadata.getParameterType(++index));
937938
assertEquals(Types.NVARCHAR, metadata.getParameterType(++index));
@@ -952,10 +953,12 @@ public void test08_InsertAllColumnTypes() throws SQLException {
952953
assertEquals(Types.ARRAY, metadata.getParameterType(++index));
953954
assertEquals(Types.ARRAY, metadata.getParameterType(++index));
954955
assertEquals(Types.ARRAY, metadata.getParameterType(++index));
956+
assertEquals(Types.ARRAY, metadata.getParameterType(++index));
955957

956958
index = 0;
957959
ps.setLong(++index, 1L);
958960
ps.setDouble(++index, 2D);
961+
ps.setFloat(++index, 3.14f);
959962
ps.setBoolean(++index, true);
960963
ps.setString(++index, "test");
961964
ps.setObject(++index, UUID.fromString("2d37f522-e0a5-4f22-8e09-4d77d299c967"));
@@ -968,6 +971,7 @@ public void test08_InsertAllColumnTypes() throws SQLException {
968971

969972
ps.setArray(++index, con.createArrayOf("INT64", new Long[] {1L, 2L, 3L}));
970973
ps.setArray(++index, con.createArrayOf("FLOAT64", new Double[] {1.1D, 2.2D, 3.3D}));
974+
ps.setArray(++index, con.createArrayOf("FLOAT32", new Float[] {1.1f, 2.2f, 3.3f}));
971975
ps.setArray(
972976
++index, con.createArrayOf("BOOL", new Boolean[] {Boolean.TRUE, null, Boolean.FALSE}));
973977
ps.setArray(++index, con.createArrayOf("STRING", new String[] {"1", "2", "3"}));
@@ -1006,6 +1010,7 @@ public void test08_InsertAllColumnTypes() throws SQLException {
10061010
assertTrue(rs.next());
10071011
assertEquals(1L, rs.getLong(++index));
10081012
assertEquals(2d, rs.getDouble(++index), 0.0d);
1013+
assertEquals(3.14f, rs.getFloat(++index), 0.0f);
10091014
assertTrue(rs.getBoolean(++index));
10101015
assertEquals("test", rs.getString(++index));
10111016
assertEquals("2d37f522-e0a5-4f22-8e09-4d77d299c967", rs.getString(++index));
@@ -1020,6 +1025,8 @@ public void test08_InsertAllColumnTypes() throws SQLException {
10201025
assertArrayEquals(new Long[] {1L, 2L, 3L}, (Long[]) rs.getArray(++index).getArray());
10211026
assertArrayEquals(
10221027
new Double[] {1.1D, 2.2D, 3.3D}, (Double[]) rs.getArray(++index).getArray());
1028+
assertArrayEquals(
1029+
new Float[] {1.1f, 2.2f, 3.3f}, (Float[]) rs.getArray(++index).getArray());
10231030
assertArrayEquals(
10241031
new Boolean[] {true, null, false}, (Boolean[]) rs.getArray(++index).getArray());
10251032
assertArrayEquals(new String[] {"1", "2", "3"}, (String[]) rs.getArray(++index).getArray());
@@ -1049,13 +1056,14 @@ public void test08_PGInsertAllColumnTypes() throws SQLException {
10491056

10501057
String sql =
10511058
"INSERT INTO TableWithAllColumnTypes ("
1052-
+ "ColInt64, ColFloat64, ColBool, ColString, ColStringMax, ColBytes, ColDate, ColTimestamp, ColNumeric, ColJson"
1053-
+ ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
1059+
+ "ColInt64, ColFloat64, ColFloat32, ColBool, ColString, ColStringMax, ColBytes, ColDate, ColTimestamp, ColNumeric, ColJson"
1060+
+ ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
10541061
try (Connection con = createConnection(env, database)) {
10551062
try (PreparedStatement ps = con.prepareStatement(sql)) {
10561063
int index = 0;
10571064
ps.setLong(++index, 1L);
10581065
ps.setDouble(++index, 2D);
1066+
ps.setFloat(++index, 3.14f);
10591067
ps.setBoolean(++index, true);
10601068
ps.setString(++index, "test");
10611069
ps.setObject(++index, UUID.fromString("2d37f522-e0a5-4f22-8e09-4d77d299c967"));
@@ -1074,6 +1082,7 @@ public void test08_PGInsertAllColumnTypes() throws SQLException {
10741082
assertTrue(rs.next());
10751083
assertEquals(1L, rs.getLong(++index));
10761084
assertEquals(2d, rs.getDouble(++index), 0.0d);
1085+
assertEquals(3.14f, rs.getFloat(++index), 0.0f);
10771086
assertTrue(rs.getBoolean(++index));
10781087
assertEquals("test", rs.getString(++index));
10791088
assertEquals("2d37f522-e0a5-4f22-8e09-4d77d299c967", rs.getString(++index));
@@ -1097,10 +1106,11 @@ public void test09_MetaData_FromQuery() throws SQLException {
10971106
try (PreparedStatement ps =
10981107
con.prepareStatement("SELECT * FROM TableWithAllColumnTypes WHERE ColInt64=?")) {
10991108
ResultSetMetaData metadata = ps.getMetaData();
1100-
assertEquals(24, metadata.getColumnCount());
1109+
assertEquals(26, metadata.getColumnCount());
11011110
int index = 0;
11021111
assertEquals("ColInt64", metadata.getColumnLabel(++index));
11031112
assertEquals("ColFloat64", metadata.getColumnLabel(++index));
1113+
assertEquals("ColFloat32", metadata.getColumnLabel(++index));
11041114
assertEquals("ColBool", metadata.getColumnLabel(++index));
11051115
assertEquals("ColString", metadata.getColumnLabel(++index));
11061116
assertEquals("ColStringMax", metadata.getColumnLabel(++index));
@@ -1113,6 +1123,7 @@ public void test09_MetaData_FromQuery() throws SQLException {
11131123
assertEquals("ColJson", metadata.getColumnLabel(++index));
11141124
assertEquals("ColInt64Array", metadata.getColumnLabel(++index));
11151125
assertEquals("ColFloat64Array", metadata.getColumnLabel(++index));
1126+
assertEquals("ColFloat32Array", metadata.getColumnLabel(++index));
11161127
assertEquals("ColBoolArray", metadata.getColumnLabel(++index));
11171128
assertEquals("ColStringArray", metadata.getColumnLabel(++index));
11181129
assertEquals("ColStringMaxArray", metadata.getColumnLabel(++index));
@@ -1149,14 +1160,15 @@ public void test11_InsertDataUsingSpannerValue() throws SQLException {
11491160
dialect.dialect == Dialect.POSTGRESQL);
11501161
String sql =
11511162
"INSERT INTO TableWithAllColumnTypes ("
1152-
+ "ColInt64, ColFloat64, ColBool, ColString, ColStringMax, ColBytes, ColBytesMax, ColDate, ColTimestamp, ColCommitTS, ColNumeric, ColJson, "
1153-
+ "ColInt64Array, ColFloat64Array, ColBoolArray, ColStringArray, ColStringMaxArray, ColBytesArray, ColBytesMaxArray, ColDateArray, ColTimestampArray, ColNumericArray, ColJsonArray"
1154-
+ ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, PENDING_COMMIT_TIMESTAMP(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
1163+
+ "ColInt64, ColFloat64, ColFloat32, ColBool, ColString, ColStringMax, ColBytes, ColBytesMax, ColDate, ColTimestamp, ColCommitTS, ColNumeric, ColJson, "
1164+
+ "ColInt64Array, ColFloat64Array, ColFloat32Array, ColBoolArray, ColStringArray, ColStringMaxArray, ColBytesArray, ColBytesMaxArray, ColDateArray, ColTimestampArray, ColNumericArray, ColJsonArray"
1165+
+ ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, PENDING_COMMIT_TIMESTAMP(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
11551166
try (Connection con = createConnection(env, database)) {
11561167
try (PreparedStatement ps = con.prepareStatement(sql)) {
11571168
int index = 1;
11581169
ps.setObject(index++, Value.int64(2L));
11591170
ps.setObject(index++, Value.float64(2D));
1171+
ps.setObject(index++, Value.float32(3.14f));
11601172
ps.setObject(index++, Value.bool(true));
11611173
ps.setObject(index++, Value.string("testvalues"));
11621174
ps.setObject(index++, Value.string("2d37f522-e0a5-4f22-8e09-4d77d299c967"));
@@ -1170,6 +1182,7 @@ public void test11_InsertDataUsingSpannerValue() throws SQLException {
11701182

11711183
ps.setObject(index++, Value.int64Array(new long[] {1L, 2L, 3L}));
11721184
ps.setObject(index++, Value.float64Array(new double[] {1.1D, 2.2D, 3.3D}));
1185+
ps.setObject(index++, Value.float32Array(new float[] {1.1f, 2.2f, 3.3f}));
11731186
ps.setObject(index++, Value.boolArray(Arrays.asList(Boolean.TRUE, null, Boolean.FALSE)));
11741187
ps.setObject(index++, Value.stringArray(Arrays.asList("1", "2", "3")));
11751188
ps.setObject(index++, Value.stringArray(Arrays.asList("3", "2", "1")));
@@ -1207,6 +1220,7 @@ public void test11_InsertDataUsingSpannerValue() throws SQLException {
12071220
int index = 1;
12081221
assertEquals(Value.int64(2L), rs.getObject(index++, Value.class));
12091222
assertEquals(Value.float64(2d), rs.getObject(index++, Value.class));
1223+
assertEquals(Value.float32(3.14f), rs.getObject(index++, Value.class));
12101224
assertEquals(Value.bool(true), rs.getObject(index++, Value.class));
12111225
assertEquals(Value.string("testvalues"), rs.getObject(index++, Value.class));
12121226
assertEquals(
@@ -1229,6 +1243,8 @@ public void test11_InsertDataUsingSpannerValue() throws SQLException {
12291243
assertEquals(
12301244
Value.float64Array(new double[] {1.1D, 2.2D, 3.3D}),
12311245
rs.getObject(index++, Value.class));
1246+
assertEquals(
1247+
Value.float32Array(new float[] {1.1f, 2.2f, 3.3f}), rs.getObject(index++, Value.class));
12321248
assertEquals(
12331249
Value.boolArray(Arrays.asList(true, null, false)), rs.getObject(index++, Value.class));
12341250
assertEquals(
@@ -1448,9 +1464,9 @@ public void test13_InsertUntypedNullValues() throws SQLException {
14481464
try (PreparedStatement preparedStatement =
14491465
connection.prepareStatement(
14501466
"insert into all_nullable_types ("
1451-
+ "ColInt64, ColFloat64, ColBool, ColString, ColBytes, ColDate, ColTimestamp, ColNumeric, ColJson, "
1467+
+ "ColInt64, ColFloat64, ColFloat32, ColBool, ColString, ColBytes, ColDate, ColTimestamp, ColNumeric, ColJson, "
14521468
+ "ColInt64Array, ColFloat64Array, ColBoolArray, ColStringArray, ColBytesArray, ColDateArray, ColTimestampArray, ColNumericArray, ColJsonArray) "
1453-
+ "values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) {
1469+
+ "values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) {
14541470
for (int param = 1;
14551471
param <= preparedStatement.getParameterMetaData().getParameterCount();
14561472
param++) {

src/test/resources/com/google/cloud/spanner/jdbc/it/CreateMusicTables.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ CREATE TABLE Concerts (
7070
CREATE TABLE TableWithAllColumnTypes (
7171
ColInt64 INT64 NOT NULL,
7272
ColFloat64 FLOAT64 NOT NULL,
73+
ColFloat32 FLOAT32 NOT NULL,
7374
ColBool BOOL NOT NULL,
7475
ColString STRING(100) NOT NULL,
7576
ColStringMax STRING(MAX) NOT NULL,
@@ -83,6 +84,7 @@ CREATE TABLE TableWithAllColumnTypes (
8384

8485
ColInt64Array ARRAY<INT64>,
8586
ColFloat64Array ARRAY<FLOAT64>,
87+
ColFloat32Array ARRAY<FLOAT32>,
8688
ColBoolArray ARRAY<BOOL>,
8789
ColStringArray ARRAY<STRING(100)>,
8890
ColStringMaxArray ARRAY<STRING(MAX)>,
@@ -100,6 +102,7 @@ CREATE TABLE TableWithAllColumnTypes (
100102
CREATE TABLE all_nullable_types (
101103
ColInt64 INT64,
102104
ColFloat64 FLOAT64,
105+
ColFloat32 FLOAT32,
103106
ColBool BOOL,
104107
ColString STRING(100),
105108
ColBytes BYTES(100),
@@ -110,6 +113,7 @@ CREATE TABLE all_nullable_types (
110113

111114
ColInt64Array ARRAY<INT64>,
112115
ColFloat64Array ARRAY<FLOAT64>,
116+
ColFloat32Array ARRAY<FLOAT32>,
113117
ColBoolArray ARRAY<BOOL>,
114118
ColStringArray ARRAY<STRING(100)>,
115119
ColBytesArray ARRAY<BYTES(100)>,

src/test/resources/com/google/cloud/spanner/jdbc/it/CreateMusicTables_PG.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ CREATE TABLE Concerts (
7171
CREATE TABLE TableWithAllColumnTypes (
7272
ColInt64 BIGINT PRIMARY KEY,
7373
ColFloat64 FLOAT8 NOT NULL,
74+
ColFloat32 FLOAT4 NOT NULL,
7475
ColBool BOOL NOT NULL,
7576
ColString VARCHAR(100) NOT NULL,
7677
ColStringMax TEXT,
@@ -83,6 +84,7 @@ CREATE TABLE TableWithAllColumnTypes (
8384
CREATE TABLE all_nullable_types (
8485
ColInt64 bigint primary key,
8586
ColFloat64 float8,
87+
ColFloat32 float4,
8688
ColBool boolean,
8789
ColString varchar(100),
8890
ColBytes bytea,
@@ -93,6 +95,7 @@ CREATE TABLE all_nullable_types (
9395

9496
ColInt64Array bigint[],
9597
ColFloat64Array float8[],
98+
ColFloat32Array float4[],
9699
ColBoolArray boolean[],
97100
ColStringArray varchar(100)[],
98101
ColBytesArray bytea[],

0 commit comments

Comments
 (0)