Fedor Malchikov created IGNITE-16411: -----------------------------------------
Summary: NPE in org.apache.ignite.internal.jdbc.JdbcDatabaseMetadata.getColumns Key: IGNITE-16411 URL: https://issues.apache.org/jira/browse/IGNITE-16411 Project: Ignite Issue Type: Bug Components: sql Affects Versions: 3.0.0-alpha3 Reporter: Fedor Malchikov {code:java} [INFO ] 2022-01-26 18:39:46,803 [main] com.oltpbenchmark.DBWorkload main - Finished creating new YCSB database... Exception in thread "main" java.util.concurrent.CompletionException: class org.apache.ignite.client.IgniteClientException: null at java.base/java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:412) at java.base/java.util.concurrent.CompletableFuture.join(CompletableFuture.java:2044) at org.apache.ignite.internal.jdbc.JdbcDatabaseMetadata.getColumns(JdbcDatabaseMetadata.java:975) at com.oltpbenchmark.util.SQLUtil.getCatalogDirect(SQLUtil.java:458) at com.oltpbenchmark.util.SQLUtil.getCatalog(SQLUtil.java:411) at com.oltpbenchmark.api.BenchmarkModule.refreshCatalog(BenchmarkModule.java:233) at com.oltpbenchmark.DBWorkload.main(DBWorkload.java:416) Caused by: class org.apache.ignite.client.IgniteClientException: null at org.apache.ignite.internal.client.TcpClientChannel.convertException(TcpClientChannel.java:241) at org.apache.ignite.internal.client.TcpClientChannel.send(TcpClientChannel.java:197) at org.apache.ignite.internal.client.TcpClientChannel.serviceAsync(TcpClientChannel.java:143) at org.apache.ignite.internal.client.ReliableChannel.handleServiceAsync(ReliableChannel.java:188) at org.apache.ignite.internal.client.ReliableChannel.serviceAsync(ReliableChannel.java:144) at org.apache.ignite.internal.client.TcpIgniteClient.sendRequestAsync(TcpIgniteClient.java:145) at org.apache.ignite.internal.client.query.JdbcClientQueryEventHandler.columnsMetaAsync(JdbcClientQueryEventHandler.java:103) at org.apache.ignite.internal.jdbc.JdbcDatabaseMetadata.getColumns(JdbcDatabaseMetadata.java:974) ... 4 more Caused by: java.lang.NullPointerException at io.netty.buffer.ByteBufUtil.utf8MaxBytes(ByteBufUtil.java:948) at org.apache.ignite.internal.client.proto.ClientMessagePacker.packString(ClientMessagePacker.java:292) at org.apache.ignite.client.proto.query.event.JdbcMetaColumnsRequest.writeBinary(JdbcMetaColumnsRequest.java:89) at org.apache.ignite.internal.client.TcpIgniteClient.lambda$sendRequestAsync$1(TcpIgniteClient.java:145) at org.apache.ignite.internal.client.TcpClientChannel.send(TcpClientChannel.java:182) ... 10 more {code} after create table: {code:sql} CREATE TABLE usertable ( ycsb_key int PRIMARY KEY, field1 varchar(100), field2 varchar(100), field3 varchar(100), field4 varchar(100), field5 varchar(100), field6 varchar(100), field7 varchar(100), field8 varchar(100), field9 varchar(100), field10 varchar(100) );{code} Reproduced on: {code:java} private static AbstractCatalog getCatalogDirect(DatabaseType databaseType, Connection connection) throws SQLException { DatabaseMetaData md = connection.getMetaData(); String separator = md.getIdentifierQuoteString(); String catalog = connection.getCatalog(); String schema = connection.getSchema(); Map<String, Table> tables = new HashMap<>(); List<String> excludedColumns = new ArrayList<>(); try (ResultSet table_rs = md.getTables(catalog, schema, null, new String[]{"TABLE"})) { while (table_rs.next()) { String table_type = table_rs.getString("TABLE_TYPE"); if (!table_type.equalsIgnoreCase("TABLE")) { continue; } String table_name = table_rs.getString("TABLE_NAME"); Table catalog_tbl = new Table(table_name, separator); try (ResultSet col_rs = md.getColumns(catalog, schema, table_name, null)) { while (col_rs.next()) { String col_name = col_rs.getString("COLUMN_NAME"); if (excludedColumns.contains(col_name.toUpperCase())) { LOG.debug("found excluded column [{}] for in database type [{}]. Skipping...", col_name, databaseType); continue; } int col_type = col_rs.getInt("DATA_TYPE"); Integer col_size = col_rs.getInt("COLUMN_SIZE"); boolean col_nullable = col_rs.getString("IS_NULLABLE").equalsIgnoreCase("YES"); Column catalog_col = new Column(col_name, separator, catalog_tbl, col_type, col_size, col_nullable); catalog_tbl.addColumn(catalog_col); } } {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)