Skip to content

[fix](parser) fix DELETE/UPDATE cannot resolve column when table alias uses AS keyword #60335

Merged
englefly merged 1 commit intoapache:masterfrom
englefly:deletefromusing
Jan 31, 2026
Merged

[fix](parser) fix DELETE/UPDATE cannot resolve column when table alias uses AS keyword #60335
englefly merged 1 commit intoapache:masterfrom
englefly:deletefromusing

Conversation

@englefly
Copy link
Copy Markdown
Contributor

@englefly englefly commented Jan 29, 2026

What problem does this PR solve?

example:
delete from d_table as t1
using d_table as t2
where t2.k2 = 2
and t1.k1 = t2.k1;

before this pr, parser will report error that cannot find k1 in ast1, because ast1 is parsed as table alias.

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

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

@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Jan 29, 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?

@englefly
Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot
Copy link
Copy Markdown

TPC-H: Total hot run time: 32060 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 495408d81df1333a428b2c7ba81922c99fcb7510, data reload: false

------ Round 1 ----------------------------------
q1	17594	5343	5057	5057
q2	2065	319	201	201
q3	10225	1302	740	740
q4	10220	895	305	305
q5	7535	2096	1976	1976
q6	196	180	149	149
q7	876	718	605	605
q8	9266	1372	1132	1132
q9	5123	4866	4818	4818
q10	6834	1901	1565	1565
q11	510	280	261	261
q12	333	372	224	224
q13	17776	4010	3226	3226
q14	233	239	225	225
q15	891	821	803	803
q16	661	670	598	598
q17	644	804	468	468
q18	6694	6538	7295	6538
q19	2105	1010	615	615
q20	422	381	254	254
q21	2885	2192	2012	2012
q22	362	341	288	288
Total cold run time: 103450 ms
Total hot run time: 32060 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5473	5445	5453	5445
q2	276	347	253	253
q3	2321	2945	2531	2531
q4	1577	1883	1449	1449
q5	4663	4846	4586	4586
q6	232	183	136	136
q7	2072	2155	1783	1783
q8	2520	2367	2453	2367
q9	7624	7469	7504	7469
q10	2723	3048	2742	2742
q11	525	458	462	458
q12	841	761	611	611
q13	3774	4215	3227	3227
q14	267	289	260	260
q15	838	804	794	794
q16	623	677	634	634
q17	1067	1298	1312	1298
q18	7291	7373	7299	7299
q19	802	788	778	778
q20	1969	2067	1883	1883
q21	4500	4146	4016	4016
q22	564	555	513	513
Total cold run time: 52542 ms
Total hot run time: 50532 ms

@morrySnow morrySnow added usercase Important user case type label dev/4.0.x labels Jan 29, 2026
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jan 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link
Copy Markdown

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

query1	0.06	0.05	0.05
query2	0.09	0.05	0.04
query3	0.25	0.09	0.08
query4	1.60	0.11	0.11
query5	0.26	0.25	0.25
query6	1.18	0.67	0.67
query7	0.03	0.02	0.03
query8	0.06	0.04	0.04
query9	0.56	0.51	0.50
query10	0.55	0.54	0.56
query11	0.14	0.10	0.10
query12	0.14	0.10	0.11
query13	0.62	0.61	0.62
query14	1.06	1.05	1.05
query15	0.87	0.85	0.87
query16	0.39	0.39	0.41
query17	1.13	1.13	1.14
query18	0.22	0.21	0.21
query19	2.08	1.90	1.94
query20	0.02	0.01	0.01
query21	15.47	0.26	0.15
query22	5.34	0.06	0.05
query23	16.18	0.28	0.11
query24	0.93	0.61	0.55
query25	0.12	0.12	0.07
query26	0.14	0.13	0.13
query27	0.06	0.08	0.08
query28	4.71	1.13	0.97
query29	12.57	3.94	3.15
query30	0.28	0.14	0.11
query31	2.80	0.64	0.39
query32	3.24	0.60	0.49
query33	3.20	3.23	3.34
query34	16.21	5.39	4.73
query35	4.74	4.82	4.72
query36	0.64	0.50	0.49
query37	0.11	0.07	0.08
query38	0.07	0.04	0.03
query39	0.05	0.03	0.04
query40	0.19	0.17	0.15
query41	0.09	0.04	0.03
query42	0.04	0.04	0.03
query43	0.05	0.04	0.04
Total cold run time: 98.54 s
Total hot run time: 28.45 s

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

@englefly englefly merged commit 22afe11 into apache:master Jan 31, 2026
33 of 34 checks passed
@englefly englefly deleted the deletefromusing branch January 31, 2026 05:34
github-actions bot pushed a commit that referenced this pull request Jan 31, 2026
…s uses AS keyword (#60335)

### What problem does this PR solve?
example:
 delete from d_table as t1
        using d_table as t2
        where t2.k2 = 2
          and t1.k1 = t2.k1;

before this pr, parser will report error that cannot find k1 in ast1,
because ast1 is parsed as table alias.
yiguolei pushed a commit that referenced this pull request Feb 2, 2026
…n table alias uses AS keyword #60335 (#60402)

Cherry-picked from #60335

Co-authored-by: minghong <zhouminghong@selectdb.com>
ybtsdst pushed a commit to ybtsdst/doris that referenced this pull request Feb 27, 2026
…n table alias uses AS keyword apache#60335 (apache#60402)

Cherry-picked from apache#60335

Co-authored-by: minghong <zhouminghong@selectdb.com>
@yiguolei yiguolei mentioned this pull request Mar 7, 2026
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.4-merged reviewed usercase Important user case type label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants