Doris版本:4.0.2
通过创建catalog的方式导入clickhouse数据库中的表
clickhouse的驱动版本:clickhouse-jdbc-0.4.6-all.jar
clickhouse的表结构定义如下:
CREATE TABLE
indicator_history.xzl_hq_indicator_1000 (
mktcode Int32 COMMENT '市场代码',
tgtcode String COMMENT '标的代码',
bizdate Date COMMENT '业务时间',
_order Int32,
time Nullable(Int64),
lastPx Nullable(Int32),
volume Nullable(Int64),
turnover Nullable(Int64),
totalVol Nullable(Int64),
totalTur Nullable(Int64),
highPx Nullable(Int64),
lowPx Nullable(Int64)
) ENGINE = HaUniqueMergeTree(
'/clickhouse/tables/ee3f72ec-b673-4675-ae3f-72ecb6738675/{shard}',
'{replica}'
)
PARTITION BY
toYear(bizdate)
ORDER BY
(mktcode, tgtcode, bizdate, _order) UNIQUE KEY (mktcode, tgtcode, bizdate, _order) SETTINGS index_granularity = 8192,
max_gc_outdated_parts_per_round = 500
CREATE-TABLE-AS-SELECT语句如下:
CREATE TABLE IF NOT EXISTS indicator.xzl_hq_indicator_1000
AUTO PARTITION BY RANGE (date_trunc(bizdate, 'year'))()
DISTRIBUTED BY HASH(mktcode,tgtcode) BUCKETS 24
PROPERTIES (
'replication_num' = '1'
)
AS SELECT * FROM clickhouse.indicator_history.xzl_hq_indicator_1000
报错如下:ERROR 1105 (HY000) at line 1: errCode = 2, detailMessage = [JNI_ERROR]JdbcExecutorException: jdbc get block address: | CAUSED BY: SQLException: java.io.IOException: Failed to read boolean value, expect 0 (false) or 1 (true) but we got: 32 | CAUSED BY: IOException: Failed to read boolean value, expect 0 (false) or 1 (true) but we got: 32