Changes for expanded sub-queries in ON clauses

2020-09-15 Thread James Starr
but they cannot be played on the top of the node to maintain left and outer join semantics. I would greatly appreciate comments, suggestions on my changes. James Starr

Re: [ DISCUSS] The window table functions join syntax

2020-09-22 Thread James Starr
Sorry, but what part is red. Your markup appears to have been stripped. James On Tue, Sep 22, 2020 at 9:05 PM Danny Chan wrote: > Hi, fellows, long time no see on the mailing ~ > > Here I want to have a discussion on the join syntax of our recently > introduced window table function ~ > > For

Re: [DISCUSS] The date to release Calcite 1.26.0

2020-09-27 Thread James Starr
Could I get CALCITE-4210 included in release 1.26.0? On Fri, Sep 25, 2020 at 1:50 AM Danny Chan wrote: > Thanks. I will prepare my local test as fast as possible. > > Ruben Q L 于2020年9月25日 周五下午4:30写道: > > > Danny, > > > > I will do my best to have a RC by the end of next week (this is my first >

Re: [DISCUSS] The date to release Calcite 1.26.0

2020-09-27 Thread James Starr
Thank you Danny Chan. James Starr On Sun, Sep 27, 2020 at 7:49 PM Danny Chan wrote: > I will do that. > > Best, > Danny Chan > 在 2020年9月28日 +0800 AM3:35,James Starr ,写道: > > Could I get CALCITE-4210 included in release 1.26.0? > > > > On Fri, Sep 25,

Re: [DISCUSS] Does anybody think this is debuging unfriendly: "call.transformTo(relBuilder.build())"

2020-11-23 Thread James Starr
I second readability over debug ability. If every function call is decompressed to its own variable, readability can be compromised while make it more annoy to debug because there are now so many intermediate variables. Calcite compiles relatively quickly, it is not too inconvenient to refactor a

Supporting Postgres String Literals Default Type

2021-02-11 Thread James Starr
I created the ticket CALCITE-4493 *.* Postgres does not assume string literals are type CHAR, instead it assigns them to unknown or TEXT. This behavior is particularly relevant when a literal is compared to another literal. Postgres TEXT type

Supporting subqueries in ON clauses

2021-03-30 Thread James Starr
I have been working on supporting subqueries in ON clauses for some time. My current PR supports non-correlated subqueries in ON clauses of left and inner joins where subquery rewrite does not attempt to use the root to do the rewrite. For correlated subqueries and subqueries for joins other tha

Re: Deduplicate correlate variables question.

2021-06-02 Thread James Starr
If it is de facto deprecated, then could it not just be deprecated with a comment stating why it has not been deleted? Calcite seems to have several API that are defacto deprecated and there is no way of knowing by reading the code. This would personally have made me much simpler for myself to ge

Looking for a committer to merge CALCITE-4544 Deprecating Reflection base Rel Metadata

2021-08-12 Thread James Starr
I have a patch that is ready for review and to be committed. I am looking for committer to review and merge it. James

Re: Table, RelOptTable and SqlValidatorTable

2021-08-27 Thread James Starr
They both represent tables, just at different stages. SqlValidatorTable is used during validation of SqlNode, aka an abstract syntax tree. Where the RelOptTable contains the information for the Rel tree, aka the execution tree. On Thu, Aug 26, 2021 at 2:18 PM 董剑辉 wrote: > Hi: > I would

Re: Guava version

2021-09-21 Thread James Starr
I believe you want ./gradlew -Pguava.version=19.0. James On Tue, Sep 21, 2021 at 4:09 PM Julian Hyde wrote: > How do I set the Guava version from the Gradle command line? > > I’d expect > > ./gradlew -Dguava.version=19.0 > > to work but it doesn’t. > > (We used to test the supported range o

Re: [DISCUSS] Next releases

2021-09-24 Thread James Starr
When is calcite planning on going to 2.0? On Fri, Sep 24, 2021 at 3:35 AM Stamatis Zampetakis wrote: > From the last discussion [1], the list was the following for Calcite: > > Julian Hyde for 1.28.0 > Rui Wang for 1.29.0 > Andrei Sereda for 1.30.0 > Liya Fan for 1.31.0 > > [1] > > https://lists

Re: Proposal: Better abstraction/encapsulation for RelMetadataQuery

2021-10-27 Thread James Starr
Hi Jacques, I have a PR[1] for decoupling the JaninoRelMetadataProvider from the RelMetadataQuery. Instead of using inheritance and requiring downstream projects to update their code, composition was used for the creation of the initial handler stub, handler creation, and creation of a cache. Th

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

2021-12-02 Thread James Starr
Vladimir, there are 22 implementations of RelShuttleImpl(excluding tests) in calcite core. That hardly seems like no value add. I am not sure why RelNode.visit needs to exist though, the dispatch could simply be done in some method internal to the visitor/shuttle. On Thu, Dec 2, 2021 at 2:07 AM

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

2021-12-03 Thread James Starr
What if RelNode.accept(RelShuttle) was deprecated and the RelShuttleImpl had an if(node instanceof Logical*Node) instead? I am against further enhancing RelNode.accept(RelShuttle), because, as Vladimir pointed out, it does not actually follow a visitor pattern(aka walking the tree) and fixing that

Clean up Metadata type boiler plate and removing generic from MetadataHandler

2021-12-21 Thread James Starr
While learning calcite, then during subsequent discussions, the legacy code in the metadata sub-system caused significant understanding/discussion. Currently to define a rel metadata type: public class MyMetadata extends Metadata { MetadataDef DEF = ... VALUE myMethod1(); class Handler ext

Re: Why should invalidate all of the caches of HANDLERS when adding a new RelNode class in JaninoRelMetadataProvider.revise() method?

2022-01-16 Thread James Starr
That is old code. The generated code depends on knowing all types of rel node, so all the code must be regenerated after discovering a new type or rel node. Apache calcite main does not have this requirement. James On Sun, Jan 16, 2022 at 4:35 PM guangyuan wang wrote: > Yes, I can. > Here is

Re: Why should invalidate all of the caches of HANDLERS when adding a new RelNode class in JaninoRelMetadataProvider.revise() method?

2022-01-16 Thread James Starr
r than a switch-case against > an integer value, especially for such hot operations of metadata query. So > I wonder whether it will affect the overall latencies. > > Thank you. > Jinpeng Wu > > > On Mon, Jan 17, 2022 at 9:42 AM guangyuan wang > wrote: > > > Thank

Re: In over my head with advanced "RelBuilder" query building. Advice/thoughts appreciated

2022-02-08 Thread James Starr
Could you translate it to SQL, I am not familiar with expression queries like that. On Tue, Feb 8, 2022 at 1:46 PM Gavin Ray wrote: > I am trying to work out the RelBuilder calls to make to generate > expressions for nested queries > > Given some query like this: > > query { > user(where: { id

Structuring SubQueries as Functions

2022-12-01 Thread James Starr
Currently sub-query correlated variables have a brittle contract with their containing RelNode. Simple rules such as ones that transpose filters and projects are unaware of this contract and would be difficult to retrofit to handle all the rules to be sub-query aware. A correlated sub-query is lo

Re: Structuring SubQueries as Functions

2022-12-01 Thread James Starr
s://dl.acm.org/doi/10.1145/3186728.3164140 > > > > On Dec 1, 2022, at 11:09 AM, James Starr wrote: > > > > Currently sub-query correlated variables have a brittle contract with > > their containing RelNode. Simple rules such as ones that transpose > > filters and

Re: Structuring SubQueries as Functions

2022-12-05 Thread James Starr
lem with this proposal. But I’m too busy to give it > serious thought. Can someone else please review? > > > On Dec 1, 2022, at 1:23 PM, James Starr wrote: > > > > Hi Julian, > > > > I want to propose changing calcite's RexSubQuery. So the SubQuery would >

Re: Discuss: SubQueryRemoveRule sometimes can be convert to inner join to get a more better logical plan

2023-07-28 Thread James Starr
I think the design is to have a separate rule to do that optimization, specifically FilterJoinRule. Your desired outcome for your current example is easy to achieve with composition of existing rules. There is a considerable amount of code to handle all the cases in FilterJoinRule and it would be

Re: [Discussion] Can we forbidden SEARCH operator when use other execution engine?

2023-08-08 Thread James Starr
Alternatively, you could post-process the results after all the optimizations are performed. It is not a great deal of work to write a recursive Rel/Rex Shuttle. James On Tue, Aug 8, 2023 at 7:12 PM LakeShen wrote: > From calcite's point of view, calcite is not binded to any engine, it is > no

Re: Why is Filter's condition required to be flat?

2023-08-10 Thread James Starr
Are you asking about RexUtil::flatten or some other helper function? On Wed, Aug 9, 2023 at 5:28 PM Julian Hyde wrote: > Flattened expressions - so that AND never contains a child that is > AND, and OR never contains a child that is OR - is a canonized form > that seems to have more advantages t

Re: [jira] [Created] (CALCITE-6363) Introduce a rule to derive more filters from inner join condition

2024-04-15 Thread James Starr
The keyword I think you want is transitive filter pushdown. The reduce expression rule handles some of the trivial cases outlined as examples. Also, you will need to simplify the pushed down filters after they are extracted to prevent infinite loops. Ideally, for the equivalenceMap, an arbitrary

Breaking up SqlValidatorImpl

2024-08-23 Thread James Starr
I am working on rebasing my for pull request ( https://github.com/apache/calcite/pull/3042), for CALCITE-5418( https://issues.apache.org/jira/browse/CALCITE-5418) which stores the correlated variable ids subquery instead of the RelNodes(join, project, filter). This change was briefly discussed her

Re: [DISCUSSION] Automatically closing stale pull requests

2024-08-23 Thread James Starr
I second Francis Chuang sentiment. I have several PR that I have not abandoned but no will review. I also have had several bugs closed that are still bugs. But having a long list of PR that never gets reviewed and bugs that no one is fixing, or reviewing the fixes is not productive. On Thu, A

Re: Breaking up SqlValidatorImpl

2024-08-23 Thread James Starr
time, it may be > harder to review. > > Mihai > > ________ > From: James Starr > Sent: Friday, August 23, 2024 12:26 PM > To: dev@calcite.apache.org > Subject: Breaking up SqlValidatorImpl > > I am working on rebasing my for pull request ( >

[jira] [Created] (CALCITE-4172) SqlValidatorImpl.validateGroupClause attempts to resolve parts of the group by clause before expanding

2020-08-12 Thread James Starr (Jira)
James Starr created CALCITE-4172: Summary: SqlValidatorImpl.validateGroupClause attempts to resolve parts of the group by clause before expanding Key: CALCITE-4172 URL: https://issues.apache.org/jira/browse

[jira] [Created] (CALCITE-4210) Aggregation is dropped during decorreleation

2020-09-01 Thread James Starr (Jira)
James Starr created CALCITE-4210: Summary: Aggregation is dropped during decorreleation Key: CALCITE-4210 URL: https://issues.apache.org/jira/browse/CALCITE-4210 Project: Calcite Issue Type

[jira] [Created] (CALCITE-4257) Allow CachingRelMetadataProvider.cache to be parameterized in the constructor

2020-09-14 Thread James Starr (Jira)
James Starr created CALCITE-4257: Summary: Allow CachingRelMetadataProvider.cache to be parameterized in the constructor Key: CALCITE-4257 URL: https://issues.apache.org/jira/browse/CALCITE-4257

[jira] [Created] (CALCITE-4340) Correlated Queries in ON clause do not work when referring to left side

2020-10-15 Thread James Starr (Jira)
James Starr created CALCITE-4340: Summary: Correlated Queries in ON clause do not work when referring to left side Key: CALCITE-4340 URL: https://issues.apache.org/jira/browse/CALCITE-4340 Project

[jira] [Created] (CALCITE-4408) Oracle substr operator throws an exception when matching operand exception

2020-11-18 Thread James Starr (Jira)
James Starr created CALCITE-4408: Summary: Oracle substr operator throws an exception when matching operand exception Key: CALCITE-4408 URL: https://issues.apache.org/jira/browse/CALCITE-4408 Project

[jira] [Created] (CALCITE-4493) Postgres String Literal Equality Creates incorrect results.

2021-02-10 Thread James Starr (Jira)
James Starr created CALCITE-4493: Summary: Postgres String Literal Equality Creates incorrect results. Key: CALCITE-4493 URL: https://issues.apache.org/jira/browse/CALCITE-4493 Project: Calcite

[jira] [Created] (CALCITE-4539) Support pluggable metadata handlers and caching

2021-03-16 Thread James Starr (Jira)
James Starr created CALCITE-4539: Summary: Support pluggable metadata handlers and caching Key: CALCITE-4539 URL: https://issues.apache.org/jira/browse/CALCITE-4539 Project: Calcite Issue

[jira] [Created] (CALCITE-4544) Deprecate Metadata API backed by Java Reflection

2021-03-19 Thread James Starr (Jira)
James Starr created CALCITE-4544: Summary: Deprecate Metadata API backed by Java Reflection Key: CALCITE-4544 URL: https://issues.apache.org/jira/browse/CALCITE-4544 Project: Calcite Issue

[jira] [Created] (CALCITE-4546) No Longer require RelNode subtype registration for Metadata

2021-03-22 Thread James Starr (Jira)
James Starr created CALCITE-4546: Summary: No Longer require RelNode subtype registration for Metadata Key: CALCITE-4546 URL: https://issues.apache.org/jira/browse/CALCITE-4546 Project: Calcite

[jira] [Created] (CALCITE-4550) Simplify JaninoRelMetadataProvider API for binding methods

2021-03-24 Thread James Starr (Jira)
James Starr created CALCITE-4550: Summary: Simplify JaninoRelMetadataProvider API for binding methods Key: CALCITE-4550 URL: https://issues.apache.org/jira/browse/CALCITE-4550 Project: Calcite

[jira] [Created] (CALCITE-4551) Fly Weight for MD Cache Keys

2021-03-24 Thread James Starr (Jira)
James Starr created CALCITE-4551: Summary: Fly Weight for MD Cache Keys Key: CALCITE-4551 URL: https://issues.apache.org/jira/browse/CALCITE-4551 Project: Calcite Issue Type: Improvement

[jira] [Created] (CALCITE-4668) RelBuilder.join should only emit a correlate when a correlate variable exists

2021-06-25 Thread James Starr (Jira)
James Starr created CALCITE-4668: Summary: RelBuilder.join should only emit a correlate when a correlate variable exists Key: CALCITE-4668 URL: https://issues.apache.org/jira/browse/CALCITE-4668

[jira] [Created] (CALCITE-4686) SubQueryRemoveRule.matchJoin should correctly rewrite all sub-queries

2021-07-07 Thread James Starr (Jira)
James Starr created CALCITE-4686: Summary: SubQueryRemoveRule.matchJoin should correctly rewrite all sub-queries Key: CALCITE-4686 URL: https://issues.apache.org/jira/browse/CALCITE-4686 Project

[jira] [Created] (CALCITE-4791) RelBuilder.join incorrectly rewrites correlated conditions

2021-09-22 Thread James Starr (Jira)
James Starr created CALCITE-4791: Summary: RelBuilder.join incorrectly rewrites correlated conditions Key: CALCITE-4791 URL: https://issues.apache.org/jira/browse/CALCITE-4791 Project: Calcite

[jira] [Created] (CALCITE-4792) SqlToRel should populate corralateId for join with corralated query in ON condition

2021-09-22 Thread James Starr (Jira)
James Starr created CALCITE-4792: Summary: SqlToRel should populate corralateId for join with corralated query in ON condition Key: CALCITE-4792 URL: https://issues.apache.org/jira/browse/CALCITE-4792

[jira] [Created] (CALCITE-4808) RelOptUtil.getVariablesUsed should assert that correlated variables are used in scope

2021-09-27 Thread James Starr (Jira)
James Starr created CALCITE-4808: Summary: RelOptUtil.getVariablesUsed should assert that correlated variables are used in scope Key: CALCITE-4808 URL: https://issues.apache.org/jira/browse/CALCITE-4808

[jira] [Created] (CALCITE-4812) RelBuilder.join should handle multiple correlate ids

2021-09-28 Thread James Starr (Jira)
James Starr created CALCITE-4812: Summary: RelBuilder.join should handle multiple correlate ids Key: CALCITE-4812 URL: https://issues.apache.org/jira/browse/CALCITE-4812 Project: Calcite

[jira] [Created] (CALCITE-4942) Deprecate Bolier plate for Rel Metadata

2021-12-15 Thread James Starr (Jira)
James Starr created CALCITE-4942: Summary: Deprecate Bolier plate for Rel Metadata Key: CALCITE-4942 URL: https://issues.apache.org/jira/browse/CALCITE-4942 Project: Calcite Issue Type

[jira] [Created] (CALCITE-5413) Nested Subqueries with correlated variables are not decorrelated correctly

2022-12-01 Thread James Starr (Jira)
James Starr created CALCITE-5413: Summary: Nested Subqueries with correlated variables are not decorrelated correctly Key: CALCITE-5413 URL: https://issues.apache.org/jira/browse/CALCITE-5413

[jira] [Created] (CALCITE-5418) Nested Queries are not expanded properly

2022-12-02 Thread James Starr (Jira)
James Starr created CALCITE-5418: Summary: Nested Queries are not expanded properly Key: CALCITE-5418 URL: https://issues.apache.org/jira/browse/CALCITE-5418 Project: Calcite Issue Type: Bug

[jira] [Created] (CALCITE-5420) SqlToRel should populate projects corralate id for queries with aggregates.

2022-12-02 Thread James Starr (Jira)
James Starr created CALCITE-5420: Summary: SqlToRel should populate projects corralate id for queries with aggregates. Key: CALCITE-5420 URL: https://issues.apache.org/jira/browse/CALCITE-5420

[jira] [Created] (CALCITE-5421) SqlToRel should populate corralateId for join with corralated query in HAVING condition

2022-12-05 Thread James Starr (Jira)
James Starr created CALCITE-5421: Summary: SqlToRel should populate corralateId for join with corralated query in HAVING condition Key: CALCITE-5421 URL: https://issues.apache.org/jira/browse/CALCITE-5421