ysuliu commented on issue #625:
URL: https://github.com/apache/arrow-go/issues/625#issuecomment-3758338432

   Hi @zeroshade ,
   Thanks for the comments. Now I get to know `IsNull()` method should be used 
for checking the values that were appended by `AppendNull()`.
   
   But sorry that I got the new case about `Append(nil)`:
   
   ```go
        idBuilder.Append([]byte{})            // empty slice
        idBuilder.Append(nil)                    // append 'nil'
        idBuilder.AppendNull()                 // NULL
   ```
   
   `Append(nil)` seems to be different from `AppendNull()`, because `IsNull()` 
will be `true` for `AppendNull()`, but `false` for `Append(nil)`.
   
   Then with the code:
   
   ```go
                                        data, _ := col.(*array.Binary)
   
                                        if data.IsNull(rowIdx) {
                                                fmt.Print("NULL\n")
                                        } else if data.Value(rowIdx) == nil {
                                                fmt.Print("nil\n")
                                        } else {
                                                fmt.Printf("value: %v\n", 
data.Value(rowIdx))
                                        }
   ```
   
   Without the fix, the result for _both_ cases is:
   ```
   nil
   nil
   NULL
   ```
   
   With the fix, the result for _both_ cases is:
   ```
   value: []
   value: []
   NULL
   ```
   
   So it seems that we still can't distinguish between empty slice `[]byte{}` 
and `nil`. Can you suggest further?
   
   Thanks a lot!
   


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