Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(sql): support UDF expressions in DML#19804

Merged
KKould merged 3 commits into
databendlabs:mainfrom
KKould:fix/issue-18492-dml-udf
May 6, 2026
Merged

feat(sql): support UDF expressions in DML#19804
KKould merged 3 commits into
databendlabs:mainfrom
KKould:fix/issue-18492-dml-udf

Conversation

@KKould
Copy link
Copy Markdown
Member

@KKould KKould commented May 6, 2026

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  • fixes: Feature: Fully support UDF expression in DML #18492
  • Support UDF expressions in DML mutation expression positions evaluated after mutation input is produced: UPDATE/DELETE filters, MERGE matched and unmatched clause conditions, and MERGE unmatched insert values.
  • Rewrite UDF calls inside MERGE unmatched evaluators into derived UDF columns before mutation evaluation.
  • Keep MERGE ON UDF expressions out of this PR because they depend on the shared Join UDF rewrite path and should be discussed separately.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Ran locally:

  • cargo fmt --all
  • git diff --check
  • cargo test -p databend-common-sql --test it semantic::binder -- --nocapture
  • cargo build --bin=databend-query --bin=databend-meta --bin=databend-sqllogictests
  • TEST_HANDLERS=http,hybrid TEST_PARALLEL=1 bash ./scripts/ci/ci-run-sqllogic-tests.sh udf_server
  • TEST_HANDLERS=http,hybrid TEST_PARALLEL=1 TEST_EXT_ARGS='--skip_file tpcds_spill_1.test,tpcds_spill_2.test,tpcds_spill_3.test' bash ./scripts/ci/ci-run-sqllogic-tests-native.sh udf_server

Added/updated coverage:

  • Binder golden tests for UDF expressions in UPDATE/DELETE filters and MERGE matched/unmatched evaluators.
  • UDF server sqllogictest cases for UPDATE, DELETE, and MERGE runtime paths.

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions Bot added the pr-feature this PR introduces a new feature to the codebase label May 6, 2026
@KKould KKould requested a review from SkyFan2002 May 6, 2026 02:55
@KKould KKould self-assigned this May 6, 2026
@KKould KKould added this pull request to the merge queue May 6, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 6, 2026
@KKould KKould added this pull request to the merge queue May 6, 2026
Merged via the queue into databendlabs:main with commit 424e4d2 May 6, 2026
91 checks passed
@KKould KKould deleted the fix/issue-18492-dml-udf branch May 6, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Fully support UDF expression in DML

2 participants