Skip to content

[refine](Field) rename Tuple to Struct in BE core types#63093

Open
Mryange wants to merge 1 commit intoapache:masterfrom
Mryange:rename-tuple-to-struct
Open

[refine](Field) rename Tuple to Struct in BE core types#63093
Mryange wants to merge 1 commit intoapache:masterfrom
Mryange:rename-tuple-to-struct

Conversation

@Mryange
Copy link
Copy Markdown
Contributor

@Mryange Mryange commented May 9, 2026

What problem does this PR solve?

Issue Number: N/A

Problem Summary:

The C++ struct Tuple in be/src/core/field.h is a type alias for FieldVector used to represent STRUCT-typed field values. However, the name "Tuple"
is misleading — this type corresponds to the STRUCT data type, not a tuple. This rename aligns the C++ type name with the actual semantic: Tuple
→ Struct, along with all references in comments, error messages, and variable names.

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?

@Mryange
Copy link
Copy Markdown
Contributor Author

Mryange commented May 9, 2026

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I found one blocking issue: the PR introduces a formatting regression in a BE core header comment. The type rename itself is mechanically consistent in the changed code, and I did not find a behavior, serialization, concurrency, memory tracking, lifecycle, or FE/BE protocol issue.

Critical checkpoint conclusions:

  • Goal/test: The goal is to rename the BE Field storage type from Tuple to Struct; the changed code appears to accomplish this. Existing affected unit tests were updated, but no test run is reported here.
  • Scope: The change is small and focused.
  • Concurrency/lifecycle/config/compatibility: Not applicable; this is a local type/comment rename with no new runtime state, config, wire format, or storage format change.
  • Parallel paths: The main TYPE_STRUCT Field construction/use paths touched by this rename are updated; remaining Tuple references found are unrelated runtime tuple descriptors, std::tuple usage, or existing nested-type comments outside the changed symbol.
  • Tests/results: Existing tests were updated only for compilation naming; no generated outputs are involved.
  • Observability/transactions/data writes: Not applicable.
  • Performance: No performance-impacting logic changes found.

User focus: no additional user-provided focus was present.

Comment thread be/src/core/column/column.h Outdated
* Example: simple columns like UInt64 or FixedString store their values contiguously in single memory buffer.
*
* Example: Tuple store values of each component in separate subcolumn, so the values of Tuples with at least two components are not contiguous.
* Example: Struct stores values of each component in separate subcolumn, so the values of Structs with at least two components are not contiguous.
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.

This line lost the indentation used by the surrounding Doxygen block. BE C++ formatting is enforced by build-support/check-format.sh, and this changed line is now visibly misaligned with the adjacent * prefixes. Please keep the original comment indentation while applying the rename.

Suggested change
* Example: Struct stores values of each component in separate subcolumn, so the values of Structs with at least two components are not contiguous.
* Example: Struct stores values of each component in separate subcolumn, so the values of Structs with at least two components are not contiguous.

@Mryange
Copy link
Copy Markdown
Contributor Author

Mryange commented May 9, 2026

run buildall

@Mryange Mryange force-pushed the rename-tuple-to-struct branch from f810a69 to 77d1414 Compare May 9, 2026 03:08
@Mryange
Copy link
Copy Markdown
Contributor Author

Mryange commented May 9, 2026

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review result: no additional blocking issues found in the current head diff.

Critical checkpoint conclusions:

  • Goal and tests: The PR renames the BE Field C++ storage wrapper for TYPE_STRUCT from Tuple to Struct and updates directly affected call sites/tests. The current diff is consistent with that goal; existing struct-related tests are updated, though I did not run them in this review environment.
  • Scope: The change is small and focused on BE core type naming plus related test call sites.
  • Concurrency/lifecycle: No new concurrency, locks, thread lifecycle, or static initialization behavior is introduced.
  • Configuration/compatibility: No new configuration, serialized format, thrift protocol, storage format, or user-visible SQL behavior change was found. TYPE_STRUCT semantics and serialization paths remain unchanged.
  • Parallel paths: I checked remaining Tuple references. Remaining production references are comments in unrelated runtime/config tuple-row contexts or existing non-code comments, not missed uses of the renamed Field storage type in the changed path.
  • Error handling: No new Status/Exception propagation issue was introduced by the rename. The changed exception messages remain consistent with ColumnStruct semantics.
  • Tests/results: No new result files are introduced. The touched unit tests only update construction from Tuple to Struct.
  • Observability/performance/memory: No new logging/metrics need was identified; no new allocations, hot-path copies, COW-column mutation patterns, or memory tracking changes are introduced.

User focus: .opencode-review.KIRx2t/review_focus.txt contains no additional focus points, so I performed the normal full PR review.

Existing review context: I did not duplicate the already-known inline thread about column.h Doxygen indentation; that file is not part of the current PR files returned by GitHub for head 77d1414.

@Mryange
Copy link
Copy Markdown
Contributor Author

