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/23 20:53:52 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #4347: Do not error in optimizer if resulting schema has different metadata

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


##########
datafusion/optimizer/src/optimizer.rs:
##########
@@ -351,6 +352,49 @@ mod tests {
         Ok(())
     }
 
+    #[test]
+    fn generate_same_schema_different_metadata() {
+        // if the plan creates more metadata than previously (because
+        // some wrapping functions are removed, etc) do not error
+        let opt = Optimizer::with_rules(vec![Arc::new(GetTableScanRule {})]);

Review Comment:
   this test mimics what I was seeing in IOx



##########
datafusion/optimizer/src/optimizer.rs:
##########
@@ -225,7 +225,7 @@ impl Optimizer {
                 let result = rule.try_optimize(&new_plan, optimizer_config);
                 match result {
                     Ok(Some(plan)) => {
-                        if plan.schema() != new_plan.schema() {
+                        if !plan.schema().equivalent_names_and_types(new_plan.schema()) {

Review Comment:
   This is the change



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