mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Rename statistics of type count_min to countmin
This commit is contained in:
parent
26f21a0d94
commit
eb800d9e39
@ -1003,16 +1003,16 @@ They can be used for prewhere optimization only if we enable `set allow_statisti
|
|||||||
|
|
||||||
[HyperLogLog](https://en.wikipedia.org/wiki/HyperLogLog) sketches which provide an estimation how many distinct values a column contains.
|
[HyperLogLog](https://en.wikipedia.org/wiki/HyperLogLog) sketches which provide an estimation how many distinct values a column contains.
|
||||||
|
|
||||||
- `count_min`
|
- `CountMin`
|
||||||
|
|
||||||
[Count-min](https://en.wikipedia.org/wiki/Count%E2%80%93min_sketch) sketches which provide an approximate count of the frequency of each value in a column.
|
[CountMin](https://en.wikipedia.org/wiki/Count%E2%80%93min_sketch) sketches which provide an approximate count of the frequency of each value in a column.
|
||||||
|
|
||||||
|
|
||||||
### Supported Data Types {#supported-data-types}
|
### Supported Data Types {#supported-data-types}
|
||||||
|
|
||||||
| | (U)Int* | Float* | Decimal(*) | Date* | Boolean | Enum* | (Fixed)String |
|
| | (U)Int* | Float* | Decimal(*) | Date* | Boolean | Enum* | (Fixed)String |
|
||||||
|-----------|---------|--------|------------|-------|---------|-------|------------------|
|
|-----------|---------|--------|------------|-------|---------|-------|------------------|
|
||||||
| count_min | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
|
| CountMin | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
|
||||||
| MinMax | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✗ |
|
| MinMax | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✗ |
|
||||||
| TDigest | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✗ |
|
| TDigest | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✗ |
|
||||||
| Uniq | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
|
| Uniq | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
|
||||||
@ -1022,7 +1022,7 @@ They can be used for prewhere optimization only if we enable `set allow_statisti
|
|||||||
|
|
||||||
| | Equality filters (==) | Range filters (>, >=, <, <=) |
|
| | Equality filters (==) | Range filters (>, >=, <, <=) |
|
||||||
|-----------|-----------------------|------------------------------|
|
|-----------|-----------------------|------------------------------|
|
||||||
| count_min | ✔ | ✗ |
|
| CountMin | ✔ | ✗ |
|
||||||
| MinMax | ✗ | ✔ |
|
| MinMax | ✗ | ✔ |
|
||||||
| TDigest | ✗ | ✔ |
|
| TDigest | ✗ | ✔ |
|
||||||
| Uniq | ✔ | ✗ |
|
| Uniq | ✔ | ✗ |
|
||||||
|
@ -248,7 +248,7 @@ ColumnStatisticsPtr MergeTreeStatisticsFactory::get(const ColumnDescription & co
|
|||||||
{
|
{
|
||||||
auto it = creators.find(type);
|
auto it = creators.find(type);
|
||||||
if (it == creators.end())
|
if (it == creators.end())
|
||||||
throw Exception(ErrorCodes::INCORRECT_QUERY, "Unknown statistic type '{}'. Available types: 'count_min', 'minmax', 'tdigest' and 'uniq'", type);
|
throw Exception(ErrorCodes::INCORRECT_QUERY, "Unknown statistic type '{}'. Available types: 'countmin', 'minmax', 'tdigest' and 'uniq'", type);
|
||||||
auto stat_ptr = (it->second)(desc, column_desc.type);
|
auto stat_ptr = (it->second)(desc, column_desc.type);
|
||||||
column_stat->stats[type] = stat_ptr;
|
column_stat->stats[type] = stat_ptr;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ Float64 StatisticsCountMinSketch::estimateEqual(const Field & val) const
|
|||||||
if (isStringOrFixedString(data_type))
|
if (isStringOrFixedString(data_type))
|
||||||
return sketch.get_estimate(val.safeGet<String>());
|
return sketch.get_estimate(val.safeGet<String>());
|
||||||
|
|
||||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Statistics 'count_min' does not support estimate data type of {}", data_type->getName());
|
throw Exception(ErrorCodes::LOGICAL_ERROR, "Statistics 'countmin' does not support estimate data type of {}", data_type->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatisticsCountMinSketch::update(const ColumnPtr & column)
|
void StatisticsCountMinSketch::update(const ColumnPtr & column)
|
||||||
@ -88,7 +88,7 @@ void countMinSketchStatisticsValidator(const SingleStatisticsDescription & /*des
|
|||||||
DataTypePtr inner_data_type = removeNullable(data_type);
|
DataTypePtr inner_data_type = removeNullable(data_type);
|
||||||
inner_data_type = removeLowCardinalityAndNullable(inner_data_type);
|
inner_data_type = removeLowCardinalityAndNullable(inner_data_type);
|
||||||
if (!inner_data_type->isValueRepresentedByNumber() && !isStringOrFixedString(inner_data_type))
|
if (!inner_data_type->isValueRepresentedByNumber() && !isStringOrFixedString(inner_data_type))
|
||||||
throw Exception(ErrorCodes::ILLEGAL_STATISTICS, "Statistics of type 'count_min' does not support type {}", data_type->getName());
|
throw Exception(ErrorCodes::ILLEGAL_STATISTICS, "Statistics of type 'countmin' does not support type {}", data_type->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
StatisticsPtr countMinSketchStatisticsCreator(const SingleStatisticsDescription & description, const DataTypePtr & data_type)
|
StatisticsPtr countMinSketchStatisticsCreator(const SingleStatisticsDescription & description, const DataTypePtr & data_type)
|
||||||
|
@ -48,11 +48,11 @@ static StatisticsType stringToStatisticsType(String type)
|
|||||||
return StatisticsType::TDigest;
|
return StatisticsType::TDigest;
|
||||||
if (type == "uniq")
|
if (type == "uniq")
|
||||||
return StatisticsType::Uniq;
|
return StatisticsType::Uniq;
|
||||||
if (type == "count_min")
|
if (type == "countmin")
|
||||||
return StatisticsType::CountMinSketch;
|
return StatisticsType::CountMinSketch;
|
||||||
if (type == "minmax")
|
if (type == "minmax")
|
||||||
return StatisticsType::MinMax;
|
return StatisticsType::MinMax;
|
||||||
throw Exception(ErrorCodes::INCORRECT_QUERY, "Unknown statistics type: {}. Supported statistics types are 'count_min', 'minmax', 'tdigest' and 'uniq'.", type);
|
throw Exception(ErrorCodes::INCORRECT_QUERY, "Unknown statistics type: {}. Supported statistics types are 'countmin', 'minmax', 'tdigest' and 'uniq'.", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
String SingleStatisticsDescription::getTypeName() const
|
String SingleStatisticsDescription::getTypeName() const
|
||||||
@ -64,11 +64,11 @@ String SingleStatisticsDescription::getTypeName() const
|
|||||||
case StatisticsType::Uniq:
|
case StatisticsType::Uniq:
|
||||||
return "Uniq";
|
return "Uniq";
|
||||||
case StatisticsType::CountMinSketch:
|
case StatisticsType::CountMinSketch:
|
||||||
return "count_min";
|
return "countmin";
|
||||||
case StatisticsType::MinMax:
|
case StatisticsType::MinMax:
|
||||||
return "minmax";
|
return "minmax";
|
||||||
default:
|
default:
|
||||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Unknown statistics type: {}. Supported statistics types are 'count_min', 'minmax', 'tdigest' and 'uniq'.", type);
|
throw Exception(ErrorCodes::LOGICAL_ERROR, "Unknown statistics type: {}. Supported statistics types are 'countmin', 'minmax', 'tdigest' and 'uniq'.", type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user