Warning: SQL type unknown
Describe the bug
I see warnings about SQL type in logs. Why?
Steps to reproduce
- Run SQL via JDBC.
Expected behaviour
Code example
SQL:
SELECT
bed.sport_id,
bed.bookmaker_id,
COUNT(bed.event_id) as count
FROM bookmaker_event_data bed
WHERE ((:sportIds) IS NULL OR (bed.sport_id IN (:sportIds)))
AND ((:bookmakerIds) IS NULL OR (bed.bookmaker_id IN (:bookmakerIds)))
AND toDateTime(:dateTimeFrom) <= bed.active_since
AND toDateTime(:dateTimeTo) >= bed.active_till
GROUP BY bed.bookmaker_id, bed.sport_id
ORDER BY bed.bookmaker_id, bed.sport_id;
Params:
sportIds: [20, 10, 26, 14, 17, 1, 2, 35, 29, 31, 44, 22, 24, 47, 32, 28, 12, 46, 41, 40, 39, 42, 19, 36, 25, 4, 23, 49, 5, 6, 30, 37, 38, 50, 48, 18, 45, 27, 34, 21, 15, 43, 11, 7, 33, 13, 8, 9, 16]
bookmakerIds: [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 19, 21, 22, 23, 24, 26, 27, 28, 29, 30, 32, 34, 39, 41, 42, 43, 46, 48, 50, 53, 54, 55, 56, 57, 60, 61, 63, 65, 70, 74, 76, 78, 79, 80, 83, 86, 87, 94, 95, 97, 99, 100, 102, 103, 106, 109, 127, 128, 129, 131, 143, 145, 148, 150, 152, 161, 163, 169, 188, 189, 190, 191, 198, 200, 201, 202, 204, 205, 210, 211, 212, 213, 279, 289, 290, 291, 294, 306, 308]
dateTimeFrom: 1703109600000
dateTimeTo: 1703195999999
Java:
SqlParameterSource parameters = new MapSqlParameterSource()
.addValue("sportIds", sportIds)
.addValue("bookmakerIds", bookmakerIds)
.addValue("dateTimeFrom", dateTimeFrom)
.addValue("dateTimeTo", dateTimeTo);
return namedJdbcTemplate.query(COVERAGE_FILTERED_SQL, parameters, COVERAGE_DATA_ROW_MAPPER);
Error log
2023-12-21 20:54:43.349 TRACE 22428 --- [nio-9090-exec-9] o.s.jdbc.core.StatementCreatorUtils : Setting SQL statement parameter value: column index 286, parameter value [308], value class [java.lang.Short], SQL type unknown
2023-12-21 20:54:43.349 TRACE 22428 --- [nio-9090-exec-9] o.s.jdbc.core.StatementCreatorUtils : Setting SQL statement parameter value: column index 287, parameter value [1701381600], value class [java.lang.Long], SQL type unknown
Configuration
Environment
- Client version: 0.5.0
- Language version: 17
- OS: Windows 10
ClickHouse server
- ClickHouse Server version: clickhouse/clickhouse-server:head-alpine Docker
- ClickHouse Server non-default settings, if any: NONE
-
CREATE TABLEstatements for tables involved:
CREATE TABLE bookmaker_event_data
(
event_id Int64 CODEC (Delta, LZ4),
sport_id Int16 CODEC (Delta, LZ4),
bookmaker_id Int16 CODEC (Delta, LZ4),
active_since DateTime,
active_till DateTime
) ENGINE = ReplacingMergeTree ORDER BY (event_id, sport_id, bookmaker_id) TTL active_since + INTERVAL 3 MONTH;
- Sample data for all these tables, use clickhouse-obfuscator if necessary
@Tsyklop Can you provide a full snippet?
@mzitnik full snippet? Do you mean all code?
Yes, if you have a code that reproduces the issue.