Re: Feedback on a generic return type version of RelShuttle?

2021-12-02 Thread Steven Phillips
Agree with James, and that's not even including implementations in other codebases that use calcite (e.g. there are dozens of implementations in Dremio's codebase). On Thu, Dec 2, 2021 at 9:38 AM James Starr wrote: > Vladimir, there are 22 implementations of RelShuttleImpl(excluding tests) > in

Re: Feedback on a generic return type version of RelShuttle?

2021-12-02 Thread Steven Phillips
I don't really understand what you are trying to say. An accept() method in the classes on which visitor operates is a standard, normal part of the visitor pattern. Look at the examples in the wikipedia page you link to. I think the accept() method is necessary for compile time binding to work. A

Re: Splitting multiconditional joins into binary joins?

2025-03-14 Thread Steven Phillips
You might try looking into the MultiJoinOptimizeBushy rule. I think it also is not doing exactly what you want, but it might be a good starting point for a rule that does. On Fri, Mar 14, 2025 at 1:35 AM Mads Sejer Pedersen wrote: > Hi people, > > I am doing some benchmarking with Calcite for t

Re: Understanding Statistic unique keys

2025-02-28 Thread Steven Phillips
ations allow it. > Is that expected? > > From: Steven Phillips > Reply-To: "dev@calcite.apache.org" > Date: Friday, February 28, 2025 at 10:51 > To: "dev@calcite.apache.org" > Subject: Re: Understanding Statistic unique keys > > Yes, your understan

Re: Questions about RelMdColumnUniqueness

2025-03-07 Thread Steven Phillips
> > This gets back to my “What is this supposed to do?” I can confidently say it's the first one: "Is this set of keys, when taken together, unique"? Sorry, earlier, I guess I misunderstood what you meant by join analysis. You are referring to the predicate-constant thing in the context of join

Re: Questions Regarding Type Coercion and CAST Transformations in SqlValidator and RexBuilder

2025-03-08 Thread Steven Phillips
I think it's reasonable for a system to not want these transformations. A given execution engine could choose to implement an EQUALS function between the two different types, rather than using implicit cast. Also, for use cases like Matthew's, it seems reasonable that we could configure SqlValidat

Re: Questions about RelMdColumnUniqueness

2025-03-07 Thread Steven Phillips
As far as overriding, you can checkout what we do at Dremio: https://github.com/dremio/dremio-oss/blob/master/sabot/kernel/src/main/java/com/dremio/exec/planner/cost/RelMdColumnUniqueness.java https://github.com/dremio/dremio-oss/blob/master/sabot/kernel/src/main/java/com/dremio/exec/planner/cost/D

Re: Questions about RelMdColumnUniqueness

2025-03-07 Thread Steven Phillips
By join analysis, I assume you are referring to https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnUniqueness.java#L336 The thing is, a join as the potential to make a unique column no longer unique, as it could be an expanding join. e.g. join

Re: Questions about RelMdColumnUniqueness

2025-03-07 Thread Steven Phillips
. On Fri, Mar 7, 2025 at 1:13 PM Steven Phillips wrote: > By join analysis, I assume you are referring to > https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnUniqueness.java#L336 > > The thing is, a join as the potential to m

Re: RelFieldTrimmer not optimally trimming after filters under joins?

2025-03-04 Thread Steven Phillips
In think this is a current limitation of FieldTrimmer. The Join and Filter nodes can't drop columns (since they don't carry column selection information), and the trimmer doesn't add Project nodes (currently). I have worked around this limitation by using HepPlanner with various ProjectTranspose ru

Re: RelFieldTrimmer not optimally trimming after filters under joins?

2025-03-04 Thread Steven Phillips
wildly > > > > > >> I think you could work around this by always inserting trivial projects > over every node in the tree before trimming, and then clean up with > ProjectRemoveRule. > > > > > > > > This is pretty much exactly what I w

Re: RelFieldTrimmer not optimally trimming after filters under joins?

2025-03-04 Thread Steven Phillips
wrote: > I see. RelFieldTrimmer could insert a Project right after the Filter, but > in most calling conventions that plan would probably be less efficient. The > field will be removed next time there is a Project or Aggregate. > > > On Mar 4, 2025, at 4:33 PM, Steven Phillips >

Re: Understanding Statistic unique keys

2025-02-28 Thread Steven Phillips
Yes, your understanding is correct. See the code for the isKey() method: @Override public boolean isKey(ImmutableBitSet columns) { for (ImmutableBitSet key : keysCopy) {

Re: Pushing all Filters into Joins

2025-06-10 Thread Steven Phillips
The original filter has 5 join conditions, but 3 of them are mutually dependent: $11 = $18, $18 = $16, $11 = $16 So there are really only 4 join conditions, which is what you end up with. On Mon, Jun 9, 2025 at 10:17 PM Juri Petersen wrote: > Hello, > I am in need of some help or guidance. > We

[jira] [Created] (CALCITE-2751) MetadataCycleException not handled in VolcanoRelMetadataProvider

2018-12-21 Thread Steven Phillips (JIRA)
Steven Phillips created CALCITE-2751: Summary: MetadataCycleException not handled in VolcanoRelMetadataProvider Key: CALCITE-2751 URL: https://issues.apache.org/jira/browse/CALCITE-2751 Project