You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/20 15:38:36 UTC

[GitHub] [arrow] zeroshade commented on a diff in pull request #12158: ARROW-3039: [Go] Add support for DictionaryArray

zeroshade commented on code in PR #12158:
URL: https://github.com/apache/arrow/pull/12158#discussion_r854286113


##########
go/arrow/array/data.go:
##########
@@ -63,6 +64,16 @@ func NewData(dtype arrow.DataType, length int, buffers []*memory.Buffer, childDa
 	}
 }
 
+// NewDataWithDictionary creates a new data object, but also sets the provided dictionary into the data if it's not nil
+func NewDataWithDictionary(dtype arrow.DataType, length int, buffers []*memory.Buffer, childData []arrow.ArrayData, nulls, offset int, dict *Data) *Data {
+	data := NewData(dtype, length, buffers, childData, nulls, offset)

Review Comment:
   so thinking about this some more, that would be the `childData` *inside* the `Data` for the Dict. So i think that means that for a dictionary array `childData` of the array would likely always be empty since it should always be a simple integral array (the indices) with the values being in the dict. A dictionary of lists where the values of the dictionary are themselves list arrays would be represented via the childData of the `Data` passed for the dict. I'm going to modify this to remove the `childData` argument here.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org