Fix NPE in table model export when -q is not specified#17462
Merged
CritasWang merged 1 commit intomasterfrom Apr 13, 2026
Merged
Fix NPE in table model export when -q is not specified#17462CritasWang merged 1 commit intomasterfrom
CritasWang merged 1 commit intomasterfrom
Conversation
When using export-data with table model (sql_dialect=table) and only
specifying -db without -q, queryCommand is null. The original condition
`sqlDialectTree && queryCommand == null` only handled the tree model
case, causing the else branch to call `queryCommand.trim().split(";")`
which throws NullPointerException.
Restructure the branch logic to check `queryCommand == null` first:
- Tree model + no query: interactive SQL input (unchanged)
- Table model + no query: call exportBySql(null, 0) to auto-generate
"select * from <table>" for all tables, which also correctly applies
start_time/end_time filters
- Query provided: split by semicolon for multi-statement support (unchanged)
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #17462 +/- ##
=========================================
Coverage 39.82% 39.83%
Complexity 312 312
=========================================
Files 5135 5135
Lines 347073 347075 +2
Branches 44220 44221 +1
=========================================
+ Hits 138221 138252 +31
+ Misses 208852 208823 -29 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
HTHou
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



When using export-data with table model (sql_dialect=table) and only
specifying -db without -q, queryCommand is null. The original condition
sqlDialectTree && queryCommand == nullonly handled the tree modelcase, causing the else branch to call
queryCommand.trim().split(";")which throws NullPointerException.
Restructure the branch logic to check
queryCommand == nullfirst: