Comments (4)
I'm also having this problem, can tell me how did you solve it, thank you
from clickhouse-java.
Hello.
Here is the test showing that 30 columns makes no problem for jdbc driver (it works).
There are many things going on in your example like JdbcRecordWriter and properties provider. There may be some restrictions in them.
If it is not, and the problem is indeed in the driver, could you provide the test case with direct use of jdbc api?
@Test
public void test40() throws SQLException {
int fieldsNum = 40;
int rowsNum = 10;
connection.createStatement().execute("DROP TABLE IF EXISTS test.test_40");
List<String> fieldsDesc = new ArrayList<String>();
List<String> fields = new ArrayList<String>();
List<String> questions = new ArrayList<String>();
for (int i = 0; i < fieldsNum; i++) {
fieldsDesc.add("field" + i + " UInt32");
fields.add("field" + i);
questions.add("?");
}
connection.createStatement().execute(
"CREATE TABLE IF NOT EXISTS test.test_40 (" + Joiner.on(",").join(fieldsDesc) + ") ENGINE = TinyLog"
);
PreparedStatement statement = connection.prepareStatement("insert into test.test_40 ("+ Joiner.on(",").join(fields) + ") values (" + Joiner.on(",").join(questions) + ")" );
for (int j = 0; j < rowsNum; j++) {
for (int i = 0; i < fieldsNum; i++) {
statement.setInt(i +1, i + 100*j);
}
statement.addBatch();
}
statement.executeBatch();
ResultSet rs = connection.createStatement().executeQuery("select * from test.test_40");
while (rs.next()) {
System.out.println("next");
StringBuilder sb = new StringBuilder();
for (int i = 0; i < fieldsNum; i++) {
sb.append(rs.getInt(i+1)).append(";");
}
System.out.println(sb.toString());
}
}
from clickhouse-java.
Hello. Thank you for response.
I had tried batch insert of 30+ columns with Spring jdbcTemplate+driver and it works without errors.
So it is definitely not a JDBC driver issue.
from clickhouse-java.
输出到clickhouse(jdbc)的多个字段,每个字段值都不允许是null,否则报错如此.
from clickhouse-java.
Related Issues (20)
- [client-v2] Native Protocol: Handshake, Ping HOT 5
- [client-v2] Native Protocol: Complete path
- [client-v2] Native Protocol: Bi-directional Compression
- instantiating a ClickHouseHttpClient takes almost a minute
- It spent about 40 seconds loading jdbc-driver after 1.6.0-patch3 HOT 2
- IllegalArgumentException caused by local default datetime when using nullAsDefault property HOT 3
- Caused by: java.sql.SQLException: <html> <head><title>405 Not Allowed</title></head> HOT 2
- When spawning more than 16 requests with Java 11 HTTP client: com.clickhouse.client.ClickHouseException: Code: 159. Execution timed out HOT 10
- get time_stamp default timezone issue. HOT 3
- Cleanup dependencies
- We're getting a response in cloud but not locally and it messed up the test logic
- Disabled Unit Tests (in the Cloud)
- problem with default http-client in jdbc-driver HOT 2
- input_format_null_as_default flag not available as a valid connection query param HOT 4
- ClassCastException in Spark when retrieving arrays from ClickHouse via clickhouse-java driver HOT 1
- Enhance user-agent test to use parameterized test instead (and reuse code)
- problem with JDBC Driver Connection Reset HOT 5
- Request cancelation
- Return java.sql.Struct for Tuple types instead of java.util.ArrayList in ClickHouse JDBC driver HOT 1
- [clickhouse-http-client] Extend Apache HTTP Client Connection Pool Config
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clickhouse-java.