Mryange commented May 9, 2026

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 30060 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 77d141449c51962d4f49941d615b4e1a56e86313, 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	17703	4010	3952	3952
q2	q3	10707	887	614	614
q4	4661	458	358	358
q5	7458	1352	1156	1156
q6	196	176	146	146
q7	914	950	764	764
q8	9303	1478	1341	1341
q9	5526	5340	5334	5334
q10	6254	2105	1807	1807
q11	466	277	263	263
q12	628	428	305	305
q13	18068	3329	2768	2768
q14	294	285	263	263
q15	q16	906	871	791	791
q17	951	1040	866	866
q18	6543	5737	5621	5621
q19	1298	1351	1126	1126
q20	550	413	273	273
q21	4850	2459	1980	1980
q22	491	427	332	332
Total cold run time: 97767 ms
Total hot run time: 30060 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	4845	4844	4929	4844
q2	q3	4679	4793	4205	4205
q4	2105	2185	1400	1400
q5	5011	5085	5274	5085
q6	214	185	141	141
q7	2157	1784	1618	1618
q8	3376	3109	3101	3101
q9	8376	8536	8484	8484
q10	4499	4469	4263	4263
q11	599	408	391	391
q12	703	752	521	521
q13	3287	3674	2912	2912
q14	307	312	280	280
q15	q16	761	783	695	695
q17	1586	1331	1317	1317
q18	7974	7192	7203	7192
q19	1180	1196	1191	1191
q20	2263	2233	1954	1954
q21	6132	5428	4868	4868
q22	555	514	424	424
Total cold run time: 60609 ms
Total hot run time: 54886 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 170561 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 77d141449c51962d4f49941d615b4e1a56e86313, data reload: false

query5	4303	674	523	523
query6	332	223	205	205
query7	4226	570	306	306
query8	337	231	234	231
query9	8820	4037	4009	4009
query10	460	350	306	306
query11	5820	2450	2156	2156
query12	184	139	127	127
query13	1290	634	411	411
query14	6025	5395	5054	5054
query14_1	4365	4367	4372	4367
query15	215	206	182	182
query16	1017	409	435	409
query17	1123	772	647	647
query18	2459	511	359	359
query19	231	216	178	178
query20	136	135	132	132
query21	216	139	119	119
query22	13732	13932	14530	13932
query23	17568	16488	16212	16212
query23_1	16298	16186	16310	16186
query24	7401	1729	1345	1345
query24_1	1336	1304	1369	1304
query25	573	497	446	446
query26	1326	317	163	163
query27	2766	626	348	348
query28	4456	1958	1950	1950
query29	1012	631	510	510
query30	304	231	196	196
query31	1102	1075	929	929
query32	87	70	68	68
query33	533	343	296	296
query34	1157	1144	632	632
query35	795	789	659	659
query36	1311	1319	1112	1112
query37	149	100	84	84
query38	3213	3121	3060	3060
query39	915	921	894	894
query39_1	875	864	858	858
query40	230	158	141	141
query41	65	62	60	60
query42	109	106	109	106
query43	319	326	283	283
query44	
query45	212	196	189	189
query46	1020	1212	729	729
query47	2254	2270	2125	2125
query48	399	403	289	289
query49	690	525	438	438
query50	716	296	226	226
query51	4330	4345	4164	4164
query52	106	102	94	94
query53	259	282	200	200
query54	314	270	252	252
query55	93	95	82	82
query56	302	313	330	313
query57	1396	1358	1291	1291
query58	301	266	289	266
query59	1584	1660	1360	1360
query60	368	338	319	319
query61	163	163	154	154
query62	651	626	556	556
query63	241	206	202	202
query64	2443	845	703	703
query65	
query66	1731	514	388	388
query67	30168	30013	29831	29831
query68	
query69	456	337	306	306
query70	1055	985	981	981
query71	313	278	301	278
query72	3016	2735	2482	2482
query73	831	760	448	448
query74	5098	4941	4734	4734
query75	2774	2655	2311	2311
query76	2281	1132	747	747
query77	424	420	347	347
query78	12994	12951	12392	12392
query79	1536	1065	738	738
query80	905	598	491	491
query81	489	283	236	236
query82	1319	158	132	132
query83	356	287	259	259
query84	268	143	110	110
query85	915	525	456	456
query86	452	358	299	299
query87	3445	3362	3237	3237
query88	3631	2671	2676	2671
query89	446	386	331	331
query90	1798	186	183	183
query91	180	169	138	138
query92	80	76	70	70
query93	976	1002	560	560
query94	620	341	316	316
query95	677	463	352	352
query96	1005	781	342	342
query97	2696	2710	2531	2531
query98	244	235	229	229
query99	1143	1094	981	981
Total cold run time: 254062 ms
Total hot run time: 170561 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 36.36% (4/11) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.91% (27072/37649)
Line Coverage 55.20% (287971/521725)
Region Coverage 52.13% (238124/456786)
Branch Coverage 53.56% (102936/192205)

@Mryange
Copy link
Copy Markdown
Contributor Author

Mryange commented May 9, 2026

run Vault_P0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants