Skip to content

[KIKIMR-21472] Output the final AST in explain query #6487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ydb/core/kqp/host/kqp_explain_prepared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class TKqpExplainPreparedTransformer : public NYql::TGraphTransformerBase {

PhyQuerySetTxPlans(query, TKqpPhysicalQuery(TransformCtx->ExplainTransformerInput), std::move(TxResults),
ctx, Cluster, TransformCtx->Tables, TransformCtx->Config, TypeCtx, OptimizeCtx);
query.SetQueryAst(KqpExprToPrettyString(*TransformCtx->ExplainTransformerInput, ctx));
query.SetQueryAst(KqpExprToPrettyString(*input, ctx));

TransformCtx->ExplainTransformerInput = nullptr;
return TStatus::Ok;
Expand Down
10 changes: 3 additions & 7 deletions ydb/core/kqp/ut/olap/helpers/aggregation.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,7 @@ class TAggregationTestCase {
bool UseLlvm = true;
public:
void FillExpectedAggregationGroupByPlanOptions() {
#if SSA_RUNTIME_VERSION >= 2U
// AddExpectedPlanOptions("TKqpOlapAgg");
AddExpectedPlanOptions("WideCombiner");
#else
AddExpectedPlanOptions("CombineCore");
#endif
}
TString GetFixedQuery() const {
TStringBuilder queryFixed;
Expand Down Expand Up @@ -177,7 +172,8 @@ void CheckPlanForAggregatePushdown(
const TString& query,
TClient& client,
const std::vector<std::string>& expectedPlanNodes,
const std::string& readNodeType) {
const std::string& readNodeType)
{
auto res = StreamExplainQuery(query, client);
UNIT_ASSERT_C(res.IsSuccess(), res.GetIssues().ToString());

Expand Down Expand Up @@ -242,4 +238,4 @@ void WriteTestDataForTableWithNulls(TKikimrRunner& kikimr, TString testTable);

void TestTableWithNulls(const std::vector<TAggregationTestCase>& cases, const bool genericQuery = false);

}
}
6 changes: 3 additions & 3 deletions ydb/core/kqp/ut/olap/kqp_olap_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2486,7 +2486,7 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
UNIT_ASSERT_C(result.GetStatus() == NYdb::EStatus::SUCCESS, result.GetIssues().ToString());

auto client = kikimr.GetQueryClient();
{
{
auto prepareResult = client.ExecuteQuery(R"(
REPLACE INTO `/Root/ColumnShard` (a, b, c) VALUES
(1u, 1, 5),
Expand Down Expand Up @@ -2516,15 +2516,15 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
UNIT_ASSERT_C(plan.QueryStats->Getquery_ast().Contains("return (FromFlow (NarrowMap (WideFromBlocks"), plan.QueryStats->Getquery_ast());
break;
case NKikimrConfig::TTableServiceConfig_EBlockChannelsMode_BLOCK_CHANNELS_AUTO:
UNIT_ASSERT_C(plan.QueryStats->Getquery_ast().Contains("return (FromFlow (ExpandMap (NarrowMap (WideFromBlocks"), plan.QueryStats->Getquery_ast());
UNIT_ASSERT_C(plan.QueryStats->Getquery_ast().Contains("return (FromFlow (WideFromBlocks"), plan.QueryStats->Getquery_ast());
break;
case NKikimrConfig::TTableServiceConfig_EBlockChannelsMode_BLOCK_CHANNELS_FORCE:
UNIT_ASSERT_C(plan.QueryStats->Getquery_ast().Contains("return (FromFlow (WideMap"), plan.QueryStats->Getquery_ast());
break;
}
}

{
{
auto it = client.StreamExecuteQuery(R"(
SELECT
b, COUNT(*), SUM(a)
Expand Down
Loading