CurtHagenlocher commented on code in PR #2587:
URL: https://github.com/apache/arrow-adbc/pull/2587#discussion_r1987663935


##########
csharp/src/Apache.Arrow.Adbc/Extensions/IArrowArrayExtensions.cs:
##########
@@ -198,7 +208,23 @@ public static class IArrowArrayExtensions
                 case ArrowTypeId.Int64:
                     return (array, index) => 
((Int64Array)array).GetValue(index);
                 case ArrowTypeId.String:
-                    return (array, index) => 
((StringArray)array).GetString(index);
+                    return (array, index) =>
+                    {
+                        StringArray? sArray = array as StringArray;

Review Comment:
   It's still a shame to have a branch on the critical path -- especially for a 
such a commonly-used data type. At least in this case, the CPU's branch 
predictor ought to figure out pretty quickly that the array is almost never 
going to be a decimal256. And I can see that making things work that way would 
require a fair amount of refactoring.



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

Reply via email to