You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "nkarpov (via GitHub)" <gi...@apache.org> on 2023/04/13 13:45:16 UTC

[GitHub] [arrow-datafusion-python] nkarpov commented on a diff in pull request #324: adding support for join_on to python bindings

nkarpov commented on code in PR #324:
URL: https://github.com/apache/arrow-datafusion-python/pull/324#discussion_r1165545986


##########
src/dataframe.rs:
##########
@@ -212,6 +212,39 @@ impl PyDataFrame {
         Ok(Self::new(df))
     }
 
+    /// Thin wrapper for datafusion-rust `join_on`
+    /// Slightly modified from original `join` above.
+    fn join_on(
+            &self,
+            right: PyDataFrame,
+            on_exprs: Vec<PyExpr>,
+            how: &str,
+        ) -> PyResult<Self> {
+        let join_type = match how {
+            "inner" => JoinType::Inner,
+            "left" => JoinType::Left,
+            "right" => JoinType::Right,
+            "full" => JoinType::Full,
+            "semi" => JoinType::LeftSemi,
+            "anti" => JoinType::LeftAnti,
+            how => {
+                return Err(DataFusionError::Common(format!(
+                    "The join type {how} does not exist or is not implemented"
+                ))
+                .into());
+            }

Review Comment:
   I think so, but the trait doesn't appear to implemented https://github.com/apache/arrow-datafusion/blob/main/datafusion/expr/src/logical_plan/plan.rs#L1115-L1156, so I copied the approach from `join` in this same file for now.
   
   Should I add it to the main repo? Should it be a blocker for this change here?
   
   I'm new to this community so please bear with my questions 😬!



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org