zeroshade commented on code in PR #34631:
URL: https://github.com/apache/arrow/pull/34631#discussion_r1157667598
##########
go/parquet/pqarrow/encode_arrow.go:
##########
@@ -449,7 +457,7 @@ func writeDenseArrow(ctx *arrowWriteContext, cw
file.ColumnChunkWriter, leafArr
data[i] =
parquet.ByteArray(valueBuf[offsets[i]:offsets[i+1]])
}
default:
- return xerrors.New(fmt.Sprintf("invalid column type to
write to ByteArray: %s", leafArr.DataType().Name()))
+ return xerrors.Errorf("invalid column type to write to
ByteArray: %s", leafArr.DataType().Name())
Review Comment:
if we're in here changing this, might as well use `fmt.Errorf` as `xerrors`
is no longer needed and should be phased out. do something like:
`return fmt.Errorf("%w: expected column type %s to be compatible with
`ByteArray`", arrow.ErrInvalid, leafArr.DataType())`
##########
go/parquet/pqarrow/encode_arrow.go:
##########
@@ -449,7 +457,7 @@ func writeDenseArrow(ctx *arrowWriteContext, cw
file.ColumnChunkWriter, leafArr
data[i] =
parquet.ByteArray(valueBuf[offsets[i]:offsets[i+1]])
}
default:
- return xerrors.New(fmt.Sprintf("invalid column type to
write to ByteArray: %s", leafArr.DataType().Name()))
+ return xerrors.Errorf("invalid column type to write to
ByteArray: %s", leafArr.DataType().Name())
Review Comment:
if we're in here changing this, might as well use `fmt.Errorf` as `xerrors`
is no longer needed and should be phased out. do something like:
`return fmt.Errorf("%w: expected column type %s to be compatible with
ByteArray", arrow.ErrInvalid, leafArr.DataType())`
--
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]