Skip to content

Conversation

@sollhui
Copy link
Contributor

@sollhui sollhui commented Sep 28, 2025

What problem does this PR solve?

introduced by #47194

Copy into with no where expression:

copy into customer from @test_tpch('tpch/sf1/customer.csv.split00.gz') properties ('file.compression' = 'gz', 'copy.async' = 'false');

It will fail:

org.apache.doris.common.NereidsException: errCode = 2, detailMessage = Cannot invoke "java.util.Optional.isPresent()" because the return value of "org.apache.doris.nereids.trees.plans.commands.info.
CopyFromDesc.getFileFilterExpr()" is null
       at org.apache.doris.qe.StmtExecutor.executeByNereids(StmtExecutor.java:694) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:535) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.qe.StmtExecutor.queryRetry(StmtExecutor.java:497) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:482) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.qe.ConnectProcessor.executeQuery(ConnectProcessor.java:358) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:249) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.qe.MysqlConnectProcessor.handleQuery(MysqlConnectProcessor.java:233) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.qe.MysqlConnectProcessor.dispatch(MysqlConnectProcessor.java:261) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.qe.MysqlConnectProcessor.processOnce(MysqlConnectProcessor.java:443) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) ~[doris-fe.jar:1.2-SNAPSHOT]
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
       at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Cannot invoke "java.util.Optional.isPresent()" because the return value of "org.apache.doris.nereids.trees.plans.co
mmands.info.CopyFromDesc.getFileFilterExpr()" is null
       ... 13 more
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Optional.isPresent()" because the return value of "org.apache.doris.nereids.trees.plans.commands.info.CopyFromDesc.getFileFilterEx
pr()" is null
       at org.apache.doris.nereids.trees.plans.commands.info.CopyIntoInfo.doValidate(CopyIntoInfo.java:262) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.nereids.trees.plans.commands.info.CopyIntoInfo.validate(CopyIntoInfo.java:195) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.nereids.trees.plans.commands.CopyIntoCommand.run(CopyIntoCommand.java:57) ~[doris-fe.jar:1.2-SNAPSHOT]
       at org.apache.doris.qe.StmtExecutor.executeByNereids(StmtExecutor.java:668) ~[doris-fe.jar:1.2-SNAPSHOT]
       ... 12 more

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen
Copy link
Contributor

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?

@sollhui
Copy link
Contributor Author

sollhui commented Sep 28, 2025

run buildall

Copy link
Contributor

@liaoxin01 liaoxin01 left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 28, 2025
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 33.33% (1/3) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

ClickBench: Total hot run time: 30.53 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit cb0942a6296e34656828d72247849655751d2f28, data reload: false

query1	0.06	0.05	0.05
query2	0.09	0.06	0.06
query3	0.26	0.08	0.08
query4	1.61	0.11	0.12
query5	0.29	0.25	0.25
query6	1.17	0.66	0.64
query7	0.03	0.03	0.03
query8	0.05	0.04	0.05
query9	0.64	0.52	0.53
query10	0.58	0.58	0.57
query11	0.17	0.11	0.11
query12	0.15	0.12	0.12
query13	0.63	0.62	0.62
query14	1.02	1.02	1.03
query15	0.88	0.86	0.85
query16	0.41	0.40	0.41
query17	1.08	1.10	1.07
query18	0.22	0.20	0.20
query19	1.94	1.91	1.91
query20	0.02	0.02	0.01
query21	15.40	0.93	0.61
query22	0.77	1.26	0.68
query23	14.78	1.31	0.66
query24	7.89	0.67	1.37
query25	0.50	0.17	0.20
query26	0.68	0.17	0.14
query27	0.06	0.05	0.06
query28	8.86	1.31	0.93
query29	12.61	3.97	3.35
query30	0.28	0.13	0.11
query31	2.84	0.59	0.38
query32	3.24	0.55	0.47
query33	3.09	3.08	3.11
query34	16.16	5.51	4.83
query35	4.92	4.90	4.86
query36	0.68	0.53	0.51
query37	0.09	0.07	0.08
query38	0.06	0.05	0.04
query39	0.03	0.02	0.02
query40	0.18	0.15	0.15
query41	0.08	0.03	0.03
query42	0.03	0.03	0.04
query43	0.04	0.04	0.03
Total cold run time: 104.57 s
Total hot run time: 30.53 s

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 0.00% (0/3) 🎉
Increment coverage report
Complete coverage report

@dataroaring dataroaring merged commit a22522d into apache:master Sep 28, 2025
30 of 31 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 28, 2025
### What problem does this PR solve?

introduced by #47194

 Copy into with no where expression:
 ```
copy into customer from @test_tpch('tpch/sf1/customer.csv.split00.gz')
properties ('file.compression' = 'gz', 'copy.async' = 'false');
 ```
 
 It will fail:
 ```
org.apache.doris.common.NereidsException: errCode = 2, detailMessage =
Cannot invoke "java.util.Optional.isPresent()" because the return value
of "org.apache.doris.nereids.trees.plans.commands.info.
CopyFromDesc.getFileFilterExpr()" is null
at
org.apache.doris.qe.StmtExecutor.executeByNereids(StmtExecutor.java:694)
~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:535)
~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.queryRetry(StmtExecutor.java:497)
~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:482)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.qe.ConnectProcessor.executeQuery(ConnectProcessor.java:358)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:249)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.qe.MysqlConnectProcessor.handleQuery(MysqlConnectProcessor.java:233)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.qe.MysqlConnectProcessor.dispatch(MysqlConnectProcessor.java:261)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.qe.MysqlConnectProcessor.processOnce(MysqlConnectProcessor.java:443)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52)
~[doris-fe.jar:1.2-SNAPSHOT]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
~[?:?]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: org.apache.doris.common.AnalysisException: errCode = 2,
detailMessage = Cannot invoke "java.util.Optional.isPresent()" because
the return value of "org.apache.doris.nereids.trees.plans.co
mmands.info.CopyFromDesc.getFileFilterExpr()" is null
        ... 13 more
Caused by: java.lang.NullPointerException: Cannot invoke
"java.util.Optional.isPresent()" because the return value of
"org.apache.doris.nereids.trees.plans.commands.info.CopyFromDesc.getFileFilterEx
pr()" is null
at
org.apache.doris.nereids.trees.plans.commands.info.CopyIntoInfo.doValidate(CopyIntoInfo.java:262)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.nereids.trees.plans.commands.info.CopyIntoInfo.validate(CopyIntoInfo.java:195)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.nereids.trees.plans.commands.CopyIntoCommand.run(CopyIntoCommand.java:57)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.qe.StmtExecutor.executeByNereids(StmtExecutor.java:668)
~[doris-fe.jar:1.2-SNAPSHOT]
        ... 12 more

 ```

### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
dataroaring pushed a commit that referenced this pull request Sep 28, 2025
…#56549 (#56590)

Cherry-picked from #56549

Co-authored-by: hui lai <laihui@selectdb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.0.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants