mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-22 17:50:47 +00:00
fixes, going to reorganize ExpressionActions::Action::array_joined_columns [#CONV-7967]
This commit is contained in:
parent
371c8ce796
commit
f81a5d0d85
@ -30,17 +30,17 @@ bool ExpressionActions::Action::isArrayJoinedColumnName(const String & name) con
|
||||
{
|
||||
std::string nested_table = DataTypeNested::extractNestedTableName(name);
|
||||
std::string nested_column = DataTypeNested::extractNestedColumnName(name);
|
||||
return nested_column == nested_table_alias || (nested_table == nested_table_alias && array_joined_columns.count(nested_column));
|
||||
return name == nested_table_alias || (nested_table == nested_table_alias && array_joined_columns.count(nested_column));
|
||||
}
|
||||
|
||||
String ExpressionActions::Action::getOriginalNestedName(const String & name) const
|
||||
{
|
||||
if (name == nested_table_alias)
|
||||
return nested_table_name;
|
||||
|
||||
std::string nested_table = DataTypeNested::extractNestedTableName(name);
|
||||
std::string nested_column = DataTypeNested::extractNestedColumnName(name);
|
||||
|
||||
if (nested_column == nested_table_alias)
|
||||
return nested_table_name;
|
||||
|
||||
if (nested_table == nested_table_alias && array_joined_columns.count(nested_column))
|
||||
return DataTypeNested::concatenateNestedName(nested_table_name, nested_column);
|
||||
|
||||
|
@ -603,11 +603,11 @@ void ExpressionAnalyzer::addMultipleArrayJoinAction(ExpressionActions & actions)
|
||||
{
|
||||
String nested_table = DataTypeNested::extractNestedTableName(*it);
|
||||
String nested_column = DataTypeNested::extractNestedColumnName(*it);
|
||||
|
||||
if (nested_column == nested_table_name || (nested_table == nested_table_name && array_joined_columns.count(nested_column)))
|
||||
|
||||
if (*it == nested_table_name || nested_table == nested_table_name)
|
||||
{
|
||||
added_columns = true;
|
||||
String array_joined_name = nested_column == nested_table_name
|
||||
String array_joined_name = *it == nested_table_name
|
||||
? nested_table_alias
|
||||
: DataTypeNested::concatenateNestedName(nested_table_alias, nested_column);
|
||||
actions.add(ExpressionActions::Action::copyColumn(*it, array_joined_name));
|
||||
|
Loading…
Reference in New Issue
Block a user