Skip to content

fix(sql): fix EXPLAIN UPDATE resulting in error#6588

Merged
bluestreak01 merged 1 commit intomasterfrom
vi_fix_expl
Jan 2, 2026
Merged

fix(sql): fix EXPLAIN UPDATE resulting in error#6588
bluestreak01 merged 1 commit intomasterfrom
vi_fix_expl

Conversation

@bluestreak01
Copy link
Copy Markdown
Member

@bluestreak01 bluestreak01 commented Jan 2, 2026

Summary

Fixes #6194

EXPLAIN UPDATE on WAL tables was throwing UnsupportedOperationException because the anonymous RecordCursorFactory created during WAL serialization phase did not implement getCursor().

Changes

  • Modified EmptyTableRecordCursorFactory to accept an optional TableToken for proper supportsUpdateRowId() checks
  • Replaced the anonymous factory in SqlCodeGenerator.generateTableQuery0() with EmptyTableRecordCursorFactory
  • Updated toPlan() to show the table name when available (e.g., on: trades)
  • Added regression test testExplainUpdateWalTable

Test plan

  • ExplainPlanTest#testExplainUpdateWalTable - reproduces the issue from EXPLAIN is broken for some cases #6194
  • All ExplainPlanTest tests pass (515 tests)
  • SqlCodeGeneratorTest and UpdateTest pass

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 2, 2026

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bluestreak01 bluestreak01 changed the title fix(sql): fix explain update fix(sql): fix EXPLAIN UPDATE on WAL tables throwing UnsupportedOperationException Jan 2, 2026
@bluestreak01 bluestreak01 changed the title fix(sql): fix EXPLAIN UPDATE on WAL tables throwing UnsupportedOperationException fix(sql): fix EXPLAIN UPDATE resulting in error Jan 2, 2026
@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 8 / 8 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/griffin/SqlCodeGenerator.java 1 1 100.00%
🔵 io/questdb/griffin/engine/EmptyTableRecordCursorFactory.java 7 7 100.00%

@bluestreak01 bluestreak01 merged commit b842331 into master Jan 2, 2026
45 checks passed
@bluestreak01 bluestreak01 deleted the vi_fix_expl branch January 2, 2026 12:38
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.

EXPLAIN is broken for some cases

4 participants