-
Couldn't load subscription status.
- Fork 613
Description
Describe the bug
According to the documentation, underscore is a valid character in a column name:
Non-quoted identifiers must match the regex ^[a-zA-Z_][0-9a-zA-Z_]*$ and can not be equal to [keywords](https://clickhouse.com/docs/en/sql-reference/syntax#keywords). Examples: x, _1, X_y__Z123_.
But when I try to register an POJO for a table in the Java client-v2, an error occurs for any column that contains an underscore in the name:
Exception in thread "main" java.lang.IllegalArgumentException: No serializer found for column 'ORA_ROW_ID'. Did you forget to register it?
at com.clickhouse.client.api.Client.insert(Client.java:1178)
at com.clickhouse.client.api.Client.insert(Client.java:1124)
at solutions.a2.oracle.expimp.pipe.DtoTest.main(DtoTest.java:84)
Steps to reproduce
- Create project with Java client-v2, i.e. for Gradle add dependency:
def clickHouseVersion = "0.7.0"
// https://mvnrepository.com/artifact/com.clickhouse/clickhouse-client
implementation("com.clickhouse:client-v2:$clickHouseVersion")
- Create table
CREATE TABLE TEST4CH(
ORA_ROW_ID String,
OWNER String,
NAME String,
TYPE String,
LINE UInt32,
TEXT String,
ORIGIN_CON_ID Nullable(UInt32)) engine = MergeTree order by ();
- Try to register POJO for this table and then insert to this table
Expected behaviour
Successful execution
Code example
client.register(dynamicClass, client.getTableSchema("TEST4CH"));
InsertSettings settings = new InsertSettings().compressClientRequest(true);
try (InsertResponse response = client.insert("TEST4CH", list).get()) {
System.out.println("rows written=" + response.getWrittenRows());
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ExecutionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
client.close();
Error log
6:50:01,415 INFO main Client:build:886 - Using server timezone: UTC
06:50:01,712 INFO main Client:poolConnectionManager:201 - Connection reuse strategy: FIFO
06:50:01,745 INFO main Client::110 - client compression: true, server compression: true, http compression: false
06:50:01,746 INFO main Client::168 - Using new http client implementation
06:50:03,499 WARN main Client:register:1087 - No getter method found for column: orarowid
06:50:03,499 WARN main Client:register:1095 - No setter method found for column: orarowid
06:50:03,509 WARN main Client:register:1087 - No getter method found for column: originconid
06:50:03,509 WARN main Client:register:1095 - No setter method found for column: originconid
Exception in thread "main" java.lang.IllegalArgumentException: No serializer found for column 'ORA_ROW_ID'. Did you forget to register it?
at com.clickhouse.client.api.Client.insert(Client.java:1178)
at com.clickhouse.client.api.Client.insert(Client.java:1124)
at solutions.a2.oracle.expimp.pipe.DtoTest.main(DtoTest.java:84)
Configuration
Environment
- Client version: 0.7.0
- Language version: N/A
- OS: Linux
ClickHouse server
24.6.2
CREATE TABLEstatements for tables involved:
CREATE TABLE TEST4CH(
ORA_ROW_ID String,
OWNER String,
NAME String,
TYPE String,
LINE UInt32,
TEXT String,
ORIGIN_CON_ID Nullable(UInt32)) engine = MergeTree order by ();