alamb commented on code in PR #4633:
URL: https://github.com/apache/arrow-datafusion/pull/4633#discussion_r1051094285
##########
datafusion/core/src/dataframe.rs:
##########
@@ -74,40 +73,28 @@ use crate::prelude::SessionContext;
/// ```
#[derive(Debug, Clone)]
pub struct DataFrame {
- session_state: Arc<RwLock<SessionState>>,
+ session_state: SessionState,
plan: LogicalPlan,
}
impl DataFrame {
/// Create a new Table based on an existing logical plan
- pub fn new(session_state: Arc<RwLock<SessionState>>, plan: LogicalPlan) ->
Self {
+ pub fn new(session_state: SessionState, plan: LogicalPlan) -> Self {
Review Comment:
❤️
##########
datafusion/core/src/dataframe.rs:
##########
@@ -620,28 +604,25 @@ impl DataFrame {
}
/// Write a `DataFrame` to a CSV file.
- pub async fn write_csv(self, path: &str) -> Result<()> {
- let state = self.session_state.read().clone();
Review Comment:
yeah all the explicit cloning is definitely a warning sign
--
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]