Skip to content

[fix](catalog) Keep the TIME scale that connectors declare - #70351

Open
morningman wants to merge 1 commit into
apache:masterfrom
morningman:b2m-t38d-timev2-scale
Open

morningman wants to merge 1 commit into
apache:masterfrom
morningman:b2m-t38d-timev2-scale

Conversation

@morningman

Copy link
Copy Markdown
Contributor

Background

Connector plugins (Hudi, and the coming Lance connector) describe their columns with the SPI's ConnectorType, and fe-core's ConnectorColumnConverter turns each into a Doris type. Connectors put a temporal column's fractional-second scale in the type's precision field: ("DATETIMEV2", 3, 0) is datetime(3), and Hudi's HudiTypeMapping sends ("TIMEV2", 3, 0) for an Avro time-millis column and ("TIMEV2", 6, 0) for time-micros.

What problem does this PR solve?

Issue Number: None
Related PR: #62183 (introduced the converter without a TIMEV2 case), #64304 (moved Hudi onto it)
PR Type: Bugfix

Problem Summary:

Since Hudi became a connector plugin, its time-millis and time-micros columns show as time instead of time(3) and time(6), which is what 4.x shows and what HudiTypeMapping asks for: the converter drops the scale and builds a scale-0 TIMEV2. The Lance connector, ported in a follow-up, maps Arrow time32(ms) and time64 the same way and would lose its scale too. The converter now reads the TIMEV2 scale from the precision field, as it already does for DATETIMEV2.

Details

  • Frequency: Always, for every connector column whose ConnectorType is TIMEV2 with a scale; today that is every Hudi time-millis / time-micros column on master. Found while porting the Lance connector, by reading the converter, and confirmed by the unit test below.
  • Root cause: ConnectorColumnConverter.convertScalarType reads the precision field for CHAR, VARCHAR, VARBINARY, the decimals, DATETIMEV2 and TIMESTAMPTZ, but has no TIMEV2 case, so TIMEV2 falls through to ScalarType.createType("TIMEV2"), which returns the scale-0 ScalarType.TIMEV2.
  • Why existing tests missed it: Unit tests: ConnectorColumnConverterTest checks decimals, CHAR/VARCHAR lengths and the TIMESTAMPTZ extra info but has no TIMEV2 case, and HudiTypeMappingTest asserts the ("TIMEV2", 3, 0) the plugin emits but stops before fe-core converts it. Regression: no suite under regression-test/suites reads a Hudi time column.
  • Fix: The TIMEV2 case uses the precision field as the scale when one is given; without one the type stays the scale-0 TIMEV2 it has always been. The fix sits in the converter because every connector goes through it. The reverse direction, toConnectorType, is unchanged: only the read-only Hudi and Lance connectors produce TIMEV2, and the JDBC connector maps TIME to STRING.
  • Other paths and branches: toConnectorType is not affected for reads (see Fix). branch-4.1 and branch-4.2 are not affected: they have no ConnectorColumnConverter, and their fe-core Hudi mapping (HudiUtils) builds createTimeV2Type(3) / createTimeV2Type(6) directly. The bug is on master since [refactor](catalog) decouple external catalogs from FE core into loadable connector plugins #64304.

Testing

  • ConnectorColumnConverterTest#timeScaleRidesInThePrecisionSlot (new): fails before the fix with expected: <timev2(3)> but was: <timev2(0)> and passes after; it also pins that a TIMEV2 without a precision stays scale 0. Run locally on master f5c993f2c94 with [fix](catalog) Mask connector catalog secrets and the ALTER CATALOG audit text #70338 applied, which touches neither file.
  • ConnectorColumnConverterTest (35 tests) and HudiTypeMappingTest (17 tests): pass locally on the same tree.

Release note

None

Check List (For Author)

  • Behavior changed: No
  • Does this need documentation: No
  • Pre-submission status: Ready

AI Disclosure

  • Tool: Claude Code (Claude Opus 5.5)
  • Generated: code, tests, this description
  • Human review: not stated
  • Prompts: The author asked to port the branch-4.2 Lance FE read path to master as a connector plugin; this fix came out of that port, and the author's rule for such finds is to fix them in their own PR.

### Background

Connector plugins (Hudi, and the coming Lance connector) describe their columns with the SPI's `ConnectorType`, and fe-core's `ConnectorColumnConverter` turns each into a Doris type. Connectors put a temporal column's fractional-second scale in the type's precision field: `("DATETIMEV2", 3, 0)` is `datetime(3)`, and Hudi's `HudiTypeMapping` sends `("TIMEV2", 3, 0)` for an Avro `time-millis` column and `("TIMEV2", 6, 0)` for `time-micros`.

### What problem does this PR solve?

Issue Number: None
Related PR: apache#62183 (introduced the converter without a TIMEV2 case), apache#64304 (moved Hudi onto it)
PR Type: Bugfix

Problem Summary:

Since Hudi became a connector plugin, its `time-millis` and `time-micros` columns show as `time` instead of `time(3)` and `time(6)`, which is what 4.x shows and what `HudiTypeMapping` asks for: the converter drops the scale and builds a scale-0 TIMEV2. The Lance connector, ported in a follow-up, maps Arrow `time32(ms)` and `time64` the same way and would lose its scale too. The converter now reads the TIMEV2 scale from the precision field, as it already does for DATETIMEV2.

### Details

- **Frequency:** Always, for every connector column whose `ConnectorType` is TIMEV2 with a scale; today that is every Hudi `time-millis` / `time-micros` column on master. Found while porting the Lance connector, by reading the converter, and confirmed by the unit test below.
- **Root cause:** `ConnectorColumnConverter.convertScalarType` reads the precision field for CHAR, VARCHAR, VARBINARY, the decimals, DATETIMEV2 and TIMESTAMPTZ, but has no TIMEV2 case, so TIMEV2 falls through to `ScalarType.createType("TIMEV2")`, which returns the scale-0 `ScalarType.TIMEV2`.
- **Why existing tests missed it:** Unit tests: `ConnectorColumnConverterTest` checks decimals, CHAR/VARCHAR lengths and the TIMESTAMPTZ extra info but has no TIMEV2 case, and `HudiTypeMappingTest` asserts the `("TIMEV2", 3, 0)` the plugin emits but stops before fe-core converts it. Regression: no suite under `regression-test/suites` reads a Hudi time column.
- **Fix:** The TIMEV2 case uses the precision field as the scale when one is given; without one the type stays the scale-0 TIMEV2 it has always been. The fix sits in the converter because every connector goes through it. The reverse direction, `toConnectorType`, is unchanged: only the read-only Hudi and Lance connectors produce TIMEV2, and the JDBC connector maps TIME to STRING.
- **Other paths and branches:** `toConnectorType` is not affected for reads (see Fix). branch-4.1 and branch-4.2 are not affected: they have no `ConnectorColumnConverter`, and their fe-core Hudi mapping (`HudiUtils`) builds `createTimeV2Type(3)` / `createTimeV2Type(6)` directly. The bug is on master since apache#64304.

### Testing

- `ConnectorColumnConverterTest#timeScaleRidesInThePrecisionSlot` (new): fails before the fix with `expected: <timev2(3)> but was: <timev2(0)>` and passes after; it also pins that a TIMEV2 without a precision stays scale 0. Run locally on master `f5c993f2c94` with apache#70338 applied, which touches neither file.
- `ConnectorColumnConverterTest` (35 tests) and `HudiTypeMappingTest` (17 tests): pass locally on the same tree.

### Release note

None

### Check List (For Author)

- Behavior changed: No
- Does this need documentation: No
- Pre-submission status: Ready

### AI Disclosure

