crepererum commented on code in PR #7870:
URL: https://github.com/apache/arrow-datafusion/pull/7870#discussion_r1372786446
##########
datafusion/common/src/dfschema.rs:
##########
@@ -102,8 +217,12 @@ impl DFSchema {
));
}
}
+
+ let fields_index = build_index(&fields);
Review Comment:
Thinking about this more: instead of `RwLock`, this can be solved even more
elegantly w/
[`OnceLock::get_or_init`](https://doc.rust-lang.org/std/sync/struct.OnceLock.html#method.get_or_init)
(this is usually used for static variables, but you can totally use that for
struct members as well).
--
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]