mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
fix build
This commit is contained in:
parent
b12bf5758e
commit
445d750938
@ -116,10 +116,10 @@ namespace
|
||||
if (name == identifier->name)
|
||||
{
|
||||
ColumnWithTypeAndName column;
|
||||
Field value = convertFieldToType(literal->value, *type);
|
||||
if (!literal->value.isNull() && value.isNull())
|
||||
Field converted = convertFieldToType(value, *type);
|
||||
if (converted.isNull())
|
||||
return {};
|
||||
column.column = type->createColumnConst(1, value);
|
||||
column.column = type->createColumnConst(1, converted);
|
||||
column.name = name;
|
||||
column.type = type;
|
||||
return {{std::move(column)}};
|
||||
|
@ -17,13 +17,13 @@ void ASTLiteral::updateTreeHashImpl(SipHash & hash_state) const
|
||||
void ASTLiteral::appendColumnNameImpl(WriteBuffer & ostr) const
|
||||
{
|
||||
/// 100 - just arbitrary value.
|
||||
constexpr auto MIN_ELEMENTS_FOR_HASHING = 100;
|
||||
constexpr auto min_elements_for_hashing = 100;
|
||||
|
||||
/// Special case for very large arrays and tuples. Instead of listing all elements, will use hash of them.
|
||||
/// (Otherwise column name will be too long, that will lead to significant slowdown of expression analysis.)
|
||||
auto type = value.getType();
|
||||
if ((type == Field::Types::Array && value.get<const Array &>().size() > MIN_ELEMENTS_FOR_HASHING)
|
||||
|| (type == Field::Types::Tuple && value.get<const Tuple &>().size() > MIN_ELEMENTS_FOR_HASHING))
|
||||
if ((type == Field::Types::Array && value.get<const Array &>().size() > min_elements_for_hashing)
|
||||
|| (type == Field::Types::Tuple && value.get<const Tuple &>().size() > min_elements_for_hashing))
|
||||
{
|
||||
SipHash hash;
|
||||
applyVisitor(FieldVisitorHash(hash), value);
|
||||
|
Loading…
Reference in New Issue
Block a user