clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

pass mybatis bitmap through the stream to query

Open yanye666 opened this issue 2 years ago • 5 comments

I want to pass mybatis bitmap through the stream to query, can it be implemented?

telegram-cloud-document-5-6257914263923329575

Like this, can you pass it to bitmap and filter it with another table?

yanye666 avatar Feb 05 '23 13:02 yanye666

Yes, via an external or temporary table. Should be similar as: https://github.com/ClickHouse/clickhouse-java/blob/main/examples/jdbc/src/main/java/com/clickhouse/examples/jdbc/Advanced.java#L63-L83

zhicwu avatar Feb 06 '23 11:02 zhicwu

java.sql.SQLException: External table, input function, and query parameter cannot be used together in PreparedStatement.

image

Can't support parameters?

yanye666 avatar Feb 15 '23 07:02 yanye666

@zhicwu

yanye666 avatar Feb 20 '23 08:02 yanye666

java.sql.SQLException: External table, input function, and query parameter cannot be used together in PreparedStatement.

Yes, you have to pick one but not all of them due to limitation of current implementation. I hope it can be addressed later when I add new SQL parser in clickhouse-parser.

Meanwhile, perhaps you can break down the query into two and execute them within a session? For example: first query to create the temp table, and then the second for table join with custom filter/parameter.

zhicwu avatar Feb 20 '23 08:02 zhicwu

This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!

github-actions[bot] avatar Jan 08 '25 00:01 github-actions[bot]