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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to