fixes, going to reorganize ExpressionActions::Action::array_joined_columns [#CONV-7967]

This commit is contained in:
Vyacheslav Alipov 2013-08-01 15:06:41 +00:00
parent 371c8ce796
commit f81a5d0d85
2 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -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));