You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "benibus (via GitHub)" <gi...@apache.org> on 2023/05/19 20:38:28 UTC

[GitHub] [arrow] benibus commented on a diff in pull request #35690: GH-35684: [Go][Parquet] Fix nil dereference with nil list array

benibus commented on code in PR #35690:
URL: https://github.com/apache/arrow/pull/35690#discussion_r1199347189


##########
go/parquet/pqarrow/encode_arrow.go:
##########
@@ -246,6 +246,10 @@ type binary64arr interface {
 }
 
 func writeDenseArrow(ctx *arrowWriteContext, cw file.ColumnChunkWriter, leafArr arrow.Array, defLevels, repLevels []int16, maybeParentNulls bool) (err error) {
+	if leafArr.Len() == 0 {

Review Comment:
   Can't comment on it directly since it's not in the diff, but it's not immediately obvious to me why we'd handle this case differently: https://github.com/apache/arrow/blob/c8363fa209fed4dfa30a0eee70283d62fc6f1627/go/parquet/pqarrow/encode_arrow.go#L270-L275
   
   Also, it seems like that branch may never be taken now? Unless it's only there to cover an edge-case where `leafArr` was reassigned to an empty storage array after the initial `Len() == 0` check: https://github.com/apache/arrow/blob/c8363fa209fed4dfa30a0eee70283d62fc6f1627/go/parquet/pqarrow/encode_arrow.go#L253-L257



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