Skip to content

Fix CTE materialization state isolation#18186

Open
JackieTien97 wants to merge 1 commit into
apache:masterfrom
JackieTien97:codex/fix-cte-materialization-state
Open

Fix CTE materialization state isolation#18186
JackieTien97 wants to merge 1 commit into
apache:masterfrom
JackieTien97:codex/fix-cte-materialization-state

Conversation

@JackieTien97

Copy link
Copy Markdown
Contributor

Summary

  • move CTE materialization results from the reusable Query AST to an execution-local context
  • share materialized data only among inner queries of the same top-level execution
  • preserve one-time materialization for repeated references while allowing independent EXECUTE commands to materialize independently
  • clear execution-local CTE state before a top-level retry

Tests

  • mvn test-compile -pl iotdb-core/datanode -am -DskipTests
  • mvn test -pl iotdb-core/datanode -am -Dtest=CteMaterializerStateTest -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false
  • mvn test -pl iotdb-core/datanode -am -Dtest=CteMaterializerTest,CteSubqueryTest -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false
  • mvn spotless:check -pl iotdb-core/datanode -am

@JackieTien97 JackieTien97 marked this pull request as ready for review July 11, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant