Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](func) Fix precision loss in ST_GeometryFromWKB coordinate parsing #46661

Merged
merged 13 commits into from
Jan 21, 2025

Conversation

felixwluo
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #46619

Root Cause:

1. Unnecessary floating-point number conversions in coordinate handling:
   1.1 converting double to string using absl::StrFormat
   1.2 converting string back to double using std::stod
each conversion caused precision loss.

2. Byte order handling issue in WKB parsing:
    2.1 using machine endian before properly reading WKB byte order flag
    2.2 this caused incorrect interpretation of coordinate values

Solution:

1. Remove unnecessary coordinate value conversions:
    1.1 directly use S2LatLng's degrees() value without string formatting
    1.2 increase output precision in print_s2point to 15 digits

2. Fix WKB byte order handling:
    2.1 read byte order flag first
    2.2 set correct byte order before parsing coordinates

Result:
before:

POINT (1.461652102e-231 3.34424828009e-59)

after:

POINT(117.194767000297 36.46326301008)

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?

@felixwluo
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17611	6179	6083	6083
q2	2050	312	167	167
q3	10583	1223	729	729
q4	10265	862	443	443
q5	7546	2283	2002	2002
q6	208	186	153	153
q7	911	749	644	644
q8	9244	1398	1226	1226
q9	5890	4903	4979	4903
q10	6783	2305	1843	1843
q11	487	277	252	252
q12	351	369	230	230
q13	17759	3674	3117	3117
q14	232	233	209	209
q15	570	512	489	489
q16	637	619	587	587
q17	570	838	336	336
q18	6820	6555	6335	6335
q19	3202	997	576	576
q20	305	310	183	183
q21	2802	2136	1980	1980
q22	365	326	297	297
Total cold run time: 105191 ms
Total hot run time: 32784 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6298	6223	6238	6223
q2	234	330	234	234
q3	2259	2611	2290	2290
q4	1413	1807	1312	1312
q5	4361	4767	4883	4767
q6	189	178	144	144
q7	2070	2008	1860	1860
q8	2662	2795	2721	2721
q9	7341	7273	7286	7273
q10	3045	3356	2726	2726
q11	594	501	490	490
q12	693	775	688	688
q13	3540	3869	3212	3212
q14	282	313	297	297
q15	565	510	518	510
q16	653	666	663	663
q17	1220	1736	1274	1274
q18	7737	7512	7485	7485
q19	871	1175	1094	1094
q20	1970	2071	1873	1873
q21	5771	5284	4959	4959
q22	625	652	592	592
Total cold run time: 54393 ms
Total hot run time: 52687 ms

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 38.87% (10130/26061)
Line Coverage: 29.93% (85731/286485)
Region Coverage: 29.02% (43736/150711)
Branch Coverage: 25.56% (22323/87344)
Coverage Report: http://coverage.selectdb-in.cc/coverage/3b33354e29e883dd01e2a2679d33ccee3eda9282_3b33354e29e883dd01e2a2679d33ccee3eda9282/report/index.html

@doris-robot
Copy link

TPC-DS: Total hot run time: 195086 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 3b33354e29e883dd01e2a2679d33ccee3eda9282, data reload: false

query1	1308	906	944	906
query2	6423	2388	2303	2303
query3	10961	4526	4792	4526
query4	33016	23700	23671	23671
query5	4844	627	450	450
query6	296	205	197	197
query7	3991	492	312	312
query8	311	254	258	254
query9	9269	2630	2634	2630
query10	487	326	245	245
query11	18142	15302	15009	15009
query12	159	107	109	107
query13	1592	530	416	416
query14	10305	7096	7154	7096
query15	260	203	179	179
query16	8116	616	448	448
query17	1589	759	589	589
query18	2139	417	304	304
query19	205	181	147	147
query20	125	117	115	115
query21	204	124	107	107
query22	4560	4690	4306	4306
query23	34641	33477	33344	33344
query24	6570	2271	2301	2271
query25	462	448	395	395
query26	784	270	161	161
query27	2168	464	338	338
query28	5376	2500	2464	2464
query29	572	597	419	419
query30	208	181	152	152
query31	932	914	809	809
query32	90	57	54	54
query33	473	349	293	293
query34	779	840	506	506
query35	799	833	759	759
query36	1032	1067	954	954
query37	125	101	75	75
query38	4238	4264	4051	4051
query39	1520	1478	1448	1448
query40	204	114	97	97
query41	44	41	44	41
query42	120	102	104	102
query43	526	526	498	498
query44	1352	813	820	813
query45	181	173	164	164
query46	889	1066	652	652
query47	1917	1887	1833	1833
query48	398	418	325	325
query49	705	479	392	392
query50	661	675	392	392
query51	7098	6989	7073	6989
query52	106	102	90	90
query53	223	262	178	178
query54	505	492	413	413
query55	84	87	77	77
query56	256	255	233	233
query57	1183	1204	1140	1140
query58	244	238	217	217
query59	3225	3494	3287	3287
query60	271	263	256	256
query61	112	110	112	110
query62	833	800	721	721
query63	233	186	190	186
query64	3698	1048	658	658
query65	3305	3188	3212	3188
query66	782	409	309	309
query67	16399	15702	15450	15450
query68	8493	691	516	516
query69	484	289	261	261
query70	1206	1160	1138	1138
query71	429	276	260	260
query72	6318	3902	3897	3897
query73	660	736	353	353
query74	9794	8932	8964	8932
query75	3864	3142	2633	2633
query76	3698	1180	768	768
query77	774	370	273	273
query78	10808	10036	9444	9444
query79	3772	783	590	590
query80	712	557	433	433
query81	494	265	223	223
query82	604	152	213	152
query83	193	164	141	141
query84	288	94	75	75
query85	746	383	304	304
query86	353	329	298	298
query87	4295	4267	4232	4232
query88	4274	2139	2108	2108
query89	401	300	292	292
query90	1876	184	180	180
query91	136	134	103	103
query92	69	56	49	49
query93	1042	738	537	537
query94	639	401	286	286
query95	337	259	249	249
query96	486	593	275	275
query97	2826	2939	2872	2872
query98	221	200	192	192
query99	1572	1508	1399	1399
Total cold run time: 296489 ms
Total hot run time: 195086 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.04
query2	0.07	0.03	0.04
query3	0.23	0.07	0.06
query4	1.62	0.11	0.11
query5	0.42	0.42	0.41
query6	1.15	0.66	0.66
query7	0.03	0.02	0.02
query8	0.05	0.03	0.04
query9	0.58	0.51	0.50
query10	0.55	0.57	0.55
query11	0.15	0.11	0.11
query12	0.14	0.12	0.11
query13	0.61	0.59	0.59
query14	2.72	2.83	2.75
query15	0.89	0.81	0.82
query16	0.40	0.39	0.39
query17	1.06	1.08	1.08
query18	0.24	0.22	0.20
query19	1.86	1.82	2.03
query20	0.02	0.00	0.01
query21	15.38	0.92	0.58
query22	0.76	0.79	0.77
query23	15.16	1.36	0.58
query24	2.53	1.00	1.17
query25	0.17	0.19	0.13
query26	0.22	0.14	0.13
query27	0.06	0.06	0.05
query28	14.12	1.57	1.05
query29	12.57	4.04	3.32
query30	0.26	0.09	0.06
query31	2.84	0.60	0.39
query32	3.23	0.55	0.46
query33	3.14	3.20	3.11
query34	16.79	5.10	4.45
query35	4.50	4.47	4.52
query36	0.76	0.50	0.51
query37	0.09	0.06	0.06
query38	0.04	0.03	0.03
query39	0.04	0.03	0.03
query40	0.17	0.14	0.13
query41	0.08	0.02	0.02
query42	0.03	0.03	0.02
query43	0.03	0.03	0.03
Total cold run time: 105.79 s
Total hot run time: 31.63 s

@felixwluo
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17573	6138	6020	6020
q2	2046	296	163	163
q3	10632	1194	760	760
q4	10198	852	428	428
q5	7537	2137	1996	1996
q6	203	182	149	149
q7	908	746	606	606
q8	9224	1344	1136	1136
q9	5312	4843	4907	4843
q10	6778	2301	1848	1848
q11	477	275	248	248
q12	355	371	216	216
q13	17772	3661	3007	3007
q14	239	228	217	217
q15	571	505	522	505
q16	637	610	599	599
q17	587	855	329	329
q18	7074	6561	6400	6400
q19	2002	950	561	561
q20	306	310	180	180
q21	2791	2245	1992	1992
q22	358	338	305	305
Total cold run time: 103580 ms
Total hot run time: 32508 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6249	6152	6200	6152
q2	239	318	238	238
q3	2216	2631	2336	2336
q4	1391	1823	1364	1364
q5	4312	4743	4705	4705
q6	189	175	142	142
q7	2057	1970	1788	1788
q8	2608	2823	2652	2652
q9	7263	7199	7251	7199
q10	3058	3318	2875	2875
q11	572	505	494	494
q12	638	701	575	575
q13	3508	3799	3264	3264
q14	302	304	286	286
q15	576	513	504	504
q16	673	689	650	650
q17	1254	1720	1265	1265
q18	7626	7542	7301	7301
q19	834	1058	1117	1058
q20	2000	2069	1898	1898
q21	5816	5228	4845	4845
q22	604	650	591	591
Total cold run time: 53985 ms
Total hot run time: 52182 ms

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 38.87% (10129/26061)
Line Coverage: 29.92% (85718/286503)
Region Coverage: 29.02% (43745/150721)
Branch Coverage: 25.57% (22334/87352)
Coverage Report: http://coverage.selectdb-in.cc/coverage/b3e6a7f2b6d3d1b9923e8f0fe57a508572440f2c_b3e6a7f2b6d3d1b9923e8f0fe57a508572440f2c/report/index.html

@doris-robot
Copy link

TPC-DS: Total hot run time: 195277 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 b3e6a7f2b6d3d1b9923e8f0fe57a508572440f2c, data reload: false

query1	1279	950	919	919
query2	6154	2324	2341	2324
query3	11004	4637	4628	4628
query4	33344	23468	23753	23468
query5	5738	600	450	450
query6	293	191	176	176
query7	4190	481	297	297
query8	295	230	217	217
query9	9381	2646	2645	2645
query10	542	307	255	255
query11	18108	15134	15275	15134
query12	152	104	104	104
query13	1648	527	399	399
query14	10852	7425	7462	7425
query15	254	202	185	185
query16	7862	619	472	472
query17	1476	751	579	579
query18	2121	402	335	335
query19	210	185	156	156
query20	123	113	109	109
query21	207	125	115	115
query22	4381	4566	4346	4346
query23	34933	33187	33227	33187
query24	6119	2301	2273	2273
query25	454	453	391	391
query26	754	246	154	154
query27	2218	469	338	338
query28	5345	2488	2463	2463
query29	546	534	412	412
query30	203	186	147	147
query31	944	893	834	834
query32	84	61	64	61
query33	458	340	294	294
query34	748	865	510	510
query35	814	821	753	753
query36	974	1048	972	972
query37	113	101	76	76
query38	4279	4214	4369	4214
query39	1511	1478	1431	1431
query40	199	117	111	111
query41	46	42	42	42
query42	125	105	105	105
query43	540	563	502	502
query44	1316	816	847	816
query45	184	166	166	166
query46	881	1045	653	653
query47	1932	1897	1844	1844
query48	386	402	323	323
query49	700	510	389	389
query50	659	666	403	403
query51	7028	6956	7028	6956
query52	104	97	90	90
query53	225	249	179	179
query54	474	487	404	404
query55	82	79	79	79
query56	256	276	246	246
query57	1182	1187	1152	1152
query58	234	231	229	229
query59	3082	3247	2986	2986
query60	285	283	265	265
query61	137	132	132	132
query62	850	807	759	759
query63	240	193	206	193
query64	3298	1126	724	724
query65	3320	3252	3221	3221
query66	747	420	304	304
query67	16468	15803	15512	15512
query68	9590	690	526	526
query69	511	290	251	251
query70	1221	1151	1094	1094
query71	456	280	250	250
query72	6484	3926	3798	3798
query73	645	740	365	365
query74	10200	8896	8699	8699
query75	4746	3141	2654	2654
query76	4672	1166	753	753
query77	821	358	277	277
query78	10010	10037	9421	9421
query79	3436	791	570	570
query80	712	513	439	439
query81	487	282	227	227
query82	622	153	122	122
query83	180	157	145	145
query84	275	95	84	84
query85	799	359	310	310
query86	352	311	298	298
query87	4433	4393	4380	4380
query88	3729	2155	2159	2155
query89	415	327	296	296
query90	1904	182	184	182
query91	128	130	105	105
query92	61	58	52	52
query93	1325	865	539	539
query94	625	397	283	283
query95	326	265	247	247
query96	482	618	284	284
query97	2877	2948	2851	2851
query98	216	206	193	193
query99	1694	1470	1394	1394
Total cold run time: 299525 ms
Total hot run time: 195277 ms

@doris-robot
Copy link

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

query1	0.03	0.04	0.03
query2	0.07	0.03	0.03
query3	0.24	0.07	0.06
query4	1.61	0.10	0.11
query5	0.42	0.42	0.41
query6	1.14	0.65	0.66
query7	0.02	0.02	0.02
query8	0.04	0.04	0.03
query9	0.60	0.50	0.51
query10	0.56	0.55	0.55
query11	0.14	0.10	0.10
query12	0.14	0.10	0.11
query13	0.60	0.61	0.60
query14	2.74	2.83	2.72
query15	0.90	0.81	0.82
query16	0.39	0.38	0.40
query17	1.05	1.02	1.00
query18	0.23	0.21	0.21
query19	1.96	1.75	2.02
query20	0.01	0.01	0.01
query21	15.36	0.92	0.60
query22	0.75	0.89	0.72
query23	15.11	1.47	0.53
query24	3.55	1.30	1.17
query25	0.21	0.17	0.11
query26	0.21	0.14	0.13
query27	0.05	0.05	0.06
query28	14.00	1.51	1.05
query29	12.55	3.99	3.28
query30	0.25	0.09	0.06
query31	2.83	0.59	0.39
query32	3.23	0.53	0.46
query33	3.08	3.10	3.08
query34	16.81	5.12	4.51
query35	4.49	4.47	4.44
query36	0.65	0.50	0.49
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.04	0.02	0.02
query40	0.17	0.13	0.12
query41	0.08	0.03	0.02
query42	0.03	0.02	0.03
query43	0.04	0.03	0.03
Total cold run time: 106.52 s
Total hot run time: 31.44 s

@felixwluo felixwluo requested a review from LemonLiTree January 9, 2025 04:09
double value = S2LatLng::Longitude(*_point).degrees();
// Handle values very close to integers
double rounded = round(value);
if (std::abs(value - rounded) < 1e-13) { // 使用更大的阈值
Copy link
Contributor

Choose a reason for hiding this comment

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

please use english, thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@zclllyybb
Copy link
Contributor

I will review this PR later

@felixwluo
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17578	5445	5342	5342
q2	2038	298	168	168
q3	10530	1333	717	717
q4	10276	955	540	540
q5	8907	2423	2163	2163
q6	192	170	133	133
q7	915	757	620	620
q8	9239	1361	1208	1208
q9	5190	4823	4944	4823
q10	6813	2349	1889	1889
q11	463	271	256	256
q12	333	371	215	215
q13	17762	3681	3103	3103
q14	225	241	223	223
q15	507	476	447	447
q16	637	612	600	600
q17	565	868	316	316
q18	7030	6383	6236	6236
q19	1800	936	513	513
q20	306	318	184	184
q21	2760	2138	1953	1953
q22	361	324	314	314
Total cold run time: 104427 ms
Total hot run time: 31963 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5561	5457	5478	5457
q2	236	329	227	227
q3	2219	2661	2349	2349
q4	1443	1810	1362	1362
q5	4313	4760	4631	4631
q6	164	159	129	129
q7	2110	1993	1886	1886
q8	2595	2812	2679	2679
q9	7405	7256	7445	7256
q10	3012	3268	2838	2838
q11	594	523	509	509
q12	658	763	631	631
q13	3464	3938	3243	3243
q14	278	302	270	270
q15	503	476	455	455
q16	630	701	657	657
q17	1188	1737	1257	1257
q18	7785	7445	7335	7335
q19	762	1133	1049	1049
q20	1987	2058	1886	1886
q21	5667	5264	4948	4948
q22	593	574	583	574
Total cold run time: 53167 ms
Total hot run time: 51628 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 188143 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 fa12fe97d979d00fb0e99f42067aacac0280b4de, data reload: false

query1	982	385	386	385
query2	6522	2077	2016	2016
query3	6797	217	220	217
query4	33591	23210	23104	23104
query5	4342	608	462	462
query6	293	199	187	187
query7	4612	480	299	299
query8	294	243	244	243
query9	9410	2627	2652	2627
query10	485	316	242	242
query11	18251	15250	14890	14890
query12	149	102	103	102
query13	1659	513	400	400
query14	10085	6858	7295	6858
query15	268	195	183	183
query16	8062	664	489	489
query17	1625	748	560	560
query18	2111	418	306	306
query19	225	194	156	156
query20	122	111	112	111
query21	205	123	102	102
query22	4277	4525	4408	4408
query23	33920	33049	32883	32883
query24	6485	2232	2333	2232
query25	523	473	441	441
query26	1214	291	151	151
query27	1985	462	327	327
query28	5324	2463	2450	2450
query29	709	531	412	412
query30	244	187	160	160
query31	949	846	798	798
query32	85	69	64	64
query33	516	357	296	296
query34	746	848	497	497
query35	815	801	721	721
query36	1020	1037	948	948
query37	115	98	83	83
query38	4158	4187	4075	4075
query39	1427	1393	1398	1393
query40	207	112	100	100
query41	52	49	54	49
query42	118	104	100	100
query43	518	539	496	496
query44	1300	818	822	818
query45	187	176	168	168
query46	844	1034	642	642
query47	1818	1851	1771	1771
query48	387	394	322	322
query49	776	516	402	402
query50	614	671	395	395
query51	6914	6936	6753	6753
query52	105	104	92	92
query53	227	243	183	183
query54	477	495	401	401
query55	85	78	82	78
query56	271	266	247	247
query57	1139	1178	1086	1086
query58	248	231	255	231
query59	2957	3082	2994	2994
query60	296	280	253	253
query61	119	116	122	116
query62	762	710	655	655
query63	227	190	184	184
query64	4388	1010	638	638
query65	3247	3163	3171	3163
query66	1111	402	316	316
query67	16140	15763	15604	15604
query68	4518	811	533	533
query69	475	287	271	271
query70	1209	1168	1147	1147
query71	378	336	264	264
query72	5878	3802	3825	3802
query73	654	736	356	356
query74	9539	9313	9111	9111
query75	3147	3199	2644	2644
query76	3130	1163	776	776
query77	482	381	284	284
query78	10037	10008	9447	9447
query79	2851	811	603	603
query80	684	526	438	438
query81	529	270	241	241
query82	241	151	124	124
query83	168	176	152	152
query84	247	98	76	76
query85	810	365	298	298
query86	393	318	310	310
query87	4530	4562	4333	4333
query88	4749	2199	2183	2183
query89	389	337	297	297
query90	1978	194	195	194
query91	132	144	108	108
query92	68	59	53	53
query93	2574	863	527	527
query94	670	398	312	312
query95	350	269	253	253
query96	492	624	295	295
query97	2749	2864	2735	2735
query98	293	199	209	199
query99	1317	1369	1242	1242
Total cold run time: 285797 ms
Total hot run time: 188143 ms

@felixwluo
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17597	5462	5360	5360
q2	2053	286	167	167
q3	10465	1256	710	710
q4	10222	983	525	525
q5	7549	2378	2166	2166
q6	199	163	132	132
q7	924	756	623	623
q8	9245	1352	1149	1149
q9	5225	4985	4919	4919
q10	6814	2358	1905	1905
q11	465	268	255	255
q12	338	367	215	215
q13	17774	3686	3109	3109
q14	236	237	208	208
q15	534	491	458	458
q16	635	618	601	601
q17	561	852	322	322
q18	7117	6437	6468	6437
q19	1222	950	518	518
q20	314	325	191	191
q21	2840	2172	1940	1940
q22	367	325	321	321
Total cold run time: 102696 ms
Total hot run time: 32231 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5462	5470	5506	5470
q2	230	322	232	232
q3	2258	2681	2309	2309
q4	1402	1818	1344	1344
q5	4286	4772	4581	4581
q6	158	159	121	121
q7	1950	1871	1732	1732
q8	2460	2668	2595	2595
q9	6966	6906	6921	6906
q10	2860	3164	2651	2651
q11	554	502	482	482
q12	646	745	574	574
q13	3284	3712	3028	3028
q14	268	282	257	257
q15	502	460	459	459
q16	654	664	630	630
q17	1165	1693	1205	1205
q18	7114	7214	7032	7032
q19	727	1055	1056	1055
q20	1890	1964	1858	1858
q21	5331	5067	4840	4840
q22	583	585	595	585
Total cold run time: 50750 ms
Total hot run time: 49946 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187136 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 79544da497fe035da7603ee6e9977dda5035b401, data reload: false

query1	967	402	375	375
query2	6540	2005	2027	2005
query3	6795	219	216	216
query4	33222	23668	22845	22845
query5	4735	608	430	430
query6	280	189	196	189
query7	4607	501	307	307
query8	279	224	213	213
query9	9641	2630	2637	2630
query10	471	307	246	246
query11	18098	15079	15067	15067
query12	157	108	106	106
query13	1658	506	396	396
query14	9811	7434	6224	6224
query15	267	202	197	197
query16	7966	618	440	440
query17	1584	723	563	563
query18	2105	398	300	300
query19	208	178	157	157
query20	125	113	113	113
query21	215	124	102	102
query22	4485	4432	4266	4266
query23	33775	33168	33141	33141
query24	6426	2291	2215	2215
query25	490	451	419	419
query26	1202	266	156	156
query27	2029	462	324	324
query28	5344	2426	2389	2389
query29	699	537	411	411
query30	231	180	159	159
query31	977	869	829	829
query32	83	61	58	58
query33	498	353	293	293
query34	740	857	489	489
query35	806	817	736	736
query36	1005	1010	949	949
query37	136	103	78	78
query38	4231	4141	4063	4063
query39	1433	1401	1417	1401
query40	198	115	101	101
query41	52	51	51	51
query42	121	104	103	103
query43	514	514	491	491
query44	1296	808	808	808
query45	176	174	165	165
query46	853	1024	636	636
query47	1828	1876	1802	1802
query48	373	402	323	323
query49	765	492	393	393
query50	616	670	390	390
query51	6921	7014	6805	6805
query52	102	99	91	91
query53	217	268	176	176
query54	475	502	395	395
query55	78	81	79	79
query56	249	265	243	243
query57	1190	1146	1104	1104
query58	249	225	235	225
query59	2883	3028	2920	2920
query60	274	275	270	270
query61	129	118	116	116
query62	828	694	651	651
query63	222	186	189	186
query64	4364	1023	637	637
query65	3259	3129	3155	3129
query66	1073	408	307	307
query67	15896	15709	15526	15526
query68	4643	818	531	531
query69	432	290	252	252
query70	1214	1157	1150	1150
query71	383	282	262	262
query72	5819	3771	3801	3771
query73	638	758	367	367
query74	10079	9101	8950	8950
query75	3172	3150	2702	2702
query76	3219	1192	763	763
query77	485	356	283	283
query78	10096	10474	9482	9482
query79	2289	910	602	602
query80	694	516	432	432
query81	525	269	233	233
query82	310	158	122	122
query83	181	172	155	155
query84	237	99	75	75
query85	733	363	310	310
query86	396	325	316	316
query87	4526	4434	4328	4328
query88	3832	2187	2164	2164
query89	461	328	301	301
query90	1928	192	196	192
query91	135	136	111	111
query92	68	63	55	55
query93	1510	830	536	536
query94	665	412	297	297
query95	337	264	259	259
query96	487	604	296	296
query97	2747	2876	2769	2769
query98	242	199	199	199
query99	1299	1411	1251	1251
Total cold run time: 283304 ms
Total hot run time: 187136 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.04
query2	0.07	0.03	0.03
query3	0.23	0.07	0.06
query4	1.61	0.10	0.11
query5	0.42	0.42	0.42
query6	1.14	0.66	0.66
query7	0.02	0.01	0.02
query8	0.04	0.03	0.03
query9	0.58	0.49	0.51
query10	0.56	0.57	0.55
query11	0.14	0.10	0.10
query12	0.14	0.11	0.12
query13	0.60	0.60	0.60
query14	2.85	2.72	2.72
query15	0.90	0.83	0.82
query16	0.41	0.40	0.38
query17	0.97	1.01	1.07
query18	0.22	0.20	0.20
query19	1.96	1.83	2.00
query20	0.02	0.02	0.01
query21	15.36	0.87	0.57
query22	0.77	0.76	0.62
query23	15.38	1.46	0.64
query24	2.57	1.08	0.65
query25	0.18	0.15	0.14
query26	0.25	0.14	0.13
query27	0.05	0.07	0.07
query28	13.88	1.06	0.42
query29	12.57	3.93	3.25
query30	0.25	0.09	0.06
query31	2.83	0.57	0.37
query32	3.22	0.55	0.46
query33	2.93	3.06	3.00
query34	16.58	5.19	4.54
query35	4.62	4.51	4.58
query36	0.65	0.48	0.48
query37	0.10	0.06	0.06
query38	0.04	0.04	0.03
query39	0.03	0.02	0.03
query40	0.16	0.14	0.12
query41	0.08	0.02	0.02
query42	0.03	0.03	0.02
query43	0.03	0.02	0.02
Total cold run time: 105.47 s
Total hot run time: 30.36 s

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 41.52% (10820/26059)
Line Coverage: 31.92% (91442/286454)
Region Coverage: 31.07% (46853/150789)
Branch Coverage: 27.16% (23724/87350)
Coverage Report: http://coverage.selectdb-in.cc/coverage/79544da497fe035da7603ee6e9977dda5035b401_79544da497fe035da7603ee6e9977dda5035b401/report/index.html

@felixwluo
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17568	5568	5411	5411
q2	2052	319	173	173
q3	10563	1277	717	717
q4	10286	957	535	535
q5	9038	2459	2169	2169
q6	197	168	139	139
q7	928	759	610	610
q8	9233	1325	1151	1151
q9	5209	4909	4896	4896
q10	6834	2353	1877	1877
q11	466	284	266	266
q12	346	358	222	222
q13	17768	3894	3164	3164
q14	248	232	207	207
q15	522	472	465	465
q16	636	617	580	580
q17	570	874	332	332
q18	7210	6483	6345	6345
q19	1901	938	528	528
q20	314	320	192	192
q21	2786	2186	1939	1939
q22	367	335	318	318
Total cold run time: 105042 ms
Total hot run time: 32236 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5627	5528	5472	5472
q2	235	327	239	239
q3	2277	2655	2345	2345
q4	1420	1788	1359	1359
q5	4321	4764	4739	4739
q6	184	168	126	126
q7	2105	2022	1856	1856
q8	2627	2811	2661	2661
q9	7272	7240	7242	7240
q10	3005	3273	2818	2818
q11	591	523	496	496
q12	698	765	623	623
q13	3529	3925	3304	3304
q14	285	282	286	282
q15	522	481	463	463
q16	636	692	647	647
q17	1204	1758	1268	1268
q18	7700	7499	7292	7292
q19	766	1156	1033	1033
q20	2024	2027	1866	1866
q21	5513	5164	4902	4902
q22	608	601	580	580
Total cold run time: 53149 ms
Total hot run time: 51611 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 188594 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 49e6db033d85bb131d3966fedc1e119d756ee9f0, data reload: false

query1	959	380	376	376
query2	6515	2056	2051	2051
query3	6976	224	218	218
query4	33433	23621	23303	23303
query5	4341	621	442	442
query6	287	194	222	194
query7	4603	500	310	310
query8	298	244	233	233
query9	9532	2634	2627	2627
query10	473	306	248	248
query11	17841	15383	14951	14951
query12	166	103	103	103
query13	1663	520	403	403
query14	9369	6850	6833	6833
query15	238	196	191	191
query16	7887	618	470	470
query17	1594	727	541	541
query18	1976	387	284	284
query19	226	185	160	160
query20	116	110	109	109
query21	212	123	102	102
query22	4290	4499	4127	4127
query23	33766	33036	33062	33036
query24	6747	2247	2211	2211
query25	477	429	384	384
query26	1215	267	153	153
query27	2041	458	324	324
query28	5375	2468	2413	2413
query29	668	537	403	403
query30	234	184	162	162
query31	971	895	778	778
query32	74	63	58	58
query33	507	351	291	291
query34	728	869	514	514
query35	787	810	740	740
query36	1006	1023	921	921
query37	112	94	77	77
query38	4181	4178	4119	4119
query39	1450	1381	1427	1381
query40	207	114	102	102
query41	55	59	54	54
query42	123	108	106	106
query43	526	526	488	488
query44	1287	828	828	828
query45	186	175	169	169
query46	845	1054	628	628
query47	1869	1844	1809	1809
query48	385	397	331	331
query49	772	503	413	413
query50	600	702	386	386
query51	6942	6909	6902	6902
query52	102	101	93	93
query53	220	243	186	186
query54	478	480	433	433
query55	85	77	108	77
query56	260	260	237	237
query57	1198	1154	1063	1063
query58	254	225	225	225
query59	2914	3196	3102	3102
query60	269	274	266	266
query61	121	114	114	114
query62	820	734	657	657
query63	226	192	186	186
query64	4184	996	716	716
query65	3262	3152	3156	3152
query66	1103	435	324	324
query67	15925	15550	15553	15550
query68	2422	822	556	556
query69	406	306	269	269
query70	1229	1099	1143	1099
query71	328	301	273	273
query72	5762	3789	3868	3789
query73	632	745	360	360
query74	9702	9180	9028	9028
query75	3128	3149	2798	2798
query76	2202	1165	785	785
query77	398	352	295	295
query78	9942	9951	9355	9355
query79	2615	806	603	603
query80	1677	534	461	461
query81	577	279	238	238
query82	355	147	172	147
query83	259	171	155	155
query84	230	89	80	80
query85	772	345	296	296
query86	470	313	294	294
query87	4443	4495	4516	4495
query88	4108	2168	2139	2139
query89	380	327	291	291
query90	1915	194	202	194
query91	134	139	106	106
query92	66	57	52	52
query93	1805	848	524	524
query94	709	418	293	293
query95	328	275	256	256
query96	488	613	291	291
query97	2740	2851	2786	2786
query98	222	212	195	195
query99	1279	1361	1253	1253
Total cold run time: 280275 ms
Total hot run time: 188594 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.07	0.04	0.04
query3	0.23	0.07	0.06
query4	1.62	0.10	0.10
query5	0.43	0.43	0.42
query6	1.13	0.64	0.65
query7	0.02	0.02	0.01
query8	0.04	0.03	0.03
query9	0.59	0.51	0.52
query10	0.55	0.56	0.55
query11	0.14	0.10	0.10
query12	0.14	0.10	0.11
query13	0.62	0.61	0.60
query14	2.85	2.85	2.74
query15	0.90	0.83	0.84
query16	0.40	0.38	0.37
query17	1.07	1.00	0.99
query18	0.23	0.21	0.20
query19	1.95	1.98	1.80
query20	0.02	0.01	0.02
query21	15.40	0.95	0.58
query22	0.75	0.76	0.74
query23	15.25	1.41	0.56
query24	2.94	1.82	1.90
query25	0.11	0.19	0.09
query26	0.28	0.14	0.13
query27	0.06	0.07	0.04
query28	14.45	0.95	0.43
query29	12.57	3.97	3.30
query30	0.25	0.10	0.06
query31	2.83	0.60	0.39
query32	3.23	0.56	0.46
query33	2.97	3.01	3.01
query34	16.52	5.19	4.54
query35	4.57	4.53	4.54
query36	0.64	0.49	0.49
query37	0.10	0.06	0.06
query38	0.05	0.04	0.03
query39	0.03	0.03	0.02
query40	0.16	0.14	0.13
query41	0.08	0.03	0.03
query42	0.04	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 106.35 s
Total hot run time: 31.61 s

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.06	0.04	0.03
query3	0.25	0.06	0.07
query4	1.61	0.11	0.10
query5	0.43	0.42	0.41
query6	1.17	0.66	0.67
query7	0.02	0.02	0.01
query8	0.04	0.04	0.03
query9	0.60	0.51	0.50
query10	0.54	0.57	0.56
query11	0.14	0.10	0.11
query12	0.14	0.11	0.10
query13	0.62	0.60	0.60
query14	2.72	2.83	2.75
query15	0.91	0.83	0.83
query16	0.38	0.38	0.38
query17	1.09	1.08	1.07
query18	0.23	0.22	0.20
query19	2.02	1.81	1.98
query20	0.01	0.01	0.01
query21	15.38	0.94	0.58
query22	0.75	0.84	0.68
query23	15.23	1.49	0.58
query24	3.20	1.28	1.09
query25	0.23	0.07	0.12
query26	0.40	0.15	0.14
query27	0.05	0.05	0.05
query28	13.45	1.02	0.44
query29	12.59	3.90	3.24
query30	0.24	0.09	0.06
query31	2.81	0.60	0.39
query32	3.22	0.55	0.46
query33	3.02	3.09	2.99
query34	16.62	5.14	4.50
query35	4.52	4.49	4.58
query36	0.64	0.49	0.50
query37	0.09	0.06	0.06
query38	0.04	0.03	0.03
query39	0.04	0.02	0.03
query40	0.18	0.13	0.12
query41	0.07	0.02	0.02
query42	0.04	0.02	0.02
query43	0.03	0.02	0.02
Total cold run time: 105.85 s
Total hot run time: 30.78 s

@felixwluo
Copy link
Contributor Author

run cloud_p0

uint32_t typeInt = ctx->dis.readUnsigned();

// Check if geometry has SRID
bool has_srid = (typeInt & 0x20000000) != 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

for magic numbers, we should define it as constexpr variable with comment giving its source and explaining what does it do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@felixwluo
Copy link
Contributor Author

run buildall

@felixwluo
Copy link
Contributor Author

run buildall

Copy link
Contributor

@zclllyybb zclllyybb left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17652	5506	5358	5358
q2	2077	324	181	181
q3	10544	1195	747	747
q4	10235	969	523	523
q5	8157	2386	2139	2139
q6	198	165	131	131
q7	886	779	603	603
q8	9256	1322	1132	1132
q9	5223	4883	4872	4872
q10	6830	2326	1872	1872
q11	466	275	254	254
q12	332	355	211	211
q13	17777	3677	3146	3146
q14	245	231	212	212
q15	523	475	462	462
q16	627	621	593	593
q17	562	857	347	347
q18	6954	6479	6372	6372
q19	3212	948	544	544
q20	300	310	187	187
q21	2779	2174	1988	1988
q22	371	334	308	308
Total cold run time: 105206 ms
Total hot run time: 32182 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5610	5505	5486	5486
q2	239	326	234	234
q3	2271	2675	2324	2324
q4	1372	1846	1368	1368
q5	4343	4737	4671	4671
q6	176	163	130	130
q7	2034	1988	1774	1774
q8	2608	2756	2649	2649
q9	7270	7227	7246	7227
q10	3039	3260	2806	2806
q11	563	529	488	488
q12	644	722	581	581
q13	3642	3964	3335	3335
q14	280	292	264	264
q15	531	459	482	459
q16	665	684	647	647
q17	1223	1750	1277	1277
q18	7645	7616	7379	7379
q19	806	992	1147	992
q20	2004	2032	1915	1915
q21	5669	5133	4916	4916
q22	610	637	571	571
Total cold run time: 53244 ms
Total hot run time: 51493 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 193752 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 5c4a825324c7abc6611160f237e0529dffe73384, data reload: false

query1	1335	960	920	920
query2	6429	2194	2162	2162
query3	11100	4591	4557	4557
query4	32678	23341	22988	22988
query5	3622	599	461	461
query6	279	205	191	191
query7	3985	496	309	309
query8	320	241	240	240
query9	9311	2601	2572	2572
query10	468	328	261	261
query11	17618	15668	14934	14934
query12	178	115	107	107
query13	1566	527	390	390
query14	9902	7346	6466	6466
query15	261	222	186	186
query16	7121	627	535	535
query17	1588	780	600	600
query18	1951	396	313	313
query19	236	184	164	164
query20	131	121	117	117
query21	207	126	103	103
query22	4628	4455	4434	4434
query23	34263	33584	33530	33530
query24	6390	2357	2252	2252
query25	486	467	398	398
query26	717	285	154	154
query27	2033	476	328	328
query28	5302	2476	2434	2434
query29	583	551	417	417
query30	222	192	161	161
query31	969	897	801	801
query32	84	59	59	59
query33	484	351	302	302
query34	759	900	528	528
query35	833	879	790	790
query36	1014	1074	943	943
query37	124	97	74	74
query38	4331	4423	4262	4262
query39	1487	1444	1450	1444
query40	202	114	103	103
query41	52	51	52	51
query42	122	99	102	99
query43	529	548	495	495
query44	1464	836	831	831
query45	177	175	173	173
query46	892	1075	654	654
query47	1902	1880	1851	1851
query48	381	420	342	342
query49	713	494	401	401
query50	683	692	415	415
query51	7100	7049	6736	6736
query52	110	105	91	91
query53	231	266	188	188
query54	497	505	429	429
query55	86	81	81	81
query56	266	266	251	251
query57	1210	1192	1169	1169
query58	252	235	226	226
query59	3335	3341	3036	3036
query60	307	285	263	263
query61	119	111	136	111
query62	819	722	705	705
query63	227	187	196	187
query64	3045	1037	633	633
query65	3254	3201	3166	3166
query66	771	395	303	303
query67	15910	15732	15531	15531
query68	6211	838	524	524
query69	492	295	267	267
query70	1177	1084	1140	1084
query71	394	308	277	277
query72	5843	3900	3821	3821
query73	650	754	349	349
query74	10278	9237	8922	8922
query75	3207	3141	2658	2658
query76	3093	1206	771	771
query77	472	362	273	273
query78	10075	10011	9327	9327
query79	3376	840	582	582
query80	726	550	463	463
query81	494	274	245	245
query82	651	157	117	117
query83	176	175	159	159
query84	248	97	73	73
query85	779	341	303	303
query86	345	301	302	301
query87	4626	4752	4470	4470
query88	4719	2148	2129	2129
query89	416	321	292	292
query90	1823	191	190	190
query91	139	141	115	115
query92	68	57	54	54
query93	2015	921	526	526
query94	699	425	296	296
query95	340	290	257	257
query96	493	623	284	284
query97	2765	2878	2769	2769
query98	235	198	192	192
query99	1582	1397	1254	1254
Total cold run time: 288258 ms
Total hot run time: 193752 ms

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 41.57% (10832/26060)
Line Coverage: 31.95% (91548/286491)
Region Coverage: 31.09% (46888/150825)
Branch Coverage: 27.17% (23746/87386)
Coverage Report: http://coverage.selectdb-in.cc/coverage/5c4a825324c7abc6611160f237e0529dffe73384_5c4a825324c7abc6611160f237e0529dffe73384/report/index.html

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.08	0.03	0.03
query3	0.23	0.07	0.06
query4	1.63	0.11	0.11
query5	0.42	0.42	0.39
query6	1.14	0.64	0.64
query7	0.02	0.01	0.02
query8	0.03	0.03	0.03
query9	0.60	0.50	0.50
query10	0.56	0.57	0.55
query11	0.13	0.10	0.10
query12	0.14	0.11	0.10
query13	0.60	0.59	0.59
query14	2.73	2.73	2.73
query15	0.90	0.83	0.83
query16	0.38	0.38	0.38
query17	1.03	1.05	1.05
query18	0.23	0.20	0.20
query19	1.95	1.83	2.00
query20	0.01	0.01	0.01
query21	15.40	0.88	0.57
query22	0.75	1.04	0.69
query23	15.03	1.41	0.59
query24	2.94	0.85	1.44
query25	0.14	0.21	0.18
query26	0.29	0.14	0.14
query27	0.06	0.06	0.06
query28	13.75	1.02	0.44
query29	12.58	3.98	3.29
query30	0.24	0.08	0.06
query31	2.84	0.57	0.38
query32	3.24	0.56	0.46
query33	2.99	3.02	3.06
query34	16.61	5.32	4.60
query35	4.64	4.47	4.51
query36	0.84	0.49	0.49
query37	0.10	0.06	0.06
query38	0.04	0.04	0.03
query39	0.03	0.02	0.02
query40	0.16	0.12	0.13
query41	0.07	0.03	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 105.65 s
Total hot run time: 30.76 s

Copy link
Contributor

@HappenLee HappenLee left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

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

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jan 21, 2025
@HappenLee HappenLee merged commit 8493e59 into apache:master Jan 21, 2025
22 of 24 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 21, 2025
…ng (#46661)

### What problem does this PR solve?

Issue Number: close #46619

Root Cause:
```
1. Unnecessary floating-point number conversions in coordinate handling:
   1.1 converting double to string using absl::StrFormat
   1.2 converting string back to double using std::stod
each conversion caused precision loss.

2. Byte order handling issue in WKB parsing:
    2.1 using machine endian before properly reading WKB byte order flag
    2.2 this caused incorrect interpretation of coordinate values
```

Solution:
```
1. Remove unnecessary coordinate value conversions:
    1.1 directly use S2LatLng's degrees() value without string formatting
    1.2 increase output precision in print_s2point to 15 digits

2. Fix WKB byte order handling:
    2.1 read byte order flag first
    2.2 set correct byte order before parsing coordinates
```

Result:
 before:
 ```
 POINT (1.461652102e-231 3.34424828009e-59)
 ```
 after:
 ```
 POINT(117.194767000297 36.46326301008)
 ```
github-actions bot pushed a commit that referenced this pull request Jan 21, 2025
…ng (#46661)

### What problem does this PR solve?

Issue Number: close #46619

Root Cause:
```
1. Unnecessary floating-point number conversions in coordinate handling:
   1.1 converting double to string using absl::StrFormat
   1.2 converting string back to double using std::stod
each conversion caused precision loss.

2. Byte order handling issue in WKB parsing:
    2.1 using machine endian before properly reading WKB byte order flag
    2.2 this caused incorrect interpretation of coordinate values
```

Solution:
```
1. Remove unnecessary coordinate value conversions:
    1.1 directly use S2LatLng's degrees() value without string formatting
    1.2 increase output precision in print_s2point to 15 digits

2. Fix WKB byte order handling:
    2.1 read byte order flag first
    2.2 set correct byte order before parsing coordinates
```

Result:
 before:
 ```
 POINT (1.461652102e-231 3.34424828009e-59)
 ```
 after:
 ```
 POINT(117.194767000297 36.46326301008)
 ```
yiguolei pushed a commit that referenced this pull request Jan 24, 2025
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/2.1.9-merged dev/3.0.x reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] function ST_GeometryFromWKB result diff between doris and postgis
6 participants