Skip to content

feat: support automatic schema creation in Session - #18890

Merged
JackieTien97 merged 2 commits into
apache:masterfrom
shizy818:enable_auto_create_schema
Oct 16, 2026
Merged

JackieTien97 merged 2 commits into
apache:masterfrom
shizy818:enable_auto_create_schema

Conversation

@shizy818

@shizy818 shizy818 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds a session-level switch, enableAutoCreateSchema, to Session.Builder, TableSessionBuilder, and TableSessionPoolBuilder. The option defaults to true for backward compatibility and is propagated to the server during session establishment. During table schema validation, automatic table and column creation is allowed only when both the server-level configuration and the session-level option are enabled. Integration tests cover writes to missing tables and columns when automatic schema creation is disabled.

enableAutoCreateSchema is intentionally not included in SessionInfo serialization or deserialization. The option is only consumed during coordinator-side schema validation, before fragment instances or schema plan nodes are dispatched to other nodes, so remote execution does not require it. Keeping the existing serialization layout also avoids changing the internal wire format, which could cause field misalignment and compatibility issues during rolling upgrades in a mixed-version cluster. Deserialized SessionInfo instances therefore retain the default value of true, which does not affect execution because schema auto-creation decisions have already been completed on the coordinator.

Content1 ...

Content2 ...

Content3 ...


This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

@shizy818
shizy818 force-pushed the enable_auto_create_schema branch from 6bc217d to 4a69937 Compare October 16, 2026 00:26
@JackieTien97
JackieTien97 merged commit 4e9679d into apache:master Oct 16, 2026
38 of 39 checks passed
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.

2 participants