- Tool: Claude Code (Claude Opus 5.5)
- Generated: code, tests, this description
- Human review: not stated
- Prompts: The author asked to port the branch-4.2 Lance FE read path to master as a connector plugin; this fix came out of that port, and the author's rule for such finds is to fix them in their own PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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?

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@morningman

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17588	5117	5062	5062
q2	2139	304	250	250
q3	10268	1439	825	825
q4	4680	461	341	341
q5	7437	792	531	531
q6	180	185	152	152
q7	747	788	598	598
q8	9251	1333	1092	1092
q9	5453	4179	4185	4179
q10	6829	1282	1000	1000
q11	420	250	222	222
q12	639	401	275	275
q13	18100	3645	3042	3042
q14	280	267	245	245
q15	q16	712	703	660	660
q17	1186	752	589	589
q18	6926	6189	6094	6094
q19	1109	941	573	573
q20	374	346	221	221
q21	5066	2516	2411	2411
q22	372	327	274	274
Total cold run time: 99756 ms
Total hot run time: 28636 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	6024	5931	6130	5931
q2	756	609	587	587
q3	5693	5820	5295	5295
q4	2065	2108	1558	1558
q5	5716	5795	5677	5677
q6	238	185	141	141
q7	2237	2023	1837	1837
q8	2969	2718	2689	2689
q9	7974	7492	7472	7472
q10	3634	3549	3117	3117
q11	571	413	382	382
q12	663	653	499	499
q13	3273	3630	3058	3058
q14	281	281	269	269
q15	q16	650	683	617	617
q17	7792	7057	6844	6844
q18	13147	12241	12890	12241
q19	884	767	825	767
q20	2138	2135	1880	1880
q21	5544	4533	4649	4533
q22	486	450	410	410
Total cold run time: 72735 ms
Total hot run time: 65804 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 154547 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 9a484e822f46f275c2970450d44358edf6f44717, data reload: false

query5	4323	512	386	386
query6	432	202	207	202
query7	4818	422	230	230
query8	326	174	159	159
query9	8787	3198	3212	3198
query10	469	309	264	264
query11	6009	3839	3577	3577
query12	150	95	89	89
query13	1241	444	342	342
query14	6157	3988	3686	3686
query14_1	3415	3397	3494	3397
query15	208	203	181	181
query16	971	484	443	443
query17	933	650	540	540
query18	2436	429	316	316
query19	204	171	137	137
query20	89	84	81	81
query21	214	127	112	112
query22	12925	13041	12684	12684
query23	13568	13073	12614	12614
query23_1	12581	12572	12581	12572
query24	7388	839	477	477
query24_1	479	486	494	486
query25	540	426	359	359
query26	1261	260	140	140
query27	2779	443	273	273
query28	4573	2056	2083	2056
query29	1572	605	460	460
query30	306	222	184	184
query31	1013	925	826	826
query32	153	92	92	92
query33	525	304	251	251
query34	900	862	512	512
query35	742	755	622	622
query36	816	835	771	771
query37	126	103	87	87
query38	1756	1738	1694	1694
query39	787	823	746	746
query39_1	739	727	733	727
query40	220	118	108	108
query41	73	67	66	66
query42	87	89	85	85
query43	341	359	312	312
query44	1328	715	726	715
query45	184	180	170	170
query46	823	979	570	570
query47	2945	2996	2802	2802
query48	349	305	216	216
query49	571	416	294	294
query50	673	266	223	223
query51	10562	10647	10701	10647
query52	78	81	70	70
query53	193	215	147	147
query54	240	198	178	178
query55	69	62	68	62
query56	235	205	217	205
query57	1662	1631	1596	1596
query58	283	283	263	263
query59	2170	2206	2036	2036
query60	278	243	225	225
query61	148	147	148	147
query62	385	331	311	311
query63	193	156	152	152
query64	2748	914	799	799
query65	3358	3274	3266	3266
query66	1766	408	310	310
query67	22649	22642	22435	22435
query68	2978	1007	630	630
query69	406	282	256	256
query70	842	751	751	751
query71	304	228	218	218
query72	2724	2583	2318	2318
query73	508	522	297	297
query74	4606	4530	4353	4353
query75	2327	2295	1932	1932
query76	2320	1028	596	596
query77	341	381	268	268
query78	9755	9667	9199	9199
query79	997	912	534	534
query80	743	435	358	358
query81	542	311	275	275
query82	574	134	112	112
query83	276	194	199	194
query84	292	118	105	105
query85	923	420	372	372
query86	341	235	231	231
query87	2008	1938	1811	1811
query88	3782	2824	2782	2782
query89	335	291	248	248
query90	1921	168	166	166
query91	158	152	126	126
query92	102	89	93	89
query93	1013	987	591	591
query94	561	311	277	277
query95	563	333	301	301
query96	682	492	240	240
query97	2471	2410	2366	2366
query98	165	157	146	146
query99	766	770	660	660
Total cold run time: 237346 ms
Total hot run time: 154547 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.10	0.05	0.05
query3	0.26	0.09	0.09
query4	1.61	0.08	0.09
query5	0.23	0.25	0.24
query6	1.18	0.68	0.68
query7	0.04	0.01	0.00
query8	0.05	0.04	0.04
query9	0.39	0.31	0.35
query10	0.62	0.58	0.59
query11	0.20	0.14	0.14
query12	0.18	0.14	0.14
query13	0.50	0.49	0.52
query14	1.04	1.02	1.02
query15	0.65	0.61	0.60
query16	0.35	0.35	0.34
query17	1.12	1.11	1.10
query18	0.20	0.20	0.20
query19	2.12	2.06	1.98
query20	0.02	0.02	0.01
query21	15.48	0.19	0.14
query22	4.90	0.06	0.05
query23	16.31	0.33	0.12
query24	1.09	0.23	0.17
query25	0.09	0.04	0.04
query26	0.74	0.20	0.16
query27	0.04	0.03	0.03
query28	3.76	0.80	0.37
query29	12.47	4.18	3.24
query30	0.28	0.13	0.10
query31	2.76	0.55	0.33
query32	3.22	0.60	0.50
query33	3.25	3.13	3.16
query34	15.24	4.01	3.37
query35	3.31	3.35	3.34
query36	0.56	0.46	0.46
query37	0.09	0.06	0.06
query38	0.05	0.04	0.03
query39	0.04	0.03	0.03
query40	0.16	0.15	0.14
query41	0.08	0.03	0.03
query42	0.03	0.04	0.04
query43	0.04	0.04	0.04
Total cold run time: 94.86 s
Total hot run time: 24.02 s

