You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/12/27 15:43:43 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #4739: Minor: use a common method to check the validate of equijoin predicate

alamb commented on code in PR #4739:
URL: https://github.com/apache/arrow-datafusion/pull/4739#discussion_r1057751134


##########
datafusion/expr/src/utils.rs:
##########
@@ -953,15 +953,54 @@ pub fn can_hash(data_type: &DataType) -> bool {
 }
 
 /// Check whether all columns are from the schema.
-pub fn check_all_column_from_schema(
-    columns: &HashSet<Column>,
-    schema: DFSchemaRef,
-) -> Result<bool> {
-    let result = columns
+fn check_all_column_from_schema(columns: &HashSet<Column>, schema: DFSchemaRef) -> bool {
+    columns
         .iter()
-        .all(|column| schema.index_of_column(column).is_ok());
+        .all(|column| schema.index_of_column(column).is_ok())
+}
 
-    Ok(result)
+/// Give two sides of the equijoin predicate, return a valid join key pair.

Review Comment:
   ❤️  thank you for these comments



##########
datafusion/expr/src/utils.rs:
##########
@@ -953,15 +953,54 @@ pub fn can_hash(data_type: &DataType) -> bool {
 }
 
 /// Check whether all columns are from the schema.
-pub fn check_all_column_from_schema(
-    columns: &HashSet<Column>,
-    schema: DFSchemaRef,
-) -> Result<bool> {
-    let result = columns
+fn check_all_column_from_schema(columns: &HashSet<Column>, schema: DFSchemaRef) -> bool {
+    columns
         .iter()
-        .all(|column| schema.index_of_column(column).is_ok());
+        .all(|column| schema.index_of_column(column).is_ok())

Review Comment:
   Nice



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