Skip to content

branch-4.0: [fix](prune nested column) fix prune nested column maybe throw NullPointerException #60395#60444

Merged
yiguolei merged 1 commit intobranch-4.0from
auto-pick-60395-branch-4.0
Feb 3, 2026
Merged

branch-4.0: [fix](prune nested column) fix prune nested column maybe throw NullPointerException #60395#60444
yiguolei merged 1 commit intobranch-4.0from
auto-pick-60395-branch-4.0

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Feb 2, 2026

Cherry-picked from #60395

…interException (#60395)

fix prune nested column maybe throw NullPointerException, introduced by
#58370

```sql
select k1 as k2 -- can not find s.k2, we should replace k2 to k1
from
(
  select struct_element(s, 'k1') k1
  from tbl
)t
```

```
java.lang.NullPointerException: Cannot invoke "org.apache.doris.nereids.rules.rewrite.NestedColumnPruning$DataTypeAccessTree.setAccessByPath(java.util.List, int, org.apache.doris.thrift.TAccessPathType)" because the return value of "java.util.Map.get(Object)" is null
	at org.apache.doris.nereids.rules.rewrite.NestedColumnPruning$DataTypeAccessTree.setAccessByPath(NestedColumnPruning.java:431)
	at org.apache.doris.nereids.rules.rewrite.NestedColumnPruning.pruneDataType(NestedColumnPruning.java:128)
	at org.apache.doris.nereids.rules.rewrite.NestedColumnPruning.rewriteRoot(NestedColumnPruning.java:86)
	at org.apache.doris.nereids.jobs.rewrite.CustomRewriteJob.execute(CustomRewriteJob.java:61)
	at org.apache.doris.nereids.jobs.executor.AbstractBatchJobExecutor.execute(AbstractBatchJobExecutor.java:167)
	at org.apache.doris.nereids.jobs.executor.Rewriter.lambda$execute$23(Rewriter.java:963)
	at org.apache.doris.nereids.util.MoreFieldsThread.keepFunctionSignature(MoreFieldsThread.java:127)
	at org.apache.doris.nereids.util.MoreFieldsThread.keepFunctionSignature(MoreFieldsThread.java:116)
	at org.apache.doris.nereids.jobs.executor.Rewriter.execute(Rewriter.java:962)
	at org.apache.doris.nereids.NereidsPlanner.lambda$rewrite$5(NereidsPlanner.java:434)
	at org.apache.doris.nereids.NereidsPlanner.keepOrShowPlanProcess(NereidsPlanner.java:1109)
	at org.apache.doris.nereids.NereidsPlanner.rewrite(NereidsPlanner.java:433)
	at org.apache.doris.nereids.NereidsPlanner.planWithoutLock(NereidsPlanner.java:297)
	at org.apache.doris.nereids.NereidsPlanner.planWithLock(NereidsPlanner.java:263)
	at org.apache.doris.nereids.NereidsPlanner.plan(NereidsPlanner.java:162)
	at org.apache.doris.qe.StmtExecutor.executeByNereids(StmtExecutor.java:748)
	at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:541)
	at org.apache.doris.qe.StmtExecutor.queryRetry(StmtExecutor.java:500)
	at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:485)
	at org.apache.doris.qe.ConnectProcessor.executeQuery(ConnectProcessor.java:311)
	at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:198)
	at org.apache.doris.qe.MysqlConnectProcessor.handleQuery(MysqlConnectProcessor.java:231)
	at org.apache.doris.qe.MysqlConnectProcessor.dispatch(MysqlConnectProcessor.java:259)
	at org.apache.doris.qe.MysqlConnectProcessor.processOnce(MysqlConnectProcessor.java:403)
	at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
```
@github-actions github-actions bot requested a review from yiguolei as a code owner February 2, 2026 11:10
@Thearas
Copy link
Contributor

Thearas commented Feb 2, 2026

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring closed this Feb 2, 2026
@dataroaring dataroaring reopened this Feb 2, 2026
@Thearas
Copy link
Contributor

Thearas commented Feb 2, 2026

run buildall

@yiguolei yiguolei merged commit 811d8f1 into branch-4.0 Feb 3, 2026
26 of 29 checks passed
@github-actions github-actions bot deleted the auto-pick-60395-branch-4.0 branch February 3, 2026 02:41
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.

4 participants