@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.

Static review of PR #70351 at head 9a484e8 converged after 2 rounds. The TIMEV2 converter now reads the ConnectorType precision slot as the fractional scale, matching the current Hudi mappings for Avro time-millis/time-micros (3/6); omitted precision still produces the legacy scale-0 TIMEV2. All current FE conversion and schema-cache callers preserve the resulting ScalarType scale, and the current Lance mapping is a BE-side path that does not use this converter. No new P0/P1/P2/P3 finding was verified, and there are no existing blocking inline comment IDs applicable to this head. FE locking, exception/RPC-boundary, visible-version, and external-catalog initialization/reset checkpoints are not implicated by these two changed files. No additional user review focus was supplied. The pre-existing Hudi MOR/JNI rejection of Avro TIME logical types and the hypothetical future-plugin case of a TIMEV2 precision above Doris's scale-6 limit were inspected and dismissed as outside the changed reachable behavior; they are retained as coverage notes. Validation was static inspection only under the review contract; no builds or tests were executed.

Review converged after 2 round(s).

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

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

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17647	5194	5364	5194
q2	2162	302	263	263
q3	10224	1369	808	808
q4	4681	458	332	332
q5	7413	785	513	513
q6	183	188	151	151
q7	745	788	605	605
q8	9253	1359	1035	1035
q9	5501	4206	4194	4194
q10	6808	1293	1025	1025
q11	427	238	227	227
q12	634	392	276	276
q13	18077	3568	3020	3020
q14	269	266	250	250
q15	q16	725	715	650	650
q17	1184	744	584	584
q18	6978	6163	6122	6122
q19	1124	984	608	608
q20	360	329	237	237
q21	5047	2428	2446	2428
q22	373	335	260	260
Total cold run time: 99815 ms
Total hot run time: 28782 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5951	5930	5879	5879
q2	689	597	577	577
q3	5626	5680	5419	5419
q4	2065	2150	1542	1542
q5	5846	5714	5812	5714
q6	236	183	172	172
q7	2210	2008	1799	1799
q8	2843	2471	2482	2471
q9	7494	7462	7498	7462
q10	3655	3574	3137	3137
q11	582	400	380	380
q12	669	664	496	496
q13	3283	3609	3019	3019
q14	292	285	266	266
q15	q16	657	673	622	622
q17	7898	7012	6876	6876
q18	12967	12212	12795	12212
q19	900	778	783	778
q20	2136	2144	1906	1906
q21	5617	4586	4629	4586
q22	484	451	390	390
Total cold run time: 72100 ms
Total hot run time: 65703 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 154121 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 9a484e822f46f275c2970450d44358edf6f44717, data reload: false

