You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "Gabriel39 (via GitHub)" <gi...@apache.org> on 2026/10/16 07:50:21 UTC

[PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Gabriel39 opened a new pull request, #69187:
URL: https://github.com/apache/doris/pull/69187

   Backport #68746 to `branch-4.2`.
   
   Adds opt-in `file_name_padding` (0–10) to SELECT INTO OUTFILE and INSERT INTO FUNCTION. A positive width zero-pads each writer's file index; the default value 0 preserves existing file names. This helps rollover files sort by index when the configured width covers the indexes.
   
   The Thrift conflict was resolved by preserving this branch's existing `writer_class` definition and adding only the optional padding field.
   
   Validation:
   - All 5 upstream `ResultFileNameTest` cases passed in a focused C++ test binary.
   - FE `OutFileTest` and `BindTVFTableSinkTest` passed.
   - 22 local parameter checks passed across OUTFILE and TVF: defaults, accepted widths, invalid values, and propagation into Thrift sink options.
   - FE Checkstyle and clang-format 16 checks passed for the affected sources.
   - Full BE build and end-to-end export regression remain for CI.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #69187:
URL: https://github.com/apache/doris/pull/69187#discussion_r4292622359


##########
be/src/exec/sink/writer/vtvf_table_writer.cpp:
##########
@@ -164,8 +165,9 @@ Status VTVFTableWriter::_get_next_file_name(std::string* file_name) {
 
     // file_path is a prefix, generate: {prefix}{query_id}_{idx}.{ext}
     std::string query_id_str = print_id(_state->query_id());
-    *file_name = fmt::format("{}{}_{}.{}", _file_path, query_id_str, _file_idx, ext);
-    _file_idx++;
+    // Keep the same minimum-width index format as SELECT INTO OUTFILE.
+    *file_name = fmt::format("{}{}_{:0{}}.{}", _file_path, query_id_str, _file_idx++,
+                             _file_name_padding < 0 ? 0 : _file_name_padding, ext);

Review Comment:
   [P2] Honor or reject padding for JNI TVF writers
   
   When `writer_class` selects the shipped `org/apache/doris/writer/LocalFileJniWriter`, the new positive padding option is accepted but has no effect. `_create_file_writer()` uses this generated `file_name` only in its native branch; `create_tvf_format_transformer()` instead gives Java the original `tvf_sink.file_path`, which `LocalFileJniWriter` opens directly. Thus `INSERT INTO local("file_path"="/tmp/padded_", "format"="csv", "backend_id"="<BE id>", "writer_class"="org/apache/doris/writer/LocalFileJniWriter", "file_name_padding"="5") SELECT 7` still writes `/tmp/padded_`, with no padded index. Pass the generated name to the actual JNI writer, or reject positive padding for unsupported JNI writers; a JNI regression would cover this branch.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "Gabriel39 (via GitHub)" <gi...@apache.org>.
Gabriel39 commented on PR #69187:
URL: https://github.com/apache/doris/pull/69187#issuecomment-6211277750

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "Gabriel39 (via GitHub)" <gi...@apache.org>.
Gabriel39 commented on PR #69187:
URL: https://github.com/apache/doris/pull/69187#issuecomment-6210747669

   /review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "Gabriel39 (via GitHub)" <gi...@apache.org>.
Gabriel39 commented on PR #69187:
URL: https://github.com/apache/doris/pull/69187#issuecomment-6210747092

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #69187:
URL: https://github.com/apache/doris/pull/69187#issuecomment-6210744814

   
   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://doris.apache.org/community/how-to-contribute/review-and-ci).
   
   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?
       


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #69187:
URL: https://github.com/apache/doris/pull/69187


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #69187:
URL: https://github.com/apache/doris/pull/69187#issuecomment-6218834241

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #69187:
URL: https://github.com/apache/doris/pull/69187#issuecomment-6218833359

   PR approved by anyone and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #69187:
URL: https://github.com/apache/doris/pull/69187#issuecomment-6216507470

   # FE Regression Coverage Report
   Increment line coverage `  95.00% (19/20)` :tada:
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/69187_5d8065254addf46dcdfffbb5084e19deae435f38_merge_fe/increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/69187_5d8065254addf46dcdfffbb5084e19deae435f38_merge_fe/report/index.html)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #69187:
URL: https://github.com/apache/doris/pull/69187#issuecomment-6218874311

   # BE Regression && UT Coverage Report
   Increment line coverage `100.00% (10/10)` :tada:
   
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/69187_5d8065254addf46dcdfffbb5084e19deae435f38_merge/increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/69187_5d8065254addf46dcdfffbb5084e19deae435f38_merge/report/index.html)
   | Category          | Coverage           |
   |-------------------|--------------------|
   | Function Coverage | 76.06% (34245/45026) |
   | Line Coverage     | 60.95% (388094/636721) |
   | Region Coverage   | 57.64% (326533/566527) |
   | Branch Coverage   | 58.63% (150389/256509) |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "Gabriel39 (via GitHub)" <gi...@apache.org>.
Gabriel39 commented on PR #69187:
URL: https://github.com/apache/doris/pull/69187#issuecomment-6211278325

   /review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [branch-4.2](outfile) Add opt-in file_name_padding (#68746) [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #69187:
URL: https://github.com/apache/doris/pull/69187#issuecomment-6214870261

   # FE UT Coverage Report
   Increment line coverage `  5.00% (1/20)` :tada:
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/69187_5d8065254addf46dcdfffbb5084e19deae435f38/fe_increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/69187_5d8065254addf46dcdfffbb5084e19deae435f38/fe_report/index.html)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org