Skip to content

[opt](file-scanner) print current path when encountering error#34365

Merged
morningman merged 1 commit intoapache:masterfrom
morningman:reader_print
Apr 30, 2024
Merged

[opt](file-scanner) print current path when encountering error#34365
morningman merged 1 commit intoapache:masterfrom
morningman:reader_print

Conversation

@morningman
Copy link
Contributor

Proposed changes

Like this:

mysql> select * from text_deflate;
ERROR 1105 (HY000): errCode = 2, detailMessage = (172.21.0.101)[CANCELLED][INTERNAL_ERROR]cur path: hdfs://ns/usr/hive/warehouse/yytest.db/text_deflate/test2.snappy. Compressed file has been truncated, which is not allowed

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@morningman
Copy link
Contributor Author

run buildall

Copy link
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.

clang-tidy made some suggestions

// _fill_missing_columns - - - x - x -
// _convert_to_output_block - - - - - - x
Status VFileScanner::_get_block_impl(RuntimeState* state, Block* block, bool* eof) {
Status VFileScanner::_get_block_wrapped(RuntimeState* state, Block* block, bool* eof) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function '_get_block_wrapped' has cognitive complexity of 94 (threshold 50) [readability-function-cognitive-complexity]

Status VFileScanner::_get_block_wrapped(RuntimeState* state, Block* block, bool* eof) {
                     ^
Additional context

be/src/vec/exec/scan/vfile_scanner.cpp:321: +1, including nesting penalty of 0, nesting level increased to 1

    do {
    ^

be/src/vec/exec/scan/vfile_scanner.cpp:322: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_CANCELLED(state);
        ^

be/src/runtime/runtime_state.h:769: expanded from macro 'RETURN_IF_CANCELLED'

    do {                                                                              \
    ^

be/src/vec/exec/scan/vfile_scanner.cpp:322: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_CANCELLED(state);
        ^

be/src/runtime/runtime_state.h:770: expanded from macro 'RETURN_IF_CANCELLED'

        if (UNLIKELY((state)->is_cancelled())) return Status::Cancelled("Cancelled"); \
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:323: +2, including nesting penalty of 1, nesting level increased to 2

        if (_cur_reader == nullptr || _cur_reader_eof) {
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:324: +3, including nesting penalty of 2, nesting level increased to 3

            RETURN_IF_ERROR(_get_next_reader());
            ^

be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/exec/scan/vfile_scanner.cpp:324: +4, including nesting penalty of 3, nesting level increased to 4

            RETURN_IF_ERROR(_get_next_reader());
            ^

be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:327: +2, including nesting penalty of 1, nesting level increased to 2

        if (_scanner_eof) {
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:335: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_init_src_block(block));
        ^

be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/exec/scan/vfile_scanner.cpp:335: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_init_src_block(block));
        ^

be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:341: +2, including nesting penalty of 1, nesting level increased to 2

            RETURN_IF_ERROR(
            ^

be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/exec/scan/vfile_scanner.cpp:341: +3, including nesting penalty of 2, nesting level increased to 3

            RETURN_IF_ERROR(
            ^

be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:346: +2, including nesting penalty of 1, nesting level increased to 2

        if (read_rows > 0) {
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:349: +3, including nesting penalty of 2, nesting level increased to 3

            if (_get_push_down_agg_type() != TPushAggOp::type::COUNT) {
            ^

be/src/vec/exec/scan/vfile_scanner.cpp:351: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(_cast_to_input_block(block));
                ^

be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/exec/scan/vfile_scanner.cpp:351: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(_cast_to_input_block(block));
                ^

be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:353: +4, including nesting penalty of 3, nesting level increased to 4

                if (!_cur_reader->fill_all_columns()) {
                ^

be/src/vec/exec/scan/vfile_scanner.cpp:355: +5, including nesting penalty of 4, nesting level increased to 5

                    RETURN_IF_ERROR(_fill_columns_from_path(read_rows));
                    ^

be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/exec/scan/vfile_scanner.cpp:355: +6, including nesting penalty of 5, nesting level increased to 6

                    RETURN_IF_ERROR(_fill_columns_from_path(read_rows));
                    ^

be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:357: +5, including nesting penalty of 4, nesting level increased to 5

                    RETURN_IF_ERROR(_fill_missing_columns(read_rows));
                    ^

be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/exec/scan/vfile_scanner.cpp:357: +6, including nesting penalty of 5, nesting level increased to 6

                    RETURN_IF_ERROR(_fill_missing_columns(read_rows));
                    ^

be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:360: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(_pre_filter_src_block());
                ^

be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/exec/scan/vfile_scanner.cpp:360: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(_pre_filter_src_block());
                ^

be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:362: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(_convert_to_output_block(block));
                ^

be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/exec/scan/vfile_scanner.cpp:362: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(_convert_to_output_block(block));
                ^

be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/exec/scan/vfile_scanner.cpp:365: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(_truncate_char_or_varchar_columns(block));
                ^

be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/exec/scan/vfile_scanner.cpp:365: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(_truncate_char_or_varchar_columns(block));
                ^

be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.70% (8957/25093)
Line Coverage: 27.28% (73848/270706)
Region Coverage: 26.47% (38150/144150)
Branch Coverage: 23.22% (19430/83686)
Coverage Report: http://coverage.selectdb-in.cc/coverage/69169173ea9c79e0e9350b54459f409319e94791_69169173ea9c79e0e9350b54459f409319e94791/report/index.html

@doris-robot
Copy link

TPC-DS: Total hot run time: 183628 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 69169173ea9c79e0e9350b54459f409319e94791, data reload: false

query1	911	356	358	356
query2	6193	2326	2371	2326
query3	6718	207	203	203
query4	23602	21698	22184	21698
query5	3775	424	415	415
query6	265	182	176	176
query7	4561	292	292	292
query8	239	205	194	194
query9	8476	2373	2380	2373
query10	399	251	249	249
query11	11622	10985	11354	10985
query12	120	99	88	88
query13	1739	368	366	366
query14	10588	8567	8086	8086
query15	256	174	167	167
query16	8248	261	258	258
query17	1901	556	547	547
query18	2094	286	270	270
query19	328	153	153	153
query20	87	83	86	83
query21	196	127	124	124
query22	5059	4849	4833	4833
query23	34087	33262	33159	33159
query24	10649	2957	2831	2831
query25	613	375	377	375
query26	1131	155	148	148
query27	2841	314	313	313
query28	7432	2045	2034	2034
query29	861	629	649	629
query30	244	150	150	150
query31	962	729	719	719
query32	91	48	52	48
query33	740	234	230	230
query34	1053	476	461	461
query35	792	663	655	655
query36	1085	854	934	854
query37	131	64	66	64
query38	3146	3006	3047	3006
query39	1564	1518	1535	1518
query40	192	124	120	120
query41	39	35	35	35
query42	104	91	96	91
query43	582	552	555	552
query44	1188	716	718	716
query45	275	250	245	245
query46	1078	750	751	750
query47	1968	1875	1903	1875
query48	386	291	304	291
query49	866	384	379	379
query50	757	371	388	371
query51	6738	6560	6643	6560
query52	105	85	88	85
query53	351	281	279	279
query54	298	230	221	221
query55	82	71	73	71
query56	230	217	217	217
query57	1199	1138	1142	1138
query58	224	211	207	207
query59	3350	3246	3350	3246
query60	248	229	227	227
query61	87	85	86	85
query62	666	457	457	457
query63	311	283	279	279
query64	8616	7218	7209	7209
query65	3083	3057	3028	3028
query66	802	329	326	326
query67	15578	15239	14876	14876
query68	9415	530	541	530
query69	577	310	307	307
query70	1166	1150	1142	1142
query71	555	265	263	263
query72	8013	2533	2309	2309
query73	1171	314	311	311
query74	6579	6028	6089	6028
query75	5360	2603	2622	2603
query76	5806	1045	953	953
query77	817	260	282	260
query78	11055	10154	10181	10154
query79	12781	519	517	517
query80	1425	421	423	421
query81	545	217	217	217
query82	718	92	92	92
query83	212	165	163	163
query84	254	85	83	83
query85	1363	262	258	258
query86	401	312	298	298
query87	3314	3151	3096	3096
query88	4907	2338	2305	2305
query89	532	380	375	375
query90	2011	177	178	177
query91	123	97	97	97
query92	61	47	45	45
query93	7422	507	510	507
query94	1263	183	181	181
query95	390	291	311	291
query96	600	263	260	260
query97	3162	2928	2993	2928
query98	229	219	215	215
query99	1300	870	876	870
Total cold run time: 307729 ms
Total hot run time: 183628 ms

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 30, 2024
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@morningman morningman merged commit b25ad74 into apache:master Apr 30, 2024
morningman added a commit to morningman/doris that referenced this pull request May 8, 2024
…e#34365)

Like this:
```
mysql> select * from text_deflate;
ERROR 1105 (HY000): errCode = 2, detailMessage = (172.21.0.101)[CANCELLED][INTERNAL_ERROR]cur path: hdfs://ns/usr/hive/warehouse/yytest.db/text_deflate/test2.snappy. Compressed file has been truncated, which is not allowed
```
morningman added a commit to morningman/doris that referenced this pull request May 8, 2024
…e#34365)

Like this:
```
mysql> select * from text_deflate;
ERROR 1105 (HY000): errCode = 2, detailMessage = (172.21.0.101)[CANCELLED][INTERNAL_ERROR]cur path: hdfs://ns/usr/hive/warehouse/yytest.db/text_deflate/test2.snappy. Compressed file has been truncated, which is not allowed
```
morningman added a commit to morningman/doris that referenced this pull request May 8, 2024
…e#34365)

Like this:
```
mysql> select * from text_deflate;
ERROR 1105 (HY000): errCode = 2, detailMessage = (172.21.0.101)[CANCELLED][INTERNAL_ERROR]cur path: hdfs://ns/usr/hive/warehouse/yytest.db/text_deflate/test2.snappy. Compressed file has been truncated, which is not allowed
```
ByteYue pushed a commit to ByteYue/doris that referenced this pull request May 15, 2024
…e#34365)

Like this:
```
mysql> select * from text_deflate;
ERROR 1105 (HY000): errCode = 2, detailMessage = (172.21.0.101)[CANCELLED][INTERNAL_ERROR]cur path: hdfs://ns/usr/hive/warehouse/yytest.db/text_deflate/test2.snappy. Compressed file has been truncated, which is not allowed
```
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.0.10-merged dev/2.1.3-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants