Skip to content

Fix semantic error for unsupported table INSERT time expressions - #18759

Merged
jt2594838 merged 2 commits into
apache:masterfrom
hongzhi-gao:fix/table-insert-time-expression-semantic-error
Sep 30, 2026
Merged

jt2594838 merged 2 commits into
apache:masterfrom
hongzhi-gao:fix/table-insert-time-expression-semantic-error

Conversation

@hongzhi-gao

Copy link
Copy Markdown
Contributor

Description

Fix table INSERT statements that use unsupported time expressions. They now return a semantic error instead of exposing a ClassCastException. Valid
timestamps and NULL keep their existing behavior.

The parser now uses the existing AstUtil.expressionToTimestamp method, so both insert paths apply the same validation. Integration tests cover supported
values, unsupported expressions, and prepared statements.

Validation: Spotless passed; Maven test-compile passed for all 39 modules. Integration tests were added but not run.

This PR has:

  • been self-reviewed.
  • added integration tests.
Key changed/added classes
  • AstBuilder: delegates timestamp conversion to AstUtil.
  • IoTDBInsertTableIT: covers supported and unsupported time values.
  • IoTDBTablePreparedStatementIT: covers rejected time parameters.

@Caideyipi Caideyipi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the current head. No code issues found. The PR description still says the tests cover prepared statements, but that test was removed in the latest commit; please update the description to match the final diff.

@jt2594838
jt2594838 merged commit 166883a into apache:master Sep 30, 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.

3 participants