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

[GitHub] [arrow] yevgenypats commented on a diff in pull request #34986: GH-34657: [Go] Add ValueString(i int) string to array

yevgenypats commented on code in PR #34986:
URL: https://github.com/apache/arrow/pull/34986#discussion_r1161997497


##########
go/arrow/array/binary.go:
##########
@@ -56,9 +57,17 @@ func (a *Binary) Value(i int) []byte {
 	return a.valueBytes[a.valueOffsets[idx]:a.valueOffsets[idx+1]]
 }
 
-// ValueString returns the string at index i without performing additional allocations.
-// The string is only valid for the lifetime of the Binary array.
+// ValueString returns the string at index i
 func (a *Binary) ValueString(i int) string {
+	if a.IsNull(i) {
+		return NullValueStr
+	}
+	return base64.StdEncoding.EncodeToString(a.Value(i))
+}
+
+// ValueStr returns the string at index i without performing additional allocations.
+// The string is only valid for the lifetime of the Binary array.
+func (a *Binary) ValueStr(i int) string {

Review Comment:
   @zeroshade  I can do the other way around. `ValueStr` for the new function? WDYT?



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