From dbed728f840bdb84880708dda865ba4c985e95f9 Mon Sep 17 00:00:00 2001 From: Dane Pitkin <48041712+danepitkin@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:31:51 -0500 Subject: [PATCH] GH-39189: [Java] Bump com.h2database:h2 from 1.4.196 to 2.2.224 in /java (#39188) ### Rationale for this change Dependabot flagged this upgrade, but it requires test code changes. H2 is an in-memory database used for JDBC testing and 2.0 had several backwards-breaking changes: https://h2database.com/html/migration-to-v2.html ### What changes are included in this PR? * h2database upgraded from 1.4.196 -> 2.2.224 * H2 changed VARCHAR description from `VARCHAR` to `CHARACTER VARYING` * To query all tables/columns in H2, use `null` values for catalog and schema parameters instead of `%` * H2 now returns Binary and Blob data as a byte array instead of hex values * H2 added the type `VARBINARY`. `Binary` must now be a fixed length and is padded with zeroes. * H2 `CHAR` is fixed length and pads with whitespace now * H2 enforces all `ARRAY`s must be typed * H2 changed the literal syntax for arrays to be `ARRAY[val1, val2, ...]` from `(val1, val2, ...)` * H2 handles unicode chars natively now * H2 connections' `createArrayOf` API handles null values differently now ### Are these changes tested? Unit tests. ### Are there any user-facing changes? No, only tests updated. * Closes: #39189 Authored-by: Dane Pitkin Signed-off-by: David Li --- java/adapter/jdbc/pom.xml | 2 +- .../jdbc/JdbcToArrowCommentMetadataTest.java | 6 ++--- .../adapter/jdbc/JdbcToArrowTestHelper.java | 12 +--------- .../org/apache/arrow/adapter/jdbc/Table.java | 23 ++---------------- .../adapter/jdbc/h2/JdbcToArrowArrayTest.java | 21 ++++++++++------ .../resources/h2/test1_all_datatypes_h2.yml | 24 +++++++++---------- .../h2/test1_all_datatypes_null_h2.yml | 4 ++-- ...t1_all_datatypes_selected_null_rows_h2.yml | 8 +++---- .../src/test/resources/h2/test1_binary_h2.yml | 2 +- .../src/test/resources/h2/test1_char_h2.yml | 2 +- .../test/resources/h2/test1_charset_ch_h2.yml | 2 +- .../test/resources/h2/test1_charset_h2.yml | 2 +- .../test/resources/h2/test1_charset_jp_h2.yml | 2 +- .../test/resources/h2/test1_charset_kr_h2.yml | 2 +- .../src/test/resources/h2/test1_list_h2.yml | 22 ++++++++--------- .../h2/test1_selected_datatypes_null_h2.yml | 4 ++-- java/performance/pom.xml | 2 +- 17 files changed, 59 insertions(+), 81 deletions(-) diff --git a/java/adapter/jdbc/pom.xml b/java/adapter/jdbc/pom.xml index 2490f708e6f24..f95956d1f61d5 100644 --- a/java/adapter/jdbc/pom.xml +++ b/java/adapter/jdbc/pom.xml @@ -51,7 +51,7 @@ com.h2database h2 - 1.4.196 + 2.2.224 test diff --git a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowCommentMetadataTest.java b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowCommentMetadataTest.java index dc52210d6c7ab..07cab0d829fed 100644 --- a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowCommentMetadataTest.java +++ b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowCommentMetadataTest.java @@ -127,7 +127,7 @@ public void schemaCommentWithDatabaseMetadata() throws Exception { "SQL_SCHEMA_NAME", "PUBLIC", "SQL_TABLE_NAME", "TABLE1", "SQL_COLUMN_NAME", "NAME", - "SQL_TYPE", "VARCHAR", + "SQL_TYPE", "CHARACTER VARYING", "comment", "Name of record")), field("COLUMN1", true, Types.MinorType.BIT.getType(), metadata( @@ -205,7 +205,7 @@ private String getTableComment(DatabaseMetaData metaData, String tableName) thro } String comment = null; int rowCount = 0; - try (ResultSet tableMetadata = metaData.getTables("%", "%", tableName, null)) { + try (ResultSet tableMetadata = metaData.getTables(null, null, tableName, null)) { if (tableMetadata.next()) { comment = tableMetadata.getString("REMARKS"); rowCount++; @@ -221,7 +221,7 @@ private String getTableComment(DatabaseMetaData metaData, String tableName) thro } private String getColumnComment(DatabaseMetaData metaData, String tableName, String columnName) throws SQLException { - try (ResultSet tableMetadata = metaData.getColumns("%", "%", tableName, columnName)) { + try (ResultSet tableMetadata = metaData.getColumns(null, null, tableName, columnName)) { if (tableMetadata.next()) { return tableMetadata.getString("REMARKS"); } diff --git a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowTestHelper.java b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowTestHelper.java index d5f896ba7df56..91f2f465dd989 100644 --- a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowTestHelper.java +++ b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowTestHelper.java @@ -334,16 +334,6 @@ public static void assertFieldMetadataMatchesResultSetMetadata(ResultSetMetaData } } - public static byte[] hexStringToByteArray(String s) { - int len = s.length(); - byte[] data = new byte[len / 2]; - for (int i = 0; i < len; i += 2) { - data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + - Character.digit(s.charAt(i + 1), 16)); - } - return data; - } - public static Integer[] getIntValues(String[] values, String dataType) { String[] dataArr = getValues(values, dataType); Integer[] valueArr = new Integer[dataArr.length]; @@ -429,7 +419,7 @@ public static byte[][] getBinaryValues(String[] values, String dataType) { byte[][] valueArr = new byte[dataArr.length][]; int i = 0; for (String data : dataArr) { - valueArr[i++] = "null".equals(data.trim()) ? null : hexStringToByteArray(data.trim()); + valueArr[i++] = "null".equals(data.trim()) ? null : data.trim().getBytes(); } return valueArr; } diff --git a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/Table.java b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/Table.java index 87d5765b5d4b4..50c4fe6db2a14 100644 --- a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/Table.java +++ b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/Table.java @@ -129,7 +129,7 @@ public Float[] getFloatValues() { } public byte[][] getBinaryValues() { - return getHexToByteArray(values); + return getByteArray(values); } public byte[][] getVarCharValues() { @@ -137,7 +137,7 @@ public byte[][] getVarCharValues() { } public byte[][] getBlobValues() { - return getBinaryValues(); + return getByteArray(values); } public byte[][] getClobValues() { @@ -221,23 +221,4 @@ static byte[][] getByteArray(String[] data) { } return byteArr; } - - static byte[][] getHexToByteArray(String[] data) { - byte[][] byteArr = new byte[data.length][]; - - for (int i = 0; i < data.length; i++) { - byteArr[i] = hexStringToByteArray(data[i]); - } - return byteArr; - } - - static byte[] hexStringToByteArray(String s) { - int len = s.length(); - byte[] data = new byte[len / 2]; - for (int i = 0; i < len; i += 2) { - data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + - Character.digit(s.charAt(i + 1), 16)); - } - return data; - } } diff --git a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/h2/JdbcToArrowArrayTest.java b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/h2/JdbcToArrowArrayTest.java index b7dc1ee58a5ba..377e332b43a13 100644 --- a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/h2/JdbcToArrowArrayTest.java +++ b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/h2/JdbcToArrowArrayTest.java @@ -53,7 +53,8 @@ public class JdbcToArrowArrayTest { private Connection conn = null; private static final String CREATE_STATEMENT = - "CREATE TABLE array_table (id INTEGER, int_array ARRAY, float_array ARRAY, string_array ARRAY);"; + "CREATE TABLE array_table (id INTEGER, int_array INTEGER ARRAY, float_array REAL ARRAY, " + + "string_array VARCHAR ARRAY);"; private static final String INSERT_STATEMENT = "INSERT INTO array_table (id, int_array, float_array, string_array) VALUES (?, ?, ?, ?);"; private static final String QUERY = "SELECT int_array, float_array, string_array FROM array_table ORDER BY id;"; @@ -354,9 +355,9 @@ private void insertRows( Float[] floatArray = floatArrays[i]; String[] strArray = strArrays[i]; - Array intArray = conn.createArrayOf("INT", integerArray); - Array realArray = conn.createArrayOf("REAL", floatArray); - Array varcharArray = conn.createArrayOf("VARCHAR", strArray); + Array intArray = integerArray != null ? conn.createArrayOf("INT", integerArray) : null; + Array realArray = floatArray != null ? conn.createArrayOf("REAL", floatArray) : null; + Array varcharArray = strArray != null ? conn.createArrayOf("VARCHAR", strArray) : null; // Insert Arrays of 4 Values in Each Row stmt.setInt(1, i); @@ -366,9 +367,15 @@ private void insertRows( stmt.executeUpdate(); - intArray.free(); - realArray.free(); - varcharArray.free(); + if (intArray != null) { + intArray.free(); + } + if (realArray != null) { + realArray.free(); + } + if (varcharArray != null) { + varcharArray.free(); + } } } } diff --git a/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_h2.yml b/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_h2.yml index ff76acf8d7cfb..c4f0017095df0 100644 --- a/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_h2.yml +++ b/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_h2.yml @@ -13,59 +13,59 @@ name: 'test1_all_datatypes_h2' create: 'CREATE TABLE table1 (int_field1 INT, bool_field2 BOOLEAN, tinyint_field3 TINYINT, smallint_field4 SMALLINT, bigint_field5 BIGINT, decimal_field6 DECIMAL(20,2), double_field7 DOUBLE, real_field8 REAL, time_field9 TIME, date_field10 DATE, timestamp_field11 TIMESTAMP, - binary_field12 BINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(16), bit_field17 BIT, - null_field18 NULL, list_field19 ARRAY, map_field20 VARCHAR(256));' + binary_field12 VARBINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(14), bit_field17 BIT, + null_field18 NULL, list_field19 INT ARRAY, map_field20 VARCHAR(256));' data: - 'INSERT INTO table1 VALUES (101, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''), PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', - ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (1, 2, 3), ''{"a":"b","key":"12345"}'');' + ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[1, 2, 3], ''{"a":"b","key":"12345"}'');' - 'INSERT INTO table1 VALUES (102, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''), PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', - ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (1, 2),''{"c":"d"}'');' + ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[1, 2],''{"c":"d"}'');' - 'INSERT INTO table1 VALUES (103, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''), PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', - ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (1),''{"e":"f"}'');' + ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[1],''{"e":"f"}'');' - 'INSERT INTO table1 VALUES (104, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''), PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', - ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (2, 3, 4),''{"g":"h"}'');' + ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[2, 3, 4],''{"g":"h"}'');' - 'INSERT INTO table1 VALUES (null, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''), PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', - ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (2, 3),''{"i":"j"}'');' + ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[2, 3],''{"i":"j"}'');' - 'INSERT INTO table1 VALUES (null, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''), PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', - ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (2),''{"k":"l"}'');' + ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[2],''{"k":"l"}'');' - 'INSERT INTO table1 VALUES (107, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''), PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', - ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (3, 4, 5),''{"m":"n"}'');' + ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[3, 4, 5],''{"m":"n"}'');' - 'INSERT INTO table1 VALUES (108, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''), PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', - ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (3, 4),''{"o":"p"}'');' + ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[3, 4],''{"o":"p"}'');' - 'INSERT INTO table1 VALUES (109, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''), PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', - ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (3),''{"q":"r"}'');' + ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[3],''{"q":"r"}'');' - 'INSERT INTO table1 VALUES (110, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''), PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', - ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (),''{"s":"t"}'');' + ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[],''{"s":"t"}'');' query: 'select int_field1, bool_field2, tinyint_field3, smallint_field4, bigint_field5, decimal_field6, double_field7, real_field8, time_field9, date_field10, timestamp_field11, binary_field12, varchar_field13, blob_field14, clob_field15, char_field16, bit_field17, null_field18, list_field19, map_field20 from table1' diff --git a/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_null_h2.yml b/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_null_h2.yml index e1b1a1adcbb70..9be76229dab82 100644 --- a/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_null_h2.yml +++ b/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_null_h2.yml @@ -38,8 +38,8 @@ rowCount: '5' create: 'CREATE TABLE table1 (int_field1 INT, bool_field2 BOOLEAN, tinyint_field3 TINYINT, smallint_field4 SMALLINT, bigint_field5 BIGINT, decimal_field6 DECIMAL(20,2), double_field7 DOUBLE, real_field8 REAL, time_field9 TIME, date_field10 DATE, timestamp_field11 TIMESTAMP, - binary_field12 BINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(16), bit_field17 BIT, - list_field19 ARRAY,map_field20 VARCHAR(256));' + binary_field12 VARBINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(14), bit_field17 BIT, + list_field19 INT ARRAY, map_field20 VARCHAR(256));' data: - 'INSERT INTO table1 VALUES (null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);' diff --git a/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_selected_null_rows_h2.yml b/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_selected_null_rows_h2.yml index 0521ce2f9c30d..fda31da150775 100644 --- a/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_selected_null_rows_h2.yml +++ b/java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_selected_null_rows_h2.yml @@ -36,8 +36,8 @@ vectors: create: 'CREATE TABLE table1 (int_field1 INT, bool_field2 BOOLEAN, tinyint_field3 TINYINT, smallint_field4 SMALLINT, bigint_field5 BIGINT, decimal_field6 DECIMAL(20,2), double_field7 DOUBLE, real_field8 REAL, time_field9 TIME, date_field10 DATE, timestamp_field11 TIMESTAMP, - binary_field12 BINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(16), bit_field17 BIT, - list_field19 ARRAY, map_field20 VARCHAR(256));' + binary_field12 VARBINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(14), bit_field17 BIT, + list_field19 INT ARRAY, map_field20 VARCHAR(256));' data: - 'INSERT INTO table1 VALUES (null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);' @@ -46,7 +46,7 @@ data: PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', - 1, (1, 2, 3),''{"a":"b"}'');' + 1, ARRAY[1, 2, 3],''{"a":"b"}'');' - 'INSERT INTO table1 VALUES (null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);' @@ -54,7 +54,7 @@ data: PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''), ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'', ''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', - 1, (1, 2, 3),''{"c":"d"}'');' + 1, ARRAY[1, 2, 3],''{"c":"d"}'');' - 'INSERT INTO table1 VALUES (null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);' diff --git a/java/adapter/jdbc/src/test/resources/h2/test1_binary_h2.yml b/java/adapter/jdbc/src/test/resources/h2/test1_binary_h2.yml index ed94a7a189135..3d7b1ec658ef7 100644 --- a/java/adapter/jdbc/src/test/resources/h2/test1_binary_h2.yml +++ b/java/adapter/jdbc/src/test/resources/h2/test1_binary_h2.yml @@ -15,7 +15,7 @@ type: 'binary' vector: 'BINARY_FIELD12' -create: 'CREATE TABLE table1 (binary_field12 BINARY(100));' +create: 'CREATE TABLE table1 (binary_field12 VARBINARY(100));' data: - 'INSERT INTO table1 VALUES (''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'');' diff --git a/java/adapter/jdbc/src/test/resources/h2/test1_char_h2.yml b/java/adapter/jdbc/src/test/resources/h2/test1_char_h2.yml index 018fe46c3ed53..588df7bff4df6 100644 --- a/java/adapter/jdbc/src/test/resources/h2/test1_char_h2.yml +++ b/java/adapter/jdbc/src/test/resources/h2/test1_char_h2.yml @@ -15,7 +15,7 @@ type: 'char' vector: 'CHAR_FIELD16' -create: 'CREATE TABLE table1 (char_field16 CHAR(16));' +create: 'CREATE TABLE table1 (char_field16 CHAR(14));' data: - 'INSERT INTO table1 VALUES (''some char text'');' diff --git a/java/adapter/jdbc/src/test/resources/h2/test1_charset_ch_h2.yml b/java/adapter/jdbc/src/test/resources/h2/test1_charset_ch_h2.yml index 1a82fa60a0b97..2e60a4af5a970 100644 --- a/java/adapter/jdbc/src/test/resources/h2/test1_charset_ch_h2.yml +++ b/java/adapter/jdbc/src/test/resources/h2/test1_charset_ch_h2.yml @@ -22,7 +22,7 @@ rowCount: '5' charSet: 'GBK' -create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(128));' +create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(13));' data: - 'INSERT INTO table1 VALUES (101,''一些帶有char編碼的文本需要轉換為varchar'', ''一些带有char编码的文本需要转换为clob'', ''一些char编码的字符文本'');' diff --git a/java/adapter/jdbc/src/test/resources/h2/test1_charset_h2.yml b/java/adapter/jdbc/src/test/resources/h2/test1_charset_h2.yml index 42f088e18d931..383681e5b3b41 100644 --- a/java/adapter/jdbc/src/test/resources/h2/test1_charset_h2.yml +++ b/java/adapter/jdbc/src/test/resources/h2/test1_charset_h2.yml @@ -20,7 +20,7 @@ vectors: rowCount: '10' -create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(128));' +create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(33));' data: - 'INSERT INTO table1 VALUES (101,''some text with char encoding that needs to be converted to varchar'', ''some text with char encoding that needs to be converted to clob'', ''some char text with char encoding'');' diff --git a/java/adapter/jdbc/src/test/resources/h2/test1_charset_jp_h2.yml b/java/adapter/jdbc/src/test/resources/h2/test1_charset_jp_h2.yml index 2eae4019277ea..9b3cf9a18fe01 100644 --- a/java/adapter/jdbc/src/test/resources/h2/test1_charset_jp_h2.yml +++ b/java/adapter/jdbc/src/test/resources/h2/test1_charset_jp_h2.yml @@ -22,7 +22,7 @@ rowCount: '5' charSet: 'SJIS' -create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(128));' +create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(23));' data: - 'INSERT INTO table1 VALUES (101,''varcharに変換する必要があるcharエンコーディングのテキスト'', ''charエンコーディングのあるテキストをclobに変換する必要がある'', ''charエンコーディングのあるcharテキスト'');' diff --git a/java/adapter/jdbc/src/test/resources/h2/test1_charset_kr_h2.yml b/java/adapter/jdbc/src/test/resources/h2/test1_charset_kr_h2.yml index c6b6ee0551a36..d6e051c094fbe 100644 --- a/java/adapter/jdbc/src/test/resources/h2/test1_charset_kr_h2.yml +++ b/java/adapter/jdbc/src/test/resources/h2/test1_charset_kr_h2.yml @@ -22,7 +22,7 @@ rowCount: '5' charSet: 'EUC-KR' -create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(128));' +create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(22));' data: - 'INSERT INTO table1 VALUES (101,''char 인코딩을 사용하는 일부 텍스트를 varchar로 변환해야합니다.'', ''clob로 변환해야하는 char 인코딩을 가진 텍스트'', ''char 인코딩을 사용한 char 텍스트'');' diff --git a/java/adapter/jdbc/src/test/resources/h2/test1_list_h2.yml b/java/adapter/jdbc/src/test/resources/h2/test1_list_h2.yml index 1314c49bf70fa..044c22182af58 100644 --- a/java/adapter/jdbc/src/test/resources/h2/test1_list_h2.yml +++ b/java/adapter/jdbc/src/test/resources/h2/test1_list_h2.yml @@ -15,19 +15,19 @@ type: 'list' vector: 'LIST_FIELD19' -create: 'CREATE TABLE table1 (list_field19 ARRAY);' +create: 'CREATE TABLE table1 (list_field19 INT ARRAY);' data: - - 'INSERT INTO table1 VALUES ((1,2,3));' - - 'INSERT INTO table1 VALUES ((1,2,3));' - - 'INSERT INTO table1 VALUES ((1,2,3));' - - 'INSERT INTO table1 VALUES ((1,2,3));' - - 'INSERT INTO table1 VALUES ((1,2,3));' - - 'INSERT INTO table1 VALUES ((1,2,3));' - - 'INSERT INTO table1 VALUES ((1,2,3));' - - 'INSERT INTO table1 VALUES ((1,2,3));' - - 'INSERT INTO table1 VALUES ((1,2,3));' - - 'INSERT INTO table1 VALUES ((1,2,3));' + - 'INSERT INTO table1 VALUES (ARRAY[1, 2, 3]);' + - 'INSERT INTO table1 VALUES (ARRAY[1, 2, 3]);' + - 'INSERT INTO table1 VALUES (ARRAY[1, 2, 3]);' + - 'INSERT INTO table1 VALUES (ARRAY[1, 2, 3]);' + - 'INSERT INTO table1 VALUES (ARRAY[1, 2, 3]);' + - 'INSERT INTO table1 VALUES (ARRAY[1, 2, 3]);' + - 'INSERT INTO table1 VALUES (ARRAY[1, 2, 3]);' + - 'INSERT INTO table1 VALUES (ARRAY[1, 2, 3]);' + - 'INSERT INTO table1 VALUES (ARRAY[1, 2, 3]);' + - 'INSERT INTO table1 VALUES (ARRAY[1, 2, 3]);' query: 'select list_field19 from table1;' diff --git a/java/adapter/jdbc/src/test/resources/h2/test1_selected_datatypes_null_h2.yml b/java/adapter/jdbc/src/test/resources/h2/test1_selected_datatypes_null_h2.yml index e8d1d5de02c63..60a4462272c7f 100644 --- a/java/adapter/jdbc/src/test/resources/h2/test1_selected_datatypes_null_h2.yml +++ b/java/adapter/jdbc/src/test/resources/h2/test1_selected_datatypes_null_h2.yml @@ -34,8 +34,8 @@ rowCount: '5' create: 'CREATE TABLE table1 (int_field1 INT, bool_field2 BOOLEAN, tinyint_field3 TINYINT, smallint_field4 SMALLINT, bigint_field5 BIGINT, decimal_field6 DECIMAL(20,2), double_field7 DOUBLE, real_field8 REAL, time_field9 TIME, date_field10 DATE, timestamp_field11 TIMESTAMP, - binary_field12 BINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(16), bit_field17 BIT, - list_field19 ARRAY, map_field20 VARCHAR(256));' + binary_field12 VARBINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(14), bit_field17 BIT, + list_field19 INT ARRAY, map_field20 VARCHAR(256));' data: - 'INSERT INTO table1 (int_field1, bool_field2, tinyint_field3, smallint_field4) VALUES (102, 0, 46, 12001);' diff --git a/java/performance/pom.xml b/java/performance/pom.xml index 269ac72d83326..a3e4da85b4321 100644 --- a/java/performance/pom.xml +++ b/java/performance/pom.xml @@ -64,7 +64,7 @@ com.h2database h2 - 1.4.196 + 2.2.224 test