HuaHuaY opened a new pull request, #50926:
URL: https://github.com/apache/arrow/pull/50926

   ### Rationale for this change
   
   Some CSV files omit trailing optional fields. The C++ CSV reader currently 
rejects these short rows, requiring callers to preprocess or discard them.
   
   ### What changes are included in this PR?
   
   1. Add an option `pad_short_rows` in CSV `struct ParseOptions` that pads 
missing trailing fields with nulls.
   2. When `pad_short_rows` is enabled and column names are autogenerated, 
infer the column width from the maximum number of fields among complete records 
in the first input block. When a header is present, the header continues to 
define the width.
   
   P.S. Dataset has a separate column-name inference path that is unchanged by 
this PR, so Dataset inspection does not infer the maximum width from the first 
input block.
   
   ### Are these changes tested?
   
   Yes.
   
   ### Are there any user-facing changes?
   
   Add an option `pad_short_rows` in CSV `struct ParseOptions`.
   


-- 
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]

Reply via email to