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/11/26 05:38:54 UTC

[GitHub] [arrow-datafusion] AssHero opened a new pull request, #4379: refine the code of build schema for ambiguous check, factor this out into a function

AssHero opened a new pull request, #4379:
URL: https://github.com/apache/arrow-datafusion/pull/4379

   
   # Which issue does this PR close?
   
   Closes #4260 
   
   # Rationale for this change
   
   refine the code of build schema for ambiguous check, factor this out into a function
   


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


[GitHub] [arrow-datafusion] AssHero commented on a diff in pull request #4379: refine the code of build schema for ambiguous check, factor this out into a function

Posted by GitBox <gi...@apache.org>.
AssHero commented on code in PR #4379:
URL: https://github.com/apache/arrow-datafusion/pull/4379#discussion_r1032743440


##########
datafusion/sql/src/planner.rs:
##########
@@ -1016,32 +1043,8 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
         let plan = self.plan_from_tables(select.from, ctes, outer_query_schema)?;
         let empty_from = matches!(plan, LogicalPlan::EmptyRelation(_));
         // build from schema for unqualifier column ambiguous check
-        // we should get only one field for this unqualifier column from schema.
-        let from_schema = {
-            let mut fields = plan.schema().fields().clone();
-
-            let metadata = plan.schema().metadata().clone();
-            if let LogicalPlan::Join(HashJoin {
-                join_constraint: HashJoinConstraint::Using,
-                ref on,
-                ref left,
-                ..
-            }) = plan
-            {
-                // For query: select id from t1 join t2 using(id), this is legal.
-                // We should dedup the fields for cols in using clause.
-                for join_cols in on.iter() {
-                    let left_field = left.schema().field_from_column(&join_cols.0)?;
-                    fields.retain(|field| {
-                        field.unqualified_column().name
-                            != left_field.unqualified_column().name
-                    });
-                    fields.push(left_field.clone());
-                }
-            }
-
-            DFSchema::new_with_metadata(fields, metadata)?
-        };
+        // we should get only one field for unqualifier column from schema.
+        let from_schema = self.build_schema_for_ambiguous_check(&plan)?;

Review Comment:
   Hi @alamb, this is the follow up PR to factor this part into a function 'build_schema_for_ambiguous_check'.



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


[GitHub] [arrow-datafusion] alamb merged pull request #4379: refine the code of build schema for ambiguous check, factor this out into a function

Posted by GitBox <gi...@apache.org>.
alamb merged PR #4379:
URL: https://github.com/apache/arrow-datafusion/pull/4379


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


[GitHub] [arrow-datafusion] ursabot commented on pull request #4379: refine the code of build schema for ambiguous check, factor this out into a function

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #4379:
URL: https://github.com/apache/arrow-datafusion/pull/4379#issuecomment-1328041032

   Benchmark runs are scheduled for baseline = a61615b2949bea9027eefe686613605e135780f2 and contender = 12b5a1bfec9ebce1cca661d4d2dd5890b086895a. 12b5a1bfec9ebce1cca661d4d2dd5890b086895a is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/41f9a074167b4103bd6b10c9e12848c8...064fc12926ea438f9012a03a3ed9d5a9/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/95eee96474c24a658757725a9bb1d95e...d70a492f147045c2b9c467cb36dec4a2/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/72cfbc1b13f04f5495b1f4d1e84172bf...0acec1153c6f4a52b7ffa3f3ac452765/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/cbc4c8bebd0343cb8b6f5afd45635930...381f05b253d340ca8e54f2b921557205/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


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