zgramana commented on a change in pull request #7032:
URL: https://github.com/apache/arrow/pull/7032#discussion_r418385072
##########
File path: csharp/src/Apache.Arrow/Arrays/StringArray.cs
##########
@@ -71,6 +76,15 @@ public string GetString(int index, Encoding encoding =
default)
var bytes = GetBytes(index);
+ if (bytes == Span<byte>.Empty)
+ {
+ return null;
+ }
+ if (bytes.Length == 0)
Review comment:
Yes. See
`ArrayBuilderTests.StringArrayBuilderHandlesNullsAndEmptyStrings`. #Closed
##########
File path: csharp/src/Apache.Arrow/Arrays/StringArray.cs
##########
@@ -71,6 +76,15 @@ public string GetString(int index, Encoding encoding =
default)
var bytes = GetBytes(index);
+ if (bytes == Span<byte>.Empty)
Review comment:
I chose the first option as it avoids any public API changes. In general
I am not a fan of `out` contracts, but did not have a better alternative. This
way there is still time to contemplate alternatives before committing to the
proposed overload. #Closed
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]