zmrdltl commented on issue #5410:
URL: https://github.com/apache/arrow-rs/issues/5410#issuecomment-1964106400

   > ```rust
   > ColumnWriter
   > ```
   
   Thank you for the kind code explanation. 
   Looking at the example above, applying this suggestion has the disadvantage 
of using the write_null() function instead of the typed.write_batch() function, 
making it impossible to simplify the number of lines. 
   
   origin code
   ```rust
   ...
   (Value::Null, ColumnWriter::Int32ColumnWriter(ref mut typed)) => {
      typed.write_batch(&[], Some(&[0]), None).map_storage_err()?;
   }
   (Value::Null, ColumnWriter::Int64ColumnWriter(ref mut typed)) => {
     typed.write_batch(&[], Some(&[0]), None).map_storage_err()?;
   }
   ...
   ```
   
   after
   ```rust
   ...
   (Value::Null, ColumnWriter::Int32ColumnWriter(ref mut typed)) => {
       Self::write_null(typed).map_storage_err()?;
   }
   (Value::Null, ColumnWriter::Int64ColumnWriter(ref mut typed)) => {
      Self::write_null(typed).map_storage_err()?;
   }
   (Value::I8(val), ColumnWriter::Int32ColumnWriter(ref mut typed)) => {
     Self::write_null(typed).map_storage_err()?;
   }
   ...
   ```
   It would be a good idea to use a generic function to handle Value::Null in 
one line, but if there is a security issue or other problem as to why the 
module `encoder` should not be changed to pub, we will apply the suggestion.


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