Skip to content

[fix](planner) align legacy literal compareLiteral with Nereids ComparableLiteral semantics#63481

Merged
morrySnow merged 7 commits into
apache:masterfrom
csun5285:fix/ipv4-ipv6-multi-not-equal
May 26, 2026
Merged

[fix](planner) align legacy literal compareLiteral with Nereids ComparableLiteral semantics#63481
morrySnow merged 7 commits into
apache:masterfrom
csun5285:fix/ipv4-ipv6-multi-not-equal

Conversation

@csun5285

@csun5285 csun5285 commented May 21, 2026

Copy link
Copy Markdown
Contributor

IPv4Literal/IPv6Literal.compareLiteral both used to return 0 unconditionally, making any two IP literals appear equal to LiteralExpr.equals(). The downstream effect:

WHERE ip4 != '1.1.1.1' AND ip4 != '1.1.1.2'

collapsed to just the first conjunct during Set dedup inside the legacy planner's ScanNode.expressionToRanges / PartitionColumnFilter / HashDistributionPruner paths. Same shape for NOT BETWEEN and NOT IN. Multiple rows that should have been filtered out leaked through, and EXPLAIN only showed the first predicate.

What problem does this PR solve?

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

@hello-stephen

Copy link
Copy Markdown
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?

csun5285 and others added 2 commits May 21, 2026 18:24
…rableLiteral semantics

IPv4Literal/IPv6Literal.compareLiteral both used to return 0
unconditionally, making any two IP literals appear equal to
LiteralExpr.equals(). The downstream effect:

  WHERE ip4 != '1.1.1.1' AND ip4 != '1.1.1.2'

collapsed to just the first conjunct during Set<Expr> dedup
inside the legacy planner's ScanNode.expressionToRanges /
PartitionColumnFilter / HashDistributionPruner paths. Same shape
for NOT BETWEEN and NOT IN. Multiple rows that should have been
filtered out leaked through, and EXPLAIN only showed the first
predicate.

Apache Doris issue: apache#62672
SelectDB Jira: CIR-20160

Fix:
- IPv4Literal: compare on the long value; throw on cross-type.
  Override equals/hashCode so LiteralExpr.equals stops short-circuiting
  to the now-throwing compareLiteral on non-IPv4 peers.
- IPv6Literal: canonicalize via InetAddress.getByName so "::1" and
  "0:0:0:0:0:0:0:1" hash and compare equal, then 128-bit unsigned
  compare via BigInteger; same equals/hashCode pattern.

While auditing the rest of the legacy literals against their
Nereids counterparts' ComparableLiteral implementations, three
more had the same return-0 shape but happen to be unreachable
from SQL today (MAP/STRUCT column comparison predicates are
rejected at analyze time; TIME is not allowed as an OLAP column
type). Switch them to throw so the bug surfaces loudly if a
future planner change ever reaches them:

- MapLiteral.compareLiteral throws
- StructLiteral.compareLiteral throws
- TimeV2Literal.compareLiteral throws (+ equals/hashCode on
  getValue() so dedup paths that don't go through compareLiteral
  still work)

Tests:
- regression-test/suites/query_p0/sql_functions/ip_functions/
  test_ipv4_ipv6_multi_not_equal.groovy covers IPv4/IPv6 multiple
  !=, NOT BETWEEN, NOT IN + != combos, with EXPLAIN assertions
  proving every conjunct survives.
- fe-catalog unit tests (new) cover compareLiteral + equals for
  every legacy LiteralExpr subclass that survives in the legacy
  planner (98 tests total, all green via
  `mvn -pl fe-catalog -am test`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pin equals() / hashCode() semantics for every legacy Expr subclass
that overrides equals — covering ArithmeticExpr, BinaryPredicate,
CastExpr, CompoundPredicate, FunctionCallExpr, InformationFunction,
InPredicate, IsNullPredicate, LikePredicate, MatchPredicate,
SlotRef, VariableExpr, CaseExpr. 33 cases total.

Each subclass test asserts:
- same children + same distinguishing field (op / isNot* / name / ...)
  → equal
- different distinguishing field → not equal
- different children → not equal
- (where applicable) hashCode consistency

Skipped:
- BetweenPredicate / SearchPredicate: no usable public constructor
  for unit construction (parser-only paths)
- ColumnRefExpr / EncryptKeyRef / LambdaFunctionExpr /
  TimestampArithmeticExpr: no equals override, inherit Expr.equals
  default which is already exercised through children comparison
  in the covered subclass tests

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@csun5285
csun5285 force-pushed the fix/ipv4-ipv6-multi-not-equal branch from bd2b2cb to 9bac9d6 Compare May 21, 2026 10:26
@csun5285

Copy link
Copy Markdown
Contributor Author

run buildall

1 similar comment
@csun5285

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 31102 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 9bac9d6c113b7836f43a25301b3a8af50b0b1992, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17683	3928	3884	3884
q2	q3	10794	1440	803	803
q4	4683	482	362	362
q5	7604	2249	2087	2087
q6	247	176	137	137
q7	920	779	635	635
q8	9416	1738	1565	1565
q9	5139	4916	4921	4916
q10	6394	2076	1774	1774
q11	429	277	240	240
q12	626	423	294	294
q13	18094	3379	2777	2777
q14	265	259	234	234
q15	q16	825	770	715	715
q17	997	882	1024	882
q18	7102	5780	5438	5438
q19	1304	1263	1062	1062
q20	509	410	422	410
q21	6421	2915	2566	2566
q22	459	386	321	321
Total cold run time: 99911 ms
Total hot run time: 31102 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4822	4500	4526	4500
q2	q3	4876	5235	4648	4648
q4	2155	2198	1430	1430
q5	4692	4923	4583	4583
q6	230	173	128	128
q7	1789	1750	1485	1485
q8	2354	2073	2176	2073
q9	7778	7613	7157	7157
q10	4444	4377	3983	3983
q11	528	376	351	351
q12	717	719	514	514
q13	3045	3321	2795	2795
q14	279	289	246	246
q15	q16	673	709	613	613
q17	1263	1237	1228	1228
q18	7217	6790	6672	6672
q19	1124	1118	1100	1100
q20	2215	2221	1913	1913
q21	5309	4560	4477	4477
q22	503	459	424	424
Total cold run time: 56013 ms
Total hot run time: 50320 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 168949 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 9bac9d6c113b7836f43a25301b3a8af50b0b1992, data reload: false

query5	4348	664	528	528
query6	341	230	194	194
query7	4231	557	304	304
query8	329	237	216	216
query9	8842	4051	4077	4051
query10	445	338	296	296
query11	5806	2393	2227	2227
query12	181	128	123	123
query13	1327	622	438	438
query14	6030	5411	5069	5069
query14_1	4355	4382	4391	4382
query15	219	207	185	185
query16	1015	479	419	419
query17	1143	755	573	573
query18	2631	482	347	347
query19	205	199	156	156
query20	135	126	131	126
query21	222	140	113	113
query22	13633	13593	13422	13422
query23	17154	16349	16043	16043
query23_1	16094	16076	16160	16076
query24	7427	1739	1329	1329
query24_1	1299	1286	1313	1286
query25	541	466	408	408
query26	1321	320	171	171
query27	2721	573	347	347
query28	4435	1965	1961	1961
query29	984	626	487	487
query30	310	236	199	199
query31	1119	1061	935	935
query32	90	73	76	73
query33	529	353	282	282
query34	1169	1123	645	645
query35	768	781	691	691
query36	1335	1353	1257	1257
query37	175	105	96	96
query38	3197	3148	3033	3033
query39	933	918	899	899
query39_1	872	885	866	866
query40	228	149	148	148
query41	78	66	64	64
query42	108	110	113	110
query43	341	329	280	280
query44	
query45	215	210	195	195
query46	1088	1194	726	726
query47	2343	2379	2194	2194
query48	411	437	300	300
query49	649	506	407	407
query50	952	370	263	263
query51	4298	4352	4209	4209
query52	113	109	97	97
query53	261	283	204	204
query54	330	293	272	272
query55	98	97	88	88
query56	317	320	319	319
query57	1424	1413	1309	1309
query58	309	286	283	283
query59	1575	1651	1515	1515
query60	324	339	312	312
query61	197	187	193	187
query62	672	627	572	572
query63	244	208	207	207
query64	2460	785	619	619
query65	
query66	1699	485	354	354
query67	30076	29922	29853	29853
query68	
query69	458	343	315	315
query70	1033	922	954	922
query71	307	270	265	265
query72	3013	2708	2393	2393
query73	848	774	401	401
query74	5073	4918	4734	4734
query75	2691	2605	2254	2254
query76	2283	1146	760	760
query77	398	406	327	327
query78	12031	12052	11635	11635
query79	1492	1045	694	694
query80	638	528	446	446
query81	446	276	244	244
query82	1359	155	126	126
query83	352	276	251	251
query84	262	144	109	109
query85	856	532	462	462
query86	397	352	321	321
query87	3429	3410	3196	3196
query88	3500	2679	2665	2665
query89	443	380	337	337
query90	1897	182	202	182
query91	182	166	141	141
query92	82	81	80	80
query93	1491	1475	867	867
query94	536	344	294	294
query95	664	371	428	371
query96	1117	797	322	322
query97	2717	2687	2571	2571
query98	232	229	225	225
query99	1121	1059	962	962
Total cold run time: 253215 ms
Total hot run time: 168949 ms

@yiguolei

Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 31204 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 9bac9d6c113b7836f43a25301b3a8af50b0b1992, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17744	3890	3874	3874
q2	q3	10760	1389	794	794
q4	4690	476	344	344
q5	7574	2214	2099	2099
q6	243	173	144	144
q7	957	765	662	662
q8	9378	1690	1595	1595
q9	6613	4912	4872	4872
q10	6448	2098	1818	1818
q11	429	271	236	236
q12	685	412	294	294
q13	18221	3406	2765	2765
q14	262	254	240	240
q15	q16	824	767	712	712
q17	1070	901	967	901
q18	6897	5653	5541	5541
q19	1278	1254	1114	1114
q20	574	419	299	299
q21	5957	2758	2597	2597
q22	450	373	303	303
Total cold run time: 101054 ms
Total hot run time: 31204 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4658	4544	4653	4544
q2	q3	4835	5128	4578	4578
q4	2141	2221	1423	1423
q5	4773	4695	4731	4695
q6	230	177	130	130
q7	1850	1760	1529	1529
q8	2437	2011	1894	1894
q9	7247	7247	7134	7134
q10	4474	4388	4000	4000
q11	520	376	350	350
q12	712	740	519	519
q13	3063	3381	2812	2812
q14	271	294	248	248
q15	q16	673	697	613	613
q17	1268	1231	1236	1231
q18	7295	6717	6630	6630
q19	1113	1094	1086	1086
q20	2207	2198	1935	1935
q21	5276	4600	4481	4481
q22	515	457	438	438
Total cold run time: 55558 ms
Total hot run time: 50270 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 169634 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 9bac9d6c113b7836f43a25301b3a8af50b0b1992, data reload: false

query5	4322	653	519	519
query6	342	218	204	204
query7	4256	578	306	306
query8	327	245	218	218
query9	8811	3948	3941	3941
query10	460	339	297	297
query11	5759	2413	2177	2177
query12	185	128	125	125
query13	1287	581	418	418
query14	6008	5325	5011	5011
query14_1	4302	4294	4304	4294
query15	211	204	181	181
query16	1018	452	431	431
query17	1150	709	585	585
query18	2449	483	360	360
query19	210	199	160	160
query20	135	131	132	131
query21	216	139	122	122
query22	13601	13522	13387	13387
query23	17113	16374	16059	16059
query23_1	16131	16056	16266	16056
query24	7539	1773	1305	1305
query24_1	1306	1323	1322	1322
query25	565	493	465	465
query26	1313	323	172	172
query27	2678	558	335	335
query28	4485	1994	1943	1943
query29	1030	639	528	528
query30	312	244	210	210
query31	1144	1070	931	931
query32	91	81	78	78
query33	545	357	315	315
query34	1179	1136	653	653
query35	750	799	672	672
query36	1337	1342	1188	1188
query37	168	106	94	94
query38	3179	3173	3053	3053
query39	927	919	897	897
query39_1	876	914	879	879
query40	233	151	131	131
query41	73	69	67	67
query42	115	112	111	111
query43	323	327	286	286
query44	
query45	214	204	198	198
query46	1089	1208	736	736
query47	2353	2305	2157	2157
query48	414	431	289	289
query49	658	501	401	401
query50	991	352	252	252
query51	4292	4306	4273	4273
query52	105	108	98	98
query53	259	291	210	210
query54	331	311	273	273
query55	96	92	86	86
query56	314	330	320	320
query57	1425	1391	1307	1307
query58	312	282	277	277
query59	1588	1606	1369	1369
query60	338	389	302	302
query61	154	153	158	153
query62	659	601	565	565
query63	242	194	207	194
query64	2410	786	619	619
query65	
query66	1748	466	343	343
query67	29951	29967	29150	29150
query68	
query69	464	338	291	291
query70	1051	1003	984	984
query71	305	277	271	271
query72	3056	2713	2357	2357
query73	843	744	452	452
query74	5074	4947	4706	4706
query75	2690	2601	2251	2251
query76	2299	1137	745	745
query77	392	407	338	338
query78	12084	12132	11595	11595
query79	1608	1042	730	730
query80	636	574	452	452
query81	475	277	238	238
query82	1367	157	126	126
query83	349	267	249	249
query84	262	142	114	114
query85	950	525	443	443
query86	402	318	335	318
query87	3441	3389	3203	3203
query88	3541	2696	2701	2696
query89	464	380	335	335
query90	1959	181	177	177
query91	180	170	136	136
query92	80	78	73	73
query93	1576	1423	888	888
query94	514	358	316	316
query95	701	463	340	340
query96	1071	778	320	320
query97	2685	2674	2598	2598
query98	234	225	232	225
query99	1116	1121	993	993
Total cold run time: 253415 ms
Total hot run time: 169634 ms

morrySnow
morrySnow previously approved these changes May 25, 2026
@morrySnow

Copy link
Copy Markdown
Contributor

/review

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label May 25, 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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary: I found one blocking correctness issue in the new IPv6 literal comparison implementation. The PR goal is clear and the IPv4 path appears to address the predicate-dedup bug, but IPv6 comparison is still incorrect for IPv4-mapped IPv6 literals that the class already accepts.

Critical checkpoints: goal/test coverage: the PR targets legacy literal equality/comparison for predicate dedup and adds unit/regression coverage, but mapped IPv6 forms are untested and currently wrong. Scope: the change is focused. Concurrency/lifecycle/config/compatibility/persistence/data-write/observability: not applicable for these FE literal/test changes. Parallel paths: IPv4 and IPv6 were both updated, but IPv6 needs mapped-address handling consistent with its accepted syntax. Error handling: no ignored checked status; however the new helper converts a valid literal into the wrong numeric domain rather than failing. Tests: new tests cover compact vs expanded IPv6 and multi-predicate SQL, but miss IPv4-mapped IPv6, which is the failing edge case. User focus: no additional user-provided review focus was supplied.

Comment thread fe/fe-catalog/src/main/java/org/apache/doris/analysis/IPv6Literal.java Outdated
…n legacy compare/equals

InetAddress.getByName collapsed mapped forms like ::ffff:0.0.0.1 (and
::ffff:0:1) into a 4-byte Inet4Address, so toUnsigned128 produced
BigInteger(1) — the same value as ::1 — and predicate dedup folded the
two together. Switch the legacy IPv6Literal to com.googlecode.ipv6
IPv6Address (same library the Nereids IPv6Literal already uses), which
always materializes 128 bits and gives consistent compare/equals/hashCode
across both planners. Adds ::ffff:0.0.0.1 vs ::1 coverage in both
LiteralExprEqualsTest and LiteralExprCompareLiteralTest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot removed the approved Indicates a PR has been approved by one committer. label May 25, 2026
@csun5285

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 32051 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 606c357461ecfcf824e1404d90deebd12a232a73, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17733	4189	4049	4049
q2	q3	10828	1455	822	822
q4	4695	478	351	351
q5	7580	2336	2103	2103
q6	265	184	140	140
q7	986	770	643	643
q8	9383	1672	1699	1672
q9	5161	4969	4964	4964
q10	6375	2230	1866	1866
q11	427	282	249	249
q12	633	428	302	302
q13	18150	3307	2819	2819
q14	269	261	239	239
q15	q16	840	779	721	721
q17	1014	1053	992	992
q18	6922	5656	5531	5531
q19	1313	1318	1197	1197
q20	553	494	304	304
q21	6286	2941	2772	2772
q22	469	365	315	315
Total cold run time: 99882 ms
Total hot run time: 32051 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4896	4769	4846	4769
q2	q3	5025	5305	4637	4637
q4	2179	2233	1481	1481
q5	4977	4935	4828	4828
q6	238	183	129	129
q7	1936	1806	1611	1611
q8	2481	2304	2205	2205
q9	7837	7457	7527	7457
q10	4772	4680	4284	4284
q11	543	390	360	360
q12	739	748	540	540
q13	3012	3462	2854	2854
q14	283	284	248	248
q15	q16	689	705	624	624
q17	1323	1291	1285	1285
q18	7226	6834	6727	6727
q19	1127	1164	1130	1130
q20	2244	2231	1946	1946
q21	5420	4748	4615	4615
q22	525	475	404	404
Total cold run time: 57472 ms
Total hot run time: 52134 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 173919 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 606c357461ecfcf824e1404d90deebd12a232a73, data reload: false

query5	4350	678	538	538
query6	343	216	193	193
query7	4274	576	292	292
query8	337	235	230	230
query9	8847	4310	4246	4246
query10	456	358	304	304
query11	5873	2551	2231	2231
query12	187	128	127	127
query13	1330	654	438	438
query14	6170	5583	5282	5282
query14_1	4590	4566	4550	4550
query15	214	211	189	189
query16	1030	467	363	363
query17	1160	757	622	622
query18	2750	515	379	379
query19	230	219	170	170
query20	138	136	134	134
query21	220	143	120	120
query22	13732	13680	13492	13492
query23	17453	16610	16421	16421
query23_1	16439	16463	16429	16429
query24	7641	1798	1338	1338
query24_1	1334	1341	1343	1341
query25	591	505	449	449
query26	1305	325	181	181
query27	2656	568	357	357
query28	4407	2015	2009	2009
query29	1024	675	522	522
query30	307	240	203	203
query31	1138	1094	959	959
query32	101	78	81	78
query33	547	391	302	302
query34	1180	1178	660	660
query35	770	820	691	691
query36	1376	1437	1282	1282
query37	150	103	93	93
query38	3240	3200	3063	3063
query39	940	913	889	889
query39_1	884	887	861	861
query40	224	147	137	137
query41	67	64	63	63
query42	108	111	112	111
query43	354	354	316	316
query44	
query45	218	218	198	198
query46	1128	1227	753	753
query47	2384	2395	2282	2282
query48	418	426	294	294
query49	624	501	386	386
query50	969	353	256	256
query51	4337	4407	4268	4268
query52	106	108	93	93
query53	257	295	205	205
query54	313	276	255	255
query55	93	92	87	87
query56	319	320	294	294
query57	1455	1423	1363	1363
query58	312	280	268	268
query59	1744	1773	1538	1538
query60	329	335	326	326
query61	159	155	160	155
query62	703	658	588	588
query63	250	222	208	208
query64	2381	811	641	641
query65	
query66	1690	486	406	406
query67	29532	30111	29994	29994
query68	
query69	488	351	330	330
query70	1040	1004	1027	1004
query71	320	282	268	268
query72	2984	2916	2401	2401
query73	845	776	417	417
query74	5109	4971	4831	4831
query75	2693	2605	2293	2293
query76	2309	1173	809	809
query77	423	422	347	347
query78	12482	12633	11869	11869
query79	1490	1054	725	725
query80	652	525	458	458
query81	457	289	251	251
query82	1378	157	121	121
query83	354	282	256	256
query84	267	145	113	113
query85	865	532	444	444
query86	402	326	326	326
query87	3453	3445	3304	3304
query88	3754	2764	2854	2764
query89	469	391	349	349
query90	1908	203	191	191
query91	183	165	148	148
query92	89	86	74	74
query93	1580	1580	865	865
query94	545	339	325	325
query95	693	402	356	356
query96	1054	802	383	383
query97	2818	2739	2610	2610
query98	240	235	233	233
query99	1195	1158	1043	1043
Total cold run time: 255685 ms
Total hot run time: 173919 ms

@morrySnow

Copy link
Copy Markdown
Contributor

/review

@eldenmoon

Copy link
Copy Markdown
Member

/review

@github-actions

Copy link
Copy Markdown
Contributor

OpenCode automated review failed and did not complete.

Error: Error: The user rejected permission to use this specific tool call.
Workflow run: https://github.com/apache/doris/actions/runs/26439190055

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@zclllyybb

Copy link
Copy Markdown
Contributor

/review Review过程中严禁尝试访问任何代码库以外的内容或在本机全局搜索任何内容。

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review summary:

No additional blocking issues found in the current head beyond the already-known review context. The checked-out code appears to have addressed the existing IPv6 mapped-address parsing concern, the TIMEV2 equals/hashCode mismatch, and the regression-test final drop-table concern.

Critical checkpoint conclusions:

  • Goal and tests: the PR targets incorrect legacy Expr/LiteralExpr equality and literal comparison behavior used by predicate deduplication and pruning. The implementation and added FE unit tests/regression case are aligned with that goal.
  • Scope: the changes are focused on legacy literal comparison/equality plus targeted tests; no broad unrelated behavior changes found.
  • Concurrency: no new shared mutable state, locking, thread, or async behavior introduced.
  • Lifecycle/static initialization: no non-trivial lifecycle or cross-TU/static initialization issue found.
  • Configuration: no new configuration items.
  • Compatibility/protocol/storage: no FE-BE protocol, persistence, storage format, transaction, or rolling-upgrade compatibility changes found.
  • Parallel paths: legacy IPv6 canonicalization now matches the existing Nereids IPv6Address-based path; no other directly parallel path needing the same fix was found.
  • Conditional/error handling: unsupported MAP/STRUCT/TIMEV2 compareLiteral paths now fail loudly instead of returning equality, which is safer than silent deduplication.
  • Test coverage: FE unit tests and a deterministic regression test cover the main corrected scenarios, including IPv4/IPv6 multi-predicate dedup, IPv6 canonical forms, IPv4-mapped IPv6, and TIMEV2 scale hash consistency.
  • Test execution: attempted mvn -pl fe-catalog -Dtest=ExprEqualsTest,LiteralExprCompareLiteralTest,LiteralExprEqualsTest test -Dskip.doc=true, which failed because sibling SNAPSHOT modules were not installed. Retried with -am -DfailIfNoTests=false, but the reactor stopped at fe-thrift because thirdparty/installed/bin/thrift is missing in this runner.
  • Observability/performance: no new observability required; repeated IPv6Address parsing is in planner literal comparison/equality and not a BE data hot path.

User focus: review operations were confined to the repository checkout; I did not intentionally inspect code or files outside the workspace.

Comment thread fe/fe-catalog/pom.xml
@morrySnow
morrySnow merged commit f9fea7d into apache:master May 26, 2026
30 checks passed
csun5285 added a commit to csun5285/doris that referenced this pull request May 29, 2026
…ereids ComparableLiteral semantics (apache#63481)

IPv4Literal/IPv6Literal.compareLiteral both used to return 0
unconditionally, making any two IP literals appear equal to
LiteralExpr.equals(). The downstream effect:

  WHERE ip4 != '1.1.1.1' AND ip4 != '1.1.1.2'

collapsed to just the first conjunct during Set<Expr> dedup inside the
legacy planner's ScanNode.expressionToRanges / PartitionColumnFilter /
HashDistributionPruner paths. Same shape for NOT BETWEEN and NOT IN.
Multiple rows that should have been filtered out leaked through, and
EXPLAIN only showed the first predicate.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
csun5285 added a commit to csun5285/doris that referenced this pull request May 29, 2026
…ereids ComparableLiteral semantics (apache#63481)

IPv4Literal/IPv6Literal.compareLiteral both used to return 0
unconditionally, making any two IP literals appear equal to
LiteralExpr.equals(). The downstream effect:

  WHERE ip4 != '1.1.1.1' AND ip4 != '1.1.1.2'

collapsed to just the first conjunct during Set<Expr> dedup inside the
legacy planner's ScanNode.expressionToRanges / PartitionColumnFilter /
HashDistributionPruner paths. Same shape for NOT BETWEEN and NOT IN.
Multiple rows that should have been filtered out leaked through, and
EXPLAIN only showed the first predicate.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
yiguolei pushed a commit that referenced this pull request May 30, 2026
…ereids ComparableLiteral semantics (#63481) (#63874)

pick from master #63481

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zhaorongsheng pushed a commit to zhaorongsheng/doris that referenced this pull request Jun 4, 2026
…rableLiteral semantics (apache#63481)

IPv4Literal/IPv6Literal.compareLiteral both used to return 0
unconditionally, making any two IP literals appear equal to
LiteralExpr.equals(). The downstream effect:

  WHERE ip4 != '1.1.1.1' AND ip4 != '1.1.1.2'

collapsed to just the first conjunct during Set<Expr> dedup inside the
legacy planner's ScanNode.expressionToRanges / PartitionColumnFilter /
HashDistributionPruner paths. Same shape for NOT BETWEEN and NOT IN.
Multiple rows that should have been filtered out leaked through, and
EXPLAIN only showed the first predicate.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@csun5285 csun5285 removed the dev/3.1.x label Jun 6, 2026
morningman pushed a commit to csun5285/doris that referenced this pull request Jun 24, 2026
…ereids ComparableLiteral semantics (apache#63481)

IPv4Literal/IPv6Literal.compareLiteral both used to return 0
unconditionally, making any two IP literals appear equal to
LiteralExpr.equals(). The downstream effect:

  WHERE ip4 != '1.1.1.1' AND ip4 != '1.1.1.2'

collapsed to just the first conjunct during Set<Expr> dedup inside the
legacy planner's ScanNode.expressionToRanges / PartitionColumnFilter /
HashDistributionPruner paths. Same shape for NOT BETWEEN and NOT IN.
Multiple rows that should have been filtered out leaked through, and
EXPLAIN only showed the first predicate.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
morningman pushed a commit that referenced this pull request Jun 26, 2026
…ereids ComparableLiteral semantics (#63481) (#63873)

pick from master #63481

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants