mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Merge
This commit is contained in:
commit
5b5f91dbbc
@ -135,10 +135,6 @@ void ExpressionAnalyzer::analyzeAggregation()
|
||||
|
||||
const auto & col = block.getByName(column_name);
|
||||
|
||||
/// constant expressions have non-null column pointer at this stage
|
||||
if (const auto is_constexpr = col.column)
|
||||
continue;
|
||||
|
||||
NameAndTypePair key{column_name, col.type};
|
||||
aggregation_keys.push_back(key);
|
||||
|
||||
@ -449,7 +445,7 @@ void ExpressionAnalyzer::eliminateInjectives()
|
||||
group_exprs.pop_back();
|
||||
};
|
||||
|
||||
/// iterate each GROUP BY expression, eliminate injective function calls and literals
|
||||
/// iterate over each GROUP BY expression, eliminate injective function calls and literals
|
||||
for (size_t i = 0; i < group_exprs.size(); ++i)
|
||||
{
|
||||
if (const auto function = typeid_cast<ASTFunction*>(group_exprs[i].get()))
|
||||
@ -473,11 +469,6 @@ void ExpressionAnalyzer::eliminateInjectives()
|
||||
std::back_inserter(group_exprs), is_literal
|
||||
);
|
||||
}
|
||||
else if (is_literal(group_exprs[i]))
|
||||
{
|
||||
remove_expr_at_index(i);
|
||||
i -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,22 +13,34 @@ if [ -t 1 ]; then # stdout - терминал.
|
||||
COLOR_FAIL="\033[1;31m"
|
||||
COLOR_UNKNOWN="\033[1;30m"
|
||||
COLOR_OK="\033[1;32m"
|
||||
COLOR_SKIPPED="\033[1;34m"
|
||||
else
|
||||
COLOR_RESET=""
|
||||
COLOR_WHITE=""
|
||||
COLOR_FAIL=""
|
||||
COLOR_UNKNOWN=""
|
||||
COLOR_OK=""
|
||||
COLOR_SKIPPED=""
|
||||
fi
|
||||
|
||||
MSG_FAIL="${COLOR_WHITE}[ ${COLOR_FAIL}FAIL${COLOR_WHITE} ]${COLOR_RESET}"
|
||||
MSG_UNKNOWN="${COLOR_WHITE}[ ${COLOR_UNKNOWN}UNKNOWN${COLOR_WHITE} ]${COLOR_RESET}"
|
||||
MSG_OK="${COLOR_WHITE}[ ${COLOR_OK}OK${COLOR_WHITE} ]${COLOR_RESET}"
|
||||
MSG_GENERATED="${COLOR_WHITE}[ ${COLOR_UNKNOWN}GENERATED${COLOR_WHITE} ]${COLOR_RESET}"
|
||||
MSG_SKIPPED="${COLOR_WHITE}[ ${COLOR_SKIPPED}SKIPPED${COLOR_WHITE} ]${COLOR_RESET}"
|
||||
|
||||
ERRORS=0
|
||||
|
||||
|
||||
if [ "$1" == "--zookeeper" ]; then
|
||||
ZOOKEEPER=1
|
||||
elif grep -q '<zookeeper' /etc/clickhouse-server/config-preprocessed.xml; then
|
||||
ZOOKEEPER=1
|
||||
else
|
||||
ZOOKEEPER=0
|
||||
fi
|
||||
|
||||
|
||||
if [ "$1" == "--generate" ]; then
|
||||
GENERATE=1
|
||||
shift
|
||||
@ -60,13 +72,18 @@ do
|
||||
continue
|
||||
fi
|
||||
|
||||
printf "%-60s" "$test_name: "
|
||||
|
||||
if [ $ZOOKEEPER -eq 0 ] && (echo "$test_name" | grep -q 'zookeeper'); then
|
||||
echo -e "$MSG_SKIPPED - no zookeeper"
|
||||
continue
|
||||
fi
|
||||
|
||||
result_file=$QUERIES_DIR/$dir/$test_name.result
|
||||
error_file=$QUERIES_DIR/$dir/$test_name.error
|
||||
reference_file=$QUERIES_DIR/$dir/$test_name.reference
|
||||
diff_file=$QUERIES_DIR/$dir/$test_name.diff
|
||||
|
||||
printf "%-60s" "$test_name: "
|
||||
|
||||
if [[ "$extension" == "sql" ]]; then
|
||||
$CLIENT_PROGRAM < $query_file > $result_file 2> $error_file
|
||||
ret_code=$?
|
||||
@ -97,7 +114,7 @@ do
|
||||
# надо сгенерировать эталонный результат
|
||||
if [[ $GENERATE -eq 1 && ( -z "$1" || "$@" =~ "$test_name") ]]; then
|
||||
cp $result_file $reference_file
|
||||
echo -e "$MSG_GENERATED - no reference file"
|
||||
echo -e "$MSG_GENERATED - generated reference file"
|
||||
else
|
||||
echo -e "$MSG_UNKNOWN - no reference file (use --generate [test_name]... to create)"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user