query5	4299	543	410	410
query6	432	208	194	194
query7	4814	466	229	229
query8	317	170	147	147
query9	8778	3191	3234	3191
query10	489	321	259	259
query11	6069	3899	3564	3564
query12	149	90	91	90
query13	1256	449	320	320
query14	6135	3952	3640	3640
query14_1	3413	3448	3358	3358
query15	212	205	185	185
query16	966	438	337	337
query17	897	651	528	528
query18	2409	425	296	296
query19	188	183	142	142
query20	88	82	79	79
query21	206	131	108	108
query22	12932	12954	12904	12904
query23	13476	12670	12387	12387
query23_1	12446	12634	12737	12634
query24	7382	849	462	462
query24_1	463	478	465	465
query25	527	413	342	342
query26	1265	268	139	139
query27	2771	455	272	272
query28	4595	2046	2044	2044
query29	1548	610	443	443
query30	297	220	178	178
query31	1004	934	809	809
query32	143	85	93	85
query33	511	300	233	233
query34	897	903	515	515
query35	756	774	649	649
query36	789	793	773	773
query37	125	101	91	91
query38	1782	1746	1665	1665
query39	787	791	745	745
query39_1	736	727	743	727
query40	233	125	101	101
query41	71	69	68	68
query42	89	85	83	83
query43	351	401	312	312
query44	1406	705	708	705
query45	182	180	163	163
query46	905	1023	596	596
query47	2706	2900	2856	2856
query48	305	339	227	227
query49	587	434	311	311
query50	751	294	219	219
query51	10741	10527	10539	10527
query52	85	85	82	82
query53	206	231	156	156
query54	247	232	201	201
query55	75	73	72	72
query56	234	246	233	233
query57	1660	1666	1557	1557
query58	302	271	269	269
query59	2185	2172	2051	2051
query60	301	263	233	233
query61	170	169	172	169
query62	395	356	289	289
query63	205	164	160	160
query64	2879	970	761	761
query65	3333	3252	3242	3242
query66	1766	436	299	299
query67	22665	22576	22509	22509
query68	3126	1041	617	617
query69	380	294	249	249
query70	849	763	771	763
query71	292	238	207	207
query72	2651	2628	2275	2275
query73	538	561	295	295
query74	4619	4517	4351	4351
query75	2456	2303	1894	1894
query76	2311	1114	614	614
query77	354	387	274	274
query78	9731	9730	9151	9151
query79	1043	908	525	525
query80	587	430	351	351
query81	544	311	260	260
query82	595	148	116	116
query83	279	218	198	198
query84	330	128	102	102
query85	823	429	362	362
query86	280	251	236	236
query87	1985	1951	1808	1808
query88	3811	2768	2754	2754
query89	354	284	242	242
query90	2000	175	165	165
query91	165	152	122	122
query92	99	93	92	92
query93	1085	1027	582	582
query94	549	330	285	285
query95	584	376	307	307
query96	694	508	237	237
query97	2439	2444	2390	2390
query98	167	155	154	154
query99	789	768	653	653
Total cold run time: 237532 ms
Total hot run time: 154121 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.10	0.05	0.05
query3	0.26	0.08	0.08
query4	1.61	0.10	0.11
query5	0.23	0.25	0.24
query6	1.17	0.67	0.68
query7	0.04	0.01	0.01
query8	0.05	0.03	0.04
query9	0.40	0.34	0.34
query10	0.57	0.56	0.61
query11	0.20	0.14	0.13
query12	0.18	0.14	0.15
query13	0.48	0.50	0.48
query14	1.03	1.02	1.01
query15	0.64	0.61	0.61
query16	0.34	0.34	0.35
query17	1.20	1.17	1.17
query18	0.19	0.18	0.18
query19	2.16	2.06	1.97
query20	0.02	0.01	0.01
query21	15.49	0.20	0.14
query22	4.79	0.05	0.05
query23	16.27	0.32	0.13
query24	1.10	0.24	0.16
query25	0.10	0.05	0.03
query26	0.75	0.22	0.16
query27	0.03	0.03	0.03
query28	3.70	0.77	0.35
query29	12.50	4.03	3.20
query30	0.28	0.12	0.10
query31	2.77	0.54	0.33
query32	3.21	0.60	0.50
query33	3.13	3.18	3.19
query34	15.27	3.96	3.36
query35	3.30	3.35	3.33
query36	0.54	0.43	0.42
query37	0.08	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.03
query40	0.17	0.15	0.14
query41	0.08	0.04	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 94.6 s
Total hot run time: 23.96 s

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@morningman

