mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Merge pull request #46972 from Avogar/json-date-int-inference
Fix date and int inference from string in JSON
This commit is contained in:
commit
479cd9b90b
@ -131,6 +131,7 @@ namespace
|
||||
|
||||
type_indexes.erase(TypeIndex::Date);
|
||||
type_indexes.erase(TypeIndex::DateTime);
|
||||
type_indexes.insert(TypeIndex::String);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -173,19 +173,19 @@ void chooseResultColumnType(
|
||||
ErrorCodes::TYPE_MISMATCH,
|
||||
"Automatically defined type {} for column '{}' in row {} differs from type defined by previous rows: {}. "
|
||||
"You can specify the type for this column using setting schema_inference_hints",
|
||||
type->getName(),
|
||||
new_type->getName(),
|
||||
column_name,
|
||||
row,
|
||||
new_type->getName());
|
||||
type->getName());
|
||||
else
|
||||
throw Exception(
|
||||
ErrorCodes::TYPE_MISMATCH,
|
||||
"Automatically defined type {} for column '{}' in row {} differs from type defined by previous rows: {}. "
|
||||
"Column types from setting schema_inference_hints couldn't be parsed because of error: {}",
|
||||
type->getName(),
|
||||
new_type->getName(),
|
||||
column_name,
|
||||
row,
|
||||
new_type->getName(),
|
||||
type->getName(),
|
||||
hints_parsing_error);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1 @@
|
||||
x Nullable(String)
|
@ -0,0 +1,2 @@
|
||||
desc format(JSONEachRow, '{"x" : "2020-01-01"}, {"x" : "1000"}')
|
||||
|
Loading…
Reference in New Issue
Block a user