mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Merge pull request #44342 from ClickHouse/add-test-29883
Add a test for #29883
This commit is contained in:
commit
1b21cc018e
1
programs/server/config.d/graphite.xml
Symbolic link
1
programs/server/config.d/graphite.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../../../tests/config/config.d/graphite.xml
|
@ -332,8 +332,7 @@ std::string buildTaggedRegex(std::string regexp_str)
|
||||
* </default>
|
||||
* </graphite_rollup>
|
||||
*/
|
||||
static const Pattern &
|
||||
appendGraphitePattern(
|
||||
static const Pattern & appendGraphitePattern(
|
||||
const Poco::Util::AbstractConfiguration & config,
|
||||
const String & config_element, Patterns & patterns,
|
||||
bool default_rule,
|
||||
|
@ -9,6 +9,12 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int BAD_ARGUMENTS;
|
||||
}
|
||||
|
||||
|
||||
static GraphiteRollupSortedAlgorithm::ColumnsDefinition defineColumns(
|
||||
const Block & header, const Graphite::Params & params)
|
||||
{
|
||||
@ -26,6 +32,9 @@ static GraphiteRollupSortedAlgorithm::ColumnsDefinition defineColumns(
|
||||
if (i != def.time_column_num && i != def.value_column_num && i != def.version_column_num)
|
||||
def.unmodified_column_numbers.push_back(i);
|
||||
|
||||
if (!WhichDataType(header.getByPosition(def.value_column_num).type).isFloat64())
|
||||
throw Exception("Only `Float64` data type is allowed for the value column of GraphiteMergeTree", ErrorCodes::BAD_ARGUMENTS);
|
||||
|
||||
return def;
|
||||
}
|
||||
|
||||
|
@ -476,7 +476,7 @@ static StoragePtr create(const StorageFactory::Arguments & args)
|
||||
{
|
||||
String graphite_config_name;
|
||||
String error_msg
|
||||
= "Last parameter of GraphiteMergeTree must be name (in single quotes) of element in configuration file with Graphite options";
|
||||
= "Last parameter of GraphiteMergeTree must be the name (in single quotes) of the element in configuration file with the Graphite options";
|
||||
error_msg += getMergeTreeVerboseHelp(is_extended_storage_def);
|
||||
|
||||
if (const auto * ast = engine_args[arg_cnt - 1]->as<ASTLiteral>())
|
||||
|
6
tests/queries/0_stateless/02508_bad_graphite.sql
Normal file
6
tests/queries/0_stateless/02508_bad_graphite.sql
Normal file
@ -0,0 +1,6 @@
|
||||
DROP TABLE IF EXISTS test_graphite;
|
||||
create table test_graphite (key UInt32, Path String, Time DateTime('UTC'), Value UInt8, Version UInt32, col UInt64)
|
||||
engine = GraphiteMergeTree('graphite_rollup') order by key;
|
||||
|
||||
INSERT INTO test_graphite (key) VALUES (0); -- { serverError BAD_ARGUMENTS }
|
||||
DROP TABLE test_graphite;
|
Loading…
Reference in New Issue
Block a user