Re: Optimizer (Hep) NOT scanning RelNodes of Subqqueries

2021-06-14 Thread Krishnakant Agrawal
de the subquery related rules in the HepPlanner? > > > > Haisheng > > > > On 2021/06/09 17:59:44, Krishnakant Agrawal > wrote: > >> Hi All, > >> > >> When running a HepOptimizer on top of a RelNode which has a subquery > >> embedded in

Optimizer (Hep) NOT scanning RelNodes of Subqqueries

2021-06-09 Thread Krishnakant Agrawal
Hi All, When running a HepOptimizer on top of a RelNode which has a subquery embedded in it, The Optimizer does not take the RelNode representing the subquery up for optimization. Is this by design, what's the correct way for the Subquery RelNode to be picked up for Optimization? If this is a

Re: DISTINCT not being handled correctly in RelToSqlConverter

2018-12-28 Thread Krishnakant Agrawal
; https://github.com/apache/calcite/blob/9d50e6d7418579c5a73d872e6aec5924ed97c239/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java#L1027 > > > > > On Dec 26, 2018, at 2:44 AM, Krishnakant Agrawal > wrote: > > > > Hi All, > > > > When c

[jira] [Created] (CALCITE-2757) DISTINCT not being handled correctly in RelToSqlConverter

2018-12-28 Thread KrishnaKant Agrawal (JIRA)
KrishnaKant Agrawal created CALCITE-2757: Summary: DISTINCT not being handled correctly in RelToSqlConverter Key: CALCITE-2757 URL: https://issues.apache.org/jira/browse/CALCITE-2757 Project

DISTINCT not being handled correctly in RelToSqlConverter

2018-12-26 Thread Krishnakant Agrawal
Hi All, When creating a RelNode for a Query with a DISTINCT keyword in it, I use the relBuilder.distinct() api to apply distinct. It creates a LogicalAggregate with all the Fields of the LogicalProject as the GroupKey. This is a problem when one of those projections is a windowing function (i.e

Correlated Variables in TableModify(Update)

2018-11-19 Thread Krishnakant Agrawal
Hi, When creating a TableModify(Update), I see correlated variables are used to encapsulate the right side of SET expressions. I was wondering what is the purpose of creating correlated variable references. On its face value, it seems to create stand-alone expressions, column references are

[jira] [Created] (CALCITE-2625) Function Specific Sql Window Unparsing where Framing Not Allowed

2018-10-12 Thread KrishnaKant Agrawal (JIRA)
KrishnaKant Agrawal created CALCITE-2625: Summary: Function Specific Sql Window Unparsing where Framing Not Allowed Key: CALCITE-2625 URL: https://issues.apache.org/jira/browse/CALCITE-2625

[jira] [Created] (CALCITE-2623) Updating unparseCall() in SqlDialect(s) for dialect specifc SqlNode unparsing

2018-10-12 Thread KrishnaKant Agrawal (JIRA)
KrishnaKant Agrawal created CALCITE-2623: Summary: Updating unparseCall() in SqlDialect(s) for dialect specifc SqlNode unparsing Key: CALCITE-2623 URL: https://issues.apache.org/jira/browse/CALCITE-2623

Re: Function Specific Sql Window Unparsing where Framing Not Allowed

2018-09-11 Thread Krishnakant Agrawal
ror message seems to come from Hive, not Calcite. How does Calcite > fit into this? Are you using Calcite to generate the SQL? > > > On Sep 11, 2018, at 8:58 AM, Krishnakant Agrawal > wrote: > > > > Hi, > > > > Unparsing of SqlWindow related to SqlRankFunct

Re: Ordering By Projection Alias in RelToSqlConverter

2018-09-11 Thread Krishnakant Agrawal
Okay, will try and come up with a PR then. On Wed, Sep 12, 2018 at 1:43 AM Julian Hyde wrote: > Thanks for logging a case. It’s not high on my priorities to fix this (or > anyone else’s AFAIK) so contributions are welcome. > > > On Sep 11, 2018, at 3:37 AM, Krishnakant A

Function Specific Sql Window Unparsing where Framing Not Allowed

2018-09-11 Thread Krishnakant Agrawal
Hi, Unparsing of SqlWindow related to SqlRankFunction & SqlLeadLagFunction type of SQL Operators should consider whether the Boundary Specifications should be printed or not(where Framing is not allowed!) For Instance, *SELECT employee_id, ROW_NUMBER() OVER (PARTITION BY department_id ORDER BY

Re: Ordering By Projection Alias in RelToSqlConverter

2018-09-11 Thread Krishnakant Agrawal
obably “ORDER BY ” is the best solution on dialects > that support it (and most do). > > Julian > > > On Sep 3, 2018, at 09:41, Krishnakant Agrawal > wrote: > > > > Hi All, > > > > I am trying to convert a Simple RelNode to SQL Text with Hive as

[jira] [Created] (CALCITE-2552) Dialect Specific Order By Field Identifier Resolution

2018-09-11 Thread KrishnaKant Agrawal (JIRA)
KrishnaKant Agrawal created CALCITE-2552: Summary: Dialect Specific Order By Field Identifier Resolution Key: CALCITE-2552 URL: https://issues.apache.org/jira/browse/CALCITE-2552 Project

Ordering By Projection Alias in RelToSqlConverter

2018-09-03 Thread Krishnakant Agrawal
Hi All, I am trying to convert a Simple RelNode to SQL Text with Hive as Dialect using RelToSqlConverter. Problem is if the Order By Key is a Projection which was Aliased, the Output query contains the original column name instead of the Alias, which is not allowed in Hive as valid Order By keys

Volcano Planner spitting out EnumerableThetaJoin with RexInputRef in On Condition

2018-05-08 Thread Krishnakant Agrawal
Hi All, I am using the VolcanoPlanner(with Default Rules) to optimize a RelNode which has a Join as below:- LogicalJoin(condition=[AND(AND(AND(=($1, $46), =(CAST($11):FLOAT NOT NULL, $47)), <>($46, -999)), <>($47, -999))], joinType=[left]) LogicalTableScan(table=[[defaultschema,