Skip to content

[fix](fe) Infer compression before skipping empty schema files - #67412

Open
0AyanamiRei wants to merge 1 commit into
apache:masterfrom
0AyanamiRei:fix/doris-25135-skip-empty-compressed-schema-files
Open

[fix](fe) Infer compression before skipping empty schema files#67412
0AyanamiRei wants to merge 1 commit into
apache:masterfrom
0AyanamiRei:fix/doris-25135-skip-empty-compressed-schema-files

Conversation

@0AyanamiRei

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Schema inference skips empty compressed CSV and JSON files using format-specific minimum sizes, but the check used only the explicitly configured compression type. With the default UNKNOWN type, an empty gzip file selected by a glob was treated as non-empty and prevented a later valid file from supplying the schema. Reuse the existing path-based compression inference before applying the empty-content threshold.

Release note

File table-valued functions now skip empty gzip CSV and JSON files during schema inference when compression is inferred from the path.

Check List (For Author)

  • Test: Regression test and manual test
    • Regression test: test_empty_first_compressed_schema for CSV and JSON gzip globs
    • Manual test: local CSV and JSON DESC FUNCTION and queries returned the later valid file rows
  • Behavior changed: Yes. Empty compressed files no longer block schema inference for a matching glob.
  • Does this need documentation: No

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Schema inference skips empty compressed CSV and JSON files using format-specific minimum sizes, but the check used only the explicitly configured compression type. With the default UNKNOWN type, an empty gzip file selected by a glob was treated as non-empty and prevented a later valid file from supplying the schema. Reuse the existing path-based compression inference before applying the empty-content threshold.

### Release note

File table-valued functions now skip empty gzip CSV and JSON files during schema inference when compression is inferred from the path.

### Check List (For Author)

- Test: Regression test and manual test
    - Regression test: test_empty_first_compressed_schema for CSV and JSON gzip globs
    - Manual test: local CSV and JSON DESC FUNCTION and queries returned the later valid file rows
- Behavior changed: Yes. Empty compressed files no longer block schema inference for a matching glob.
- Does this need documentation: No
@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?

@0AyanamiRei

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17577	3059	3064	3059
q2	2101	249	225	225
q3	10240	867	504	504
q4	4665	242	198	198
q5	7697	563	377	377
q6	135	112	91	91
q7	518	533	389	389
q8	9244	896	918	896
q9	3433	2379	2370	2370
q10	6543	819	708	708
q11	396	197	179	179
q12	612	258	193	193
q13	18148	1527	1135	1135
q14	157	148	138	138
q15	q16	434	400	374	374
q17	1381	895	841	841
q18	3077	2220	2232	2220
q19	1284	912	743	743
q20	374	271	197	197
q21	5615	1662	1881	1662
q22	319	264	228	228
Total cold run time: 93950 ms
Total hot run time: 16727 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3421	3351	3360	3351
q2	519	395	393	393
q3	2161	2251	2135	2135
q4	1180	1142	879	879
q5	2160	2084	2114	2084
q6	170	115	85	85
q7	1048	926	875	875
q8	1600	1411	1402	1402
q9	3114	3084	3067	3067
q10	1814	1758	1617	1617
q11	358	264	255	255
q12	444	424	334	334
q13	1494	1533	1159	1159
q14	176	175	161	161
q15	q16	398	394	359	359
q17	3591	3313	3218	3218
q18	4805	4408	4682	4408
q19	852	774	904	774
q20	1004	989	844	844
q21	3849	3105	3298	3105
q22	390	341	312	312
Total cold run time: 34548 ms
Total hot run time: 30817 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 81274 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 8086a5d415d850c80accf1f1043a285640110e0e, data reload: false

query5	4278	410	338	338
query6	385	134	122	122
query7	4948	393	218	218
query8	290	122	117	117
query9	8671	2862	2852	2852
query10	386	205	172	172
query11	5368	1012	897	897
query12	114	67	82	67
query13	1189	438	327	327
query14	6040	2185	2052	2052
query14_1	1930	1916	1918	1916
query15	167	118	113	113
query16	910	317	315	315
query17	785	424	336	336
query18	2342	313	228	228
query19	167	130	104	104
query20	69	66	70	66
query21	205	99	87	87
query22	5325	5422	5400	5400
query23	6508	6269	5934	5934
query23_1	6044	5979	6004	5979
query24	7349	1049	760	760
query24_1	757	765	785	765
query25	401	280	239	239
query26	1229	223	131	131
query27	2805	424	253	253
query28	4672	1493	1468	1468
query29	909	445	333	333
query30	249	153	127	127
query31	825	390	319	319
query32	122	76	74	74
query33	462	206	188	188
query34	999	833	474	474
query35	407	400	339	339
query36	556	569	522	522
query37	123	82	74	74
query38	999	844	852	844
query39	503	490	481	481
query39_1	464	455	453	453
query40	209	92	79	79
query41	62	56	56	56
query42	79	74	75	74
query43	244	242	213	213
query44	1019	539	548	539
query45	111	107	110	107
query46	765	881	538	538
query47	752	772	696	696
query48	327	322	227	227
query49	547	250	193	193
query50	776	266	197	197
query51	7955	7911	7969	7911
query52	79	68	63	63
query53	194	198	146	146
query54	252	183	164	164
query55	73	59	55	55
query56	201	176	166	166
query57	658	692	636	636
query58	212	176	162	162
query59	1215	1315	1097	1097
query60	255	193	186	186
query61	138	150	144	144
query62	373	217	181	181
query63	181	142	168	142
query64	2714	699	597	597
query65	2053	1559	1600	1559
query66	1925	273	216	216
query67	12434	9404	9474	9404
query68	3018	1233	760	760
query69	365	226	190	190
query70	692	626	638	626
query71	250	168	166	166
query72	2353	1760	1524	1524
query73	667	649	326	326
query74	2005	1210	1149	1149
query75	1184	1077	958	958
query76	2390	710	550	550
query77	245	256	227	227
query78	4058	3741	3311	3311
query79	2748	811	576	576
query80	1575	323	277	277
query81	510	152	127	127
query82	662	127	95	95
query83	290	206	188	188
query84	300	110	89	89
query85	836	359	291	291
query86	388	176	175	175
query87	1007	971	894	894
query88	2780	2081	2103	2081
query89	285	192	172	172
query90	1943	131	124	124
query91	132	116	99	99
query92	79	70	69	69
query93	1708	1068	713	713
query94	647	259	208	208
query95	533	320	216	216
query96	784	590	279	279
query97	1013	1019	1017	1017
query98	164	136	133	133
query99	427	338	306	306
Total cold run time: 181229 ms
Total hot run time: 81274 ms

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