Skip to content

Conversation

@zy-kkk
Copy link
Member

@zy-kkk zy-kkk commented Jul 2, 2025

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Set up two service addresses

Doris > set global sql_converter_service_url = 'http://127.0.0.1:5001/api/v1/convert,http://127.0.0.1:5002/api/v1/convert';
Query OK, 0 rows affected (0.04 sec)

Doris > set sql_dialect = 'clickhouse';
Query OK, 0 rows affected (0.05 sec)

Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
+--------------------+
| ELEMENT_AT(arr, 2) |
+--------------------+
|                  2 |
+--------------------+
1 row in set (0.11 sec)

Stop one of the services

Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
+--------------------+
| ELEMENT_AT(arr, 2) |
+--------------------+
|                  2 |
+--------------------+
1 row in set (0.14 sec)

Stopping all services resulted in expected errors

Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
ERROR 1105 (HY000): errCode = 2, detailMessage = 
Every derived table must have its own alias(line 1, pos 33)

== SQL ==
SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr)
---------------------------------^^^

Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
ERROR 1105 (HY000): errCode = 2, detailMessage = 
Every derived table must have its own alias(line 1, pos 33)
== SQL ==
SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr)
---------------------------------^^^

Restart one of the services

Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
+--------------------+
| ELEMENT_AT(arr, 2) |
+--------------------+
|                  2 |
+--------------------+
1 row in set (0.16 sec)

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?

Check List (For Reviewer who merge this PR)

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

@zy-kkk
Copy link
Member Author

zy-kkk commented Jul 2, 2025

run buildall

@Thearas
Copy link
Contributor

Thearas commented Jul 2, 2025

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?

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17654	5216	5081	5081
q2	1944	285	180	180
q3	10583	1299	715	715
q4	10257	1028	522	522
q5	8018	2402	2299	2299
q6	181	162	126	126
q7	897	732	595	595
q8	9296	1201	1087	1087
q9	7525	5081	5032	5032
q10	6884	2388	1963	1963
q11	481	285	274	274
q12	342	341	210	210
q13	17779	3634	3042	3042
q14	233	221	223	221
q15	533	473	476	473
q16	419	439	376	376
q17	586	859	363	363
q18	7756	7156	7113	7113
q19	1211	946	540	540
q20	328	349	220	220
q21	3731	2553	2305	2305
q22	1050	1002	948	948
Total cold run time: 107688 ms
Total hot run time: 33685 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5092	5065	5062	5062
q2	238	313	219	219
q3	2121	2681	2306	2306
q4	1344	1760	1348	1348
q5	4202	4536	4602	4536
q6	216	169	126	126
q7	2036	1923	1845	1845
q8	2719	2596	2518	2518
q9	7349	7283	7109	7109
q10	3081	3395	2855	2855
q11	572	528	507	507
q12	683	804	613	613
q13	3581	4015	3430	3430
q14	280	292	277	277
q15	529	478	458	458
q16	458	479	452	452
q17	1199	1595	1385	1385
q18	7952	7814	7493	7493
q19	791	867	1029	867
q20	2033	2086	1906	1906
q21	5088	4628	4562	4562
q22	1116	1024	1018	1018
Total cold run time: 52680 ms
Total hot run time: 50892 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 185849 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 239ef243cba2ab2a1421feb852ba0c931fb42c35, data reload: false

query1	990	392	396	392
query2	6529	1666	1653	1653
query3	6748	213	220	213
query4	26331	23565	23775	23565
query5	4335	556	434	434
query6	282	204	197	197
query7	4621	494	287	287
query8	257	208	207	207
query9	8602	2616	2617	2616
query10	467	316	264	264
query11	15289	15024	14801	14801
query12	153	103	110	103
query13	1668	550	421	421
query14	8564	5685	5717	5685
query15	212	189	177	177
query16	7207	635	478	478
query17	942	719	590	590
query18	1983	402	311	311
query19	197	199	175	175
query20	128	116	115	115
query21	209	120	104	104
query22	4122	4166	4256	4166
query23	35096	33992	33877	33877
query24	8559	2429	2344	2344
query25	533	458	383	383
query26	1243	264	140	140
query27	2767	510	341	341
query28	4283	2122	2107	2107
query29	754	531	419	419
query30	280	217	183	183
query31	907	841	767	767
query32	65	59	62	59
query33	565	352	298	298
query34	791	827	510	510
query35	756	788	708	708
query36	963	972	885	885
query37	105	94	72	72
query38	4178	4077	4040	4040
query39	1451	1392	1418	1392
query40	208	113	101	101
query41	53	51	48	48
query42	115	107	105	105
query43	505	485	475	475
query44	1302	821	822	821
query45	177	165	163	163
query46	826	1098	617	617
query47	1754	1785	1727	1727
query48	383	401	318	318
query49	727	472	387	387
query50	640	686	414	414
query51	4194	4112	4258	4112
query52	112	108	98	98
query53	218	256	183	183
query54	574	562	501	501
query55	88	82	81	81
query56	293	288	294	288
query57	1182	1208	1098	1098
query58	265	250	249	249
query59	2525	2661	2509	2509
query60	322	327	297	297
query61	128	119	125	119
query62	828	707	664	664
query63	216	185	183	183
query64	4323	1001	644	644
query65	4302	4191	4181	4181
query66	1155	400	302	302
query67	15913	15511	15371	15371
query68	8250	869	524	524
query69	496	301	268	268
query70	1249	1129	1077	1077
query71	497	317	302	302
query72	5746	4762	4728	4728
query73	743	609	349	349
query74	8908	9239	8748	8748
query75	4003	3187	2664	2664
query76	3752	1140	708	708
query77	784	382	304	304
query78	9979	10193	9540	9540
query79	2280	812	588	588
query80	612	509	451	451
query81	476	262	222	222
query82	420	124	97	97
query83	283	247	237	237
query84	284	119	83	83
query85	774	341	309	309
query86	337	298	273	273
query87	4388	4478	4344	4344
query88	3388	2275	2277	2275
query89	373	312	282	282
query90	1895	213	203	203
query91	138	144	110	110
query92	66	57	54	54
query93	1631	936	585	585
query94	669	409	294	294
query95	378	286	282	282
query96	496	569	275	275
query97	2724	2770	2656	2656
query98	224	207	212	207
query99	1439	1412	1275	1275
Total cold run time: 274142 ms
Total hot run time: 185849 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.04
query2	0.08	0.05	0.04
query3	0.23	0.08	0.07
query4	1.63	0.11	0.11
query5	0.43	0.44	0.42
query6	1.18	0.65	0.65
query7	0.03	0.02	0.02
query8	0.04	0.04	0.03
query9	0.60	0.51	0.52
query10	0.57	0.56	0.55
query11	0.16	0.10	0.11
query12	0.14	0.11	0.12
query13	0.61	0.61	0.60
query14	0.80	0.81	0.81
query15	0.89	0.90	0.88
query16	0.40	0.39	0.39
query17	1.12	1.07	1.02
query18	0.22	0.22	0.21
query19	1.97	1.86	1.86
query20	0.01	0.02	0.02
query21	15.39	0.88	0.53
query22	0.76	1.18	0.69
query23	14.97	1.39	0.59
query24	6.66	1.14	0.94
query25	0.52	0.16	0.11
query26	0.66	0.17	0.13
query27	0.06	0.06	0.06
query28	9.78	0.92	0.45
query29	12.54	4.01	3.34
query30	0.25	0.09	0.07
query31	2.84	0.59	0.40
query32	3.24	0.56	0.45
query33	3.11	3.17	3.06
query34	15.98	5.43	4.73
query35	4.79	4.86	4.82
query36	0.69	0.53	0.50
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.03
query40	0.17	0.14	0.14
query41	0.08	0.03	0.03
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 103.89 s
Total hot run time: 29.66 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 66.07% (37/56) 🎉
Increment coverage report
Complete coverage report

@zy-kkk
Copy link
Member Author

zy-kkk commented Jul 3, 2025

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 72.22% (78/108) 🎉
Increment coverage report
Complete coverage report

private static final ConcurrentHashMap<String, UrlManager> urlManagerCache = new ConcurrentHashMap<>();

// Blacklist recovery time (ms): 5 minutes
private static final long BLACKLIST_RECOVERY_TIME_MS = 5 * 60 * 1000;
Copy link
Contributor

Choose a reason for hiding this comment

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

Too long, 1min is enough, because the sql convertor should be restart very soon


public static String convertSql(String targetURLs, String originStmt, String dialect,
String[] features, String config) {
if (targetURLs == null || targetURLs.trim().isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be done when setting the variable. See checker() in public @interface VarAttr

BlacklistEntry existingEntry = blacklist.get(url);
if (existingEntry != null) {
// If URL is already in blacklist, limit maximum recovery time to avoid infinite extension
// Maximum recovery time is 2 times the original recovery time
Copy link
Contributor

Choose a reason for hiding this comment

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

No need, that is too complicated. I think just return if the url is already in black list.

}

// Randomly shuffle the order to avoid always trying from the first URL
Collections.shuffle(healthy, ThreadLocalRandom.current());
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not shuffle. Because actually we always want to select the local one (with 127.0.0.1).
So the logic should be: Always try to select url with 127.0.0.1. If it is not available, select another one randomly.

List<String> prioritizedUrls = Lists.newArrayList();

// First: Add all healthy URLs
List<String> healthyUrls = getHealthyUrls();
Copy link
Contributor

Choose a reason for hiding this comment

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

You traverse the parsedUrls twice, both in getHealthyUrls() and in getBlacklistedUrls(), which is low efficiency. I think we can only traverse the list once.

  1. first, add 127.0.01 if available.
  2. add other available url.
  3. add url in black list

@zy-kkk zy-kkk force-pushed the sql_converter_multi_url branch from 008b2fa to f384cd7 Compare July 4, 2025 06:49
for (String url : allUrls) {
try {
String result = doConvertSql(url, requestStr);
if (result != null && !result.equals(originStmt)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why need this condition? !result.equals(originStmt)

}
}

LOG.warn("All URLs failed to convert SQL, return original SQL");
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this log, no useful info


public static String convertSql(String targetURL, String originStmt, String dialect,
// Cache URL manager instances to avoid duplicate parsing
private static final ConcurrentHashMap<String, UrlManager> urlManagerCache = new ConcurrentHashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to consider how to remove the unused entries.
So I suggest to use a Caffein Cache, and set a expire time so that it can remote unused entries automatically.

@zy-kkk zy-kkk force-pushed the sql_converter_multi_url branch from f384cd7 to 9c86e78 Compare July 7, 2025 09:50
@zy-kkk
Copy link
Member Author

zy-kkk commented Jul 7, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17629	5118	5014	5014
q2	1935	273	188	188
q3	10324	1307	708	708
q4	10214	1034	518	518
q5	7497	2364	2334	2334
q6	185	163	130	130
q7	911	735	584	584
q8	9323	1305	1079	1079
q9	6986	5266	5158	5158
q10	6909	2403	1962	1962
q11	490	316	281	281
q12	347	347	218	218
q13	17779	3695	3138	3138
q14	228	239	213	213
q15	547	480	475	475
q16	436	421	378	378
q17	591	864	362	362
q18	7694	7191	7228	7191
q19	1206	948	532	532
q20	328	358	226	226
q21	3945	3161	2352	2352
q22	368	326	298	298
Total cold run time: 105872 ms
Total hot run time: 33339 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5075	5075	5057	5057
q2	247	322	222	222
q3	2199	2692	2291	2291
q4	1415	1798	1335	1335
q5	4227	4356	4540	4356
q6	221	167	127	127
q7	2010	1959	1843	1843
q8	2599	2580	2557	2557
q9	7446	7452	7255	7255
q10	3127	3286	2880	2880
q11	589	505	493	493
q12	711	782	613	613
q13	3682	4011	3373	3373
q14	296	312	281	281
q15	517	479	490	479
q16	463	514	451	451
q17	1177	1601	1401	1401
q18	7971	7835	7688	7688
q19	837	832	880	832
q20	2025	2107	1945	1945
q21	5100	4543	4635	4543
q22	617	597	570	570
Total cold run time: 52551 ms
Total hot run time: 50592 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 188004 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 9c86e78e1c3c360630e1f3908d5c607c45ee9f05, data reload: false

query1	1023	394	402	394
query2	6529	1652	1648	1648
query3	6738	217	209	209
query4	27296	23354	23393	23354
query5	4414	598	449	449
query6	314	234	221	221
query7	4634	505	310	310
query8	270	227	222	222
query9	8650	2663	2651	2651
query10	476	322	270	270
query11	15360	15075	14877	14877
query12	163	107	103	103
query13	1663	544	421	421
query14	8531	6001	5989	5989
query15	212	192	183	183
query16	7551	445	300	300
query17	1287	716	573	573
query18	1994	433	297	297
query19	190	181	155	155
query20	121	118	115	115
query21	215	123	109	109
query22	4104	4437	4648	4437
query23	34899	34186	33778	33778
query24	8439	2432	2408	2408
query25	533	476	393	393
query26	1217	269	170	170
query27	2748	500	349	349
query28	4316	2141	2117	2117
query29	721	540	430	430
query30	294	225	193	193
query31	927	825	768	768
query32	71	62	58	58
query33	581	334	279	279
query34	804	851	547	547
query35	609	678	580	580
query36	945	987	904	904
query37	107	99	77	77
query38	4173	4205	4144	4144
query39	1450	1401	1428	1401
query40	209	123	108	108
query41	56	53	49	49
query42	120	107	108	107
query43	490	510	467	467
query44	1305	832	825	825
query45	185	169	170	169
query46	853	1028	636	636
query47	1757	1800	1734	1734
query48	400	415	298	298
query49	739	478	398	398
query50	652	694	415	415
query51	4246	4172	4092	4092
query52	109	109	104	104
query53	231	258	181	181
query54	585	584	504	504
query55	78	82	86	82
query56	296	302	288	288
query57	1182	1179	1097	1097
query58	268	272	267	267
query59	2557	2703	2517	2517
query60	325	328	302	302
query61	127	121	124	121
query62	785	720	685	685
query63	259	185	193	185
query64	4370	1186	832	832
query65	4313	4257	4214	4214
query66	1114	405	314	314
query67	15884	15464	15471	15464
query68	7961	930	541	541
query69	517	313	270	270
query70	1189	1082	1144	1082
query71	455	322	380	322
query72	5625	4785	4915	4785
query73	715	666	357	357
query74	9174	9442	9026	9026
query75	3480	3169	2679	2679
query76	3306	1138	750	750
query77	668	403	410	403
query78	10926	11091	10318	10318
query79	1638	792	584	584
query80	586	528	427	427
query81	473	253	224	224
query82	181	126	102	102
query83	262	254	243	243
query84	247	106	147	106
query85	759	372	312	312
query86	339	310	286	286
query87	4539	4526	4492	4492
query88	3255	2244	2227	2227
query89	379	322	283	283
query90	2044	205	201	201
query91	137	141	110	110
query92	77	65	55	55
query93	1608	969	605	605
query94	681	320	207	207
query95	374	297	281	281
query96	503	564	279	279
query97	2698	2728	2644	2644
query98	229	211	198	198
query99	1331	1401	1267	1267
Total cold run time: 274420 ms
Total hot run time: 188004 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.04
query2	0.08	0.04	0.04
query3	0.24	0.08	0.08
query4	1.61	0.11	0.11
query5	0.43	0.44	0.41
query6	1.19	0.65	0.67
query7	0.02	0.01	0.02
query8	0.05	0.04	0.03
query9	0.61	0.53	0.52
query10	0.58	0.57	0.57
query11	0.16	0.11	0.11
query12	0.15	0.12	0.11
query13	0.62	0.61	0.62
query14	0.81	0.82	0.81
query15	0.89	0.88	0.89
query16	0.39	0.38	0.38
query17	1.06	1.05	1.06
query18	0.23	0.22	0.21
query19	1.96	1.88	1.88
query20	0.01	0.02	0.01
query21	15.40	0.88	0.57
query22	0.78	1.21	0.64
query23	14.94	1.42	0.60
query24	6.92	1.89	0.99
query25	0.51	0.27	0.08
query26	0.60	0.17	0.13
query27	0.07	0.05	0.04
query28	9.73	0.82	0.44
query29	12.53	3.97	3.25
query30	0.25	0.10	0.07
query31	2.85	0.59	0.39
query32	3.24	0.57	0.47
query33	3.07	3.11	3.16
query34	16.05	5.47	4.79
query35	4.94	4.93	4.84
query36	0.69	0.52	0.51
query37	0.09	0.06	0.06
query38	0.05	0.04	0.05
query39	0.04	0.03	0.03
query40	0.18	0.14	0.15
query41	0.07	0.02	0.03
query42	0.03	0.03	0.02
query43	0.04	0.03	0.03
Total cold run time: 104.2 s
Total hot run time: 29.77 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 69.61% (71/102) 🎉
Increment coverage report
Complete coverage report

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

github-actions bot commented Jul 9, 2025

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2025

PR approved by anyone and no changes requested.

Copy link
Contributor

@kaka11chen kaka11chen left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman merged commit 8c3c54e into apache:master Jul 9, 2025
28 of 29 checks passed
github-actions bot pushed a commit that referenced this pull request Jul 9, 2025
#52636)

### What problem does this PR solve?

Problem Summary:


**Set up two service addresses**
```
Doris > set global sql_converter_service_url = 'http://127.0.0.1:5001/api/v1/convert,http://127.0.0.1:5002/api/v1/convert';
Query OK, 0 rows affected (0.04 sec)

Doris > set sql_dialect = 'clickhouse';
Query OK, 0 rows affected (0.05 sec)

Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
+--------------------+
| ELEMENT_AT(arr, 2) |
+--------------------+
|                  2 |
+--------------------+
1 row in set (0.11 sec)
```

 **Stop one of the services**
```
Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
+--------------------+
| ELEMENT_AT(arr, 2) |
+--------------------+
|                  2 |
+--------------------+
1 row in set (0.14 sec)
```

**Stopping all services resulted in expected errors**
```
Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
ERROR 1105 (HY000): errCode = 2, detailMessage = 
Every derived table must have its own alias(line 1, pos 33)

== SQL ==
SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr)
---------------------------------^^^

Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
ERROR 1105 (HY000): errCode = 2, detailMessage = 
Every derived table must have its own alias(line 1, pos 33)
== SQL ==
SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr)
---------------------------------^^^
```

**Restart one of the services**
```
Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
+--------------------+
| ELEMENT_AT(arr, 2) |
+--------------------+
|                  2 |
+--------------------+
1 row in set (0.16 sec)
```
github-actions bot pushed a commit that referenced this pull request Jul 9, 2025
#52636)

### What problem does this PR solve?

Problem Summary:


**Set up two service addresses**
```
Doris > set global sql_converter_service_url = 'http://127.0.0.1:5001/api/v1/convert,http://127.0.0.1:5002/api/v1/convert';
Query OK, 0 rows affected (0.04 sec)

Doris > set sql_dialect = 'clickhouse';
Query OK, 0 rows affected (0.05 sec)

Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
+--------------------+
| ELEMENT_AT(arr, 2) |
+--------------------+
|                  2 |
+--------------------+
1 row in set (0.11 sec)
```

 **Stop one of the services**
```
Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
+--------------------+
| ELEMENT_AT(arr, 2) |
+--------------------+
|                  2 |
+--------------------+
1 row in set (0.14 sec)
```

**Stopping all services resulted in expected errors**
```
Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
ERROR 1105 (HY000): errCode = 2, detailMessage = 
Every derived table must have its own alias(line 1, pos 33)

== SQL ==
SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr)
---------------------------------^^^

Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
ERROR 1105 (HY000): errCode = 2, detailMessage = 
Every derived table must have its own alias(line 1, pos 33)
== SQL ==
SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr)
---------------------------------^^^
```

**Restart one of the services**
```
Doris > SELECT arrayElement(arr, 2) FROM (SELECT [1, 2, 3] AS arr);
+--------------------+
| ELEMENT_AT(arr, 2) |
+--------------------+
|                  2 |
+--------------------+
1 row in set (0.16 sec)
```
morrySnow pushed a commit that referenced this pull request Jul 10, 2025
… service urls #52636 (#53027)

Cherry-picked from #52636

Co-authored-by: zy-kkk <zhongyk10@gmail.com>
dataroaring pushed a commit that referenced this pull request Jul 11, 2025
… service urls #52636 (#53026)

Cherry-picked from #52636

Co-authored-by: zy-kkk <zhongyk10@gmail.com>
@zy-kkk zy-kkk deleted the sql_converter_multi_url branch July 15, 2025 07:18
morningman added a commit to morningman/doris that referenced this pull request Jan 7, 2026
morningman added a commit to morningman/doris that referenced this pull request Jan 7, 2026
morningman added a commit that referenced this pull request Jan 7, 2026
…vice urls (#52636)" (#59610)

This may cause sql convertor read timeout
github-actions bot pushed a commit that referenced this pull request Jan 7, 2026
…vice urls (#52636)" (#59610)

This may cause sql convertor read timeout
github-actions bot pushed a commit that referenced this pull request Jan 7, 2026
…vice urls (#52636)" (#59610)

This may cause sql convertor read timeout
yiguolei pushed a commit that referenced this pull request Jan 7, 2026
zzzxl1993 pushed a commit to zzzxl1993/doris that referenced this pull request Jan 13, 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/3.0.7-merged dev/3.1.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants