hcrosse commented on code in PR #1464:
URL: https://github.com/apache/arrow-go/pull/1464#discussion_r4472662011


##########
arrow/scalar/nested.go:
##########
@@ -352,7 +352,7 @@ type Dictionary struct {
 func NewNullDictScalar(dt arrow.DataType) *Dictionary {
        ret := &Dictionary{scalar: scalar{dt, false}}
        ret.Value.Index = MakeNullScalar(dt.(*arrow.DictionaryType).IndexType)
-       ret.Value.Dict = nil
+       ret.Value.Dict = array.MakeArrayOfNull(memory.DefaultAllocator, 
dt.(*arrow.DictionaryType).ValueType, 0)

Review Comment:
   `NullLiteral`, the Substrait null literal and the null-scalar paths in 
`makeExecBatch` now hand the scalar over with `NewDatumWithoutOwning`. The cast 
branch does this only for nulls, because a valid run-end encoded cast can 
return a shared inner scalar.



##########
arrow/scalar/nested.go:
##########
@@ -352,7 +352,7 @@ type Dictionary struct {
 func NewNullDictScalar(dt arrow.DataType) *Dictionary {
        ret := &Dictionary{scalar: scalar{dt, false}}
        ret.Value.Index = MakeNullScalar(dt.(*arrow.DictionaryType).IndexType)
-       ret.Value.Dict = nil
+       ret.Value.Dict = array.MakeArrayOfNull(memory.DefaultAllocator, 
dt.(*arrow.DictionaryType).ValueType, 0)

Review Comment:
   `MakeArrayOfNull` now supports types with a null child, so the dictionary is 
still built with it. `TestMakeArrayOfNullNestedNull` and a `struct<null>` case 
in `TestNullDictionaryScalar` cover this.



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