Remove the kql table function by alexey-milovidov · Pull Request #105101 · ClickHouse/ClickHouse · GitHub
Skip to content

Remove the kql table function#105101

Merged
alexey-milovidov merged 2 commits into
masterfrom
remove-kql-table-function
May 17, 2026
Merged

Remove the kql table function#105101
alexey-milovidov merged 2 commits into
masterfrom
remove-kql-table-function

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented May 16, 2026

Copy link
Copy Markdown
Member

The kql(...) table function was a low-quality bolted-on feature that hijacked function parsing in ExpressionListParsers.cpp and rewrote itself into a view(...) call. It is removed entirely. The KQL dialect (SET dialect = 'kusto') remains supported.

The internal ParserKQLTableFunction class — which is still needed by the KQL dialect to parse parenthesized KQL subqueries (e.g. inside the in operator) — is renamed to ParserKQLParenExpression to reflect what it actually does now.

Changelog category (leave one):

  • Backward Incompatible Change

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Removed the kql table function. Use SET dialect = 'kusto' to run queries in the KQL dialect.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.5.1.725

The `kql(...)` table function was a low-quality bolted-on feature that
hijacked function parsing in `ExpressionListParsers.cpp` and rewrote
itself into a `view(...)` call. It is removed entirely. The KQL dialect
(`SET dialect = 'kusto'`) remains supported.

The internal `ParserKQLTableFunction` class — which is still needed by
the KQL dialect to parse parenthesized KQL subqueries (e.g. inside the
`in` operator) — is renamed to `ParserKQLParenExpression` to reflect
what it actually does now.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@clickhouse-gh

clickhouse-gh Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

@clickhouse-gh clickhouse-gh Bot added the pr-backward-incompatible Pull request with backwards incompatible changes label May 16, 2026
return std::make_unique<ViewLayer>(true);
if (function_name_lowercase == "kql")
return std::make_unique<KustoLayer>();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes the kql table-function hook, but both direct kql(...) stateless tests are deleted in this PR and there is no replacement that asserts the new contract.

Please add a focused negative stateless test (for example, SELECT * FROM kql(...)) that verifies we now return UNKNOWN_TABLE_FUNCTION. For a backward-incompatible removal, that regression coverage is important so this behavior does not silently come back.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still missing in the current diff: both former kql(...) stateless tests were deleted and there is no replacement check that asserts the new contract (kql(...) must fail with UNKNOWN_TABLE_FUNCTION).

For a backward-incompatible removal, please add a focused negative stateless test (for example SELECT * FROM kql('x')) with serverError UNKNOWN_TABLE_FUNCTION so this behavior cannot be reintroduced silently.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai, the following CI failures on this PR are unrelated to the change (removal of the kql table function — only src/Parsers/ExpressionListParsers.cpp, src/Parsers/Kusto/* and KQL stateless tests are touched). Please investigate and fix in separate PRs.

  1. Unit tests (asan_ubsan, function_prop_fuzzer)FunctionsStress.stress

  2. Unit tests (asan_ubsan, function_prop_fuzzer)AllTests

    • Same fuzzer run, same report; auto-rolled into the umbrella issue.
    • Tracked by: AllTests #105040
  3. CH Inc sync

    • Caused by Build (arm_tidy) failing in the sync PR ClickHouse/clickhouse-private#58151 with error: nested redundant #if; consider removing it in src/Processors/QueryPlan/ReadFromMergeTree.cpp:4627 and :4707. The public file is 4530 lines long and the public Build (arm_tidy) job is green on this PR, so the failure is in private-only code, not caused by this change.

@groeneai

Copy link
Copy Markdown
Contributor

Thanks @alexey-milovidov — all three failures confirmed unrelated to this PR (KQL parser removal). Status of each:

1. FunctionsStress.stressarrayResize 79s timeout on max_execution_time=15s
Tracked under chronic umbrella #104877 (FunctionsStress.stress, OPEN, labels testing/fuzz). The arrayResize(Array(Map(Int256, Float64)), Int256) shape is one of several non-determinism shapes in this family (indexOf, nullIf, caseWithExpression, if, etc.). No fix is in flight specifically for arrayResize yet — the family is being addressed piecewise as individual shapes get reproducers (#104804, #104858, #104989, #104992 have all landed for sibling shapes).

2. AllTestsfunction_prop_fuzzer roll-up
Tracked under #105040 (AllTests, OPEN, labels testing/fuzz). Auto-rolled from the same fuzzer run as (1).

3. CH Inc syncBuild (arm_tidy) nested redundant #if at ReadFromMergeTree.cpp:4627/:4707
Confirmed not actionable from the public repo. The public file is 4530 lines and public Build (arm_tidy) is green on this PR — the failure is in private-only code in ClickHouse/clickhouse-private#58151. Deferred to private CI ownership.

This PR is safe to merge as soon as the rest of CI completes.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai, please focus on "FunctionsStress.stress — arrayResize 79s timeout on max_execution_time=15s" - find a way to guard/limit these heavy invocations in the implementation and send a PR.

@clickhouse-gh

clickhouse-gh Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.20% +0.10%
Functions 91.40% 91.40% +0.00%
Branches 76.50% 76.60% +0.10%

Changed lines: 100.00% (20/20) | lost baseline coverage: 2 line(s) · Uncovered code

Full report · Diff report

@groeneai

Copy link
Copy Markdown
Contributor

@alexey-milovidov alexey-milovidov self-assigned this May 17, 2026
@alexey-milovidov alexey-milovidov merged commit 259dd37 into master May 17, 2026
166 of 167 checks passed
@alexey-milovidov alexey-milovidov deleted the remove-kql-table-function branch May 17, 2026 23:16
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backward-incompatible Pull request with backwards incompatible changes pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants