mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
fix usage of non-materialized skip indexes
This commit is contained in:
parent
f064f2cdaa
commit
dd7387729b
@ -147,9 +147,11 @@ struct IMergeTreeIndex
|
|||||||
/// Returns extension for deserialization.
|
/// Returns extension for deserialization.
|
||||||
///
|
///
|
||||||
/// Return pair<extension, version>.
|
/// Return pair<extension, version>.
|
||||||
virtual MergeTreeIndexFormat getDeserializedFormat(const DiskPtr, const std::string & /* relative_path_prefix */) const
|
virtual MergeTreeIndexFormat getDeserializedFormat(const DiskPtr disk, const std::string & relative_path_prefix) const
|
||||||
{
|
{
|
||||||
return {1, ".idx"};
|
if (disk->exists(relative_path_prefix + ".idx"))
|
||||||
|
return {1, ".idx"};
|
||||||
|
return {0 /*unknown*/, ""};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Checks whether the column is in data skipping index.
|
/// Checks whether the column is in data skipping index.
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
1
|
@ -0,0 +1,11 @@
|
|||||||
|
DROP TABLE IF EXISTS t_index_non_materialized;
|
||||||
|
|
||||||
|
CREATE TABLE t_index_non_materialized (a UInt32) ENGINE = MergeTree ORDER BY tuple();
|
||||||
|
|
||||||
|
INSERT INTO t_index_non_materialized VALUES (1);
|
||||||
|
|
||||||
|
ALTER TABLE t_index_non_materialized ADD INDEX ind (a) TYPE set(1) GRANULARITY 1;
|
||||||
|
|
||||||
|
SELECT count() FROM t_index_non_materialized WHERE a = 1;
|
||||||
|
|
||||||
|
DROP TABLE t_index_non_materialized;
|
Loading…
Reference in New Issue
Block a user