Copy link
Copy Markdown
Contributor Author

/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.

Static review of PR #70351 at head 9a484e8: no new actionable finding verified. Converged after 1 round with a complete reviewer and a separate risk reviewer, both returning NO_NEW_VALUABLE_FINDINGS, followed by independent main-agent verification and a final sweep of both changed files. No existing blocking inline findings apply; the supplied and refreshed live inline comment sets are empty. No additional user review focus was supplied.

Critical checkpoint conclusions:

  1. Goal and correctness: TIMEV2 now takes its fractional-second scale from ConnectorType.precision, matching Hudi's Avro time-millis/time-micros producers (3/6). Omitted precision preserves the previous scale-0 singleton. The added test checks 0, 3, 6, omitted precision and time(3) SQL rendering; assertions were inspected, not executed.
  2. Scope and reuse: the six-line production case uses the existing ScalarType factory and follows adjacent DATETIMEV2 handling; the other changed file adds one focused JUnit 5 test.
  3. Concurrency and locking: no new threads, shared mutations, locks, heavy work under locks or lock-order changes.
  4. Lifecycle and initialization: no new resource lifetime or static initialization dependency; explicit scale creates a local type and the fallback reuses the existing singleton.
  5. Configuration: no settings added or changed; dynamic-update propagation is inapplicable.
  6. Compatibility: no API symbols, connector SPI or storage layouts changed. The correction uses existing TIMEV2 scale representation and consumers; no new mixed-version incompatibility identified.
  7. Thrift/protobuf definitions: neither directory changed; field-id and enum-value comparisons are inapplicable.
  8. Parallel paths: ARRAY/MAP/STRUCT conversion recursively reaches this case; existing DATETIMEV2/TIMESTAMPTZ paths remain consistent. Shared reverse schema conversion serves DDL/write paths, while current Hudi scan handles come from original connector metadata. No newly failing read consumer found.
  9. Conditions and errors: precision >= 0 distinguishes explicit scale from the unset sentinel, with a comment matching the neighboring convention. Current TIMEV2 producers supply supported scales 3/6; no new swallowed error found.
  10. Test coverage: scalar scales/default and SQL rendering are covered, with existing Hudi producer assertions independently matching 3/6. No nested TIME-specific, invalid-scale or end-to-end regression case was added; recursive dispatch and actual producer bounds were inspected. Builds and tests were not run under the static-only contract.
  11. Expected test results: the added type and SQL expectations agree with ScalarType implementation; no golden output files changed.
  12. Observability: deterministic local type conversion adds no distributed operation requiring new logging or metrics.
  13. Transactions and persistence: no journal/replay, visible-version, delete-bitmap or failover logic changed.
  14. Writes and atomicity: no data-write operation or shared-state mutation introduced; transaction atomicity is unaffected.
  15. FE/BE propagation: no new transmitted variable; existing ScalarType thrift serialization and BE DataTypeTimeV2 construction preserve the supported scale.
  16. Performance and other issues: constant-time dispatch and a small per-type allocation match neighboring temporal cases; no material redundant work or further verified defect found. FE exception/RPC boundaries and external-catalog initialization/reset behavior are not changed.

Risk dispositions and limits: the unchanged reverse helper's TIMEV2 scale loss has no concrete new failure in current read paths. A separate predicate converter can emit catalog precision/scale, but residual predicates bind existing slots and remaining filters retain original BE conjuncts; they do not feed those types through this changed schema converter. Hudi partition-value types use the schema fallback. The pre-existing Hudi JNI rejection of Avro TIME logical types remains unchanged; this review and the new unit test establish metadata conversion behavior, not end-to-end Hudi time-column execution. Hypothetical future producers with scale above 6 were not treated as an introduced bug. No unresolved patch-specific candidate or unreviewed changed scope remains. Validation was static inspection only; no builds, tests or runtime validation were executed.

Review converged after 1 round(s).

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.

3 participants