Git Product home page Git Product logo

Comments (3)

LorrensP-2158466 avatar LorrensP-2158466 commented on August 18, 2024

I like the Join count analysis, I had to do this in my project (mentioned in #10808) in a really hacky way. We can have 2 sorts of counts:

  1. Count every individual join
  2. Count all groups of joins (subsequent joins that are related) with their respective count(this would have been useful for me)

I do have a question.
How can we show these results? Because Analyzer rules only return transformed LogicalPlans, or do I understand something in a wrong way?

from arrow-datafusion.

alamb avatar alamb commented on August 18, 2024

Thank you @LorrensP-2158466 -- sorry for the delay . I have been traveling

I do have a question.
How can we show these results? Because Analyzer rules only return transformed LogicalPlans, or do I understand something in a wrong way?

I think in an example, we can use println! which is what we do in other examples:

println!(
"Unoptimized Logical Plan:\n\n{}\n",
logical_plan.display_indent()
);

Normally the idea is to give a well documented example that shows the basic pattern that people can start with

For this one, maybe you could show how to use TreeNode::apply to walk the tree. Something like (totally untested)

let mut join_count = 0;
plan.apply(|child| {
  if matches!(child, LogicalPlan::Join(_)) {
    join_count += 1;
  }
});

println!("Found {join_count} joins in the plan");

from arrow-datafusion.

LorrensP-2158466 avatar LorrensP-2158466 commented on August 18, 2024

Thanks for the reply!

That's exactly what I have made, I'll open up a PR later today or tomorrow.

from arrow-datafusion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.