vthemelis commented on code in PR #44633:
URL: https://github.com/apache/arrow/pull/44633#discussion_r1847388197
##########
csharp/src/Apache.Arrow/Schema.cs:
##########
@@ -66,6 +61,10 @@ internal Schema(List<Field> fieldsList,
IReadOnlyDictionary<string, string> meta
_fieldsDictionary = FieldsLookup.ToDictionary(g => g.Key, g =>
g.First());
Metadata = metadata;
+
+ _fieldsIndexLookup = _fieldsList
+ .Select((x, idx) => (Name: x.Name, Index: idx))
+ .ToLookup(x => x.Name, x => x.Index,
StringComparer.CurrentCulture);
Review Comment:
Of course, I can then only use the lookup if the user has provided `Ordinal`
as the comparator but this would defeat the purpose of this PR which is to make
lookup of Columns in RecordBatch O(1).
--
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]