[jira] [Created] (CALCITE-7090) Add RepeatUnion override for RelHomogeneousShuttle

2025-07-08 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-7090: --- Summary: Add RepeatUnion override for RelHomogeneousShuttle Key: CALCITE-7090 URL: https://issues.apache.org/jira/browse/CALCITE-7090 Project: Calcite

RE: Re: How to read and understand Volcano Planner traces?

2025-04-24 Thread Ian Bertolacci
Gavin, That is certainly one nice tool. The visualization system and the listeners are nice (though it does not seem to work on larger plans with lots of planning steps) , but its still not clear to me what some of the symbology means. For example, a subset has several children, one of which is p

How to read and understand Volcano Planner traces?

2025-04-24 Thread Ian Bertolacci
help me understand this? Thanks! -Ian Bertolacci [1] https://github.com/anha1/fluorite [2] https://github.com/anha1/fluorite/issues/1

BindableTableScan and RelMdColumnUniqueness

2025-04-03 Thread Ian Bertolacci
handler for BindableTableScan in this pathway (which is through CalcitePrepareImpl) If this is not a configuration issue, I will file a bug JIRA -Ian Bertolacci

RE: Re: Is it possible to have type system with scale that is precision agnostic?

2025-03-17 Thread Ian Bertolacci
Looks like I’ve already encountered this before: https://issues.apache.org/jira/browse/CALCITE-5212 It seems like with this fix we could have precision agnostic type systems.

RE: Re: Is it possible to have type system with scale that is precision agnostic?

2025-03-17 Thread Ian Bertolacci
I think there’s still the issue of exposing that to the type system. Theres a lot of logic all over the place that computes the precision/scale of expressions, and when these values hit the max, things start to get weird. -Ian

Re: Is it possible to have type system with scale that is precision agnostic?

2025-03-17 Thread Ian Bertolacci
Thinking about it some more, it may be more accurate to ask if it is possible to have an infinite max scale/precision. We may care about the type’s scale and/or precision, but we do not necessarily need or want to define an upper bound on what they can be. -Ian

Is it possible to have type system with scale that is precision agnostic?

2025-03-17 Thread Ian Bertolacci
I’ve got a good one for y’all today. In our engine, we don’t care about precision, but we *do* care about scale. This is because we have mechanisms for handling arbitrarily wide decimals, but we at least require that all decimals in a column have the same scale. It is possible for us to express t

Re: Questions about RelMdColumnUniqueness

2025-03-11 Thread Ian Bertolacci
Filed https://issues.apache.org/jira/browse/CALCITE-6882 Included a few demonstrations of the weirdness. I still think that *both* predicate pullup/refinement and analysis of the join are wrong, since any unique columns will cause a keyset of non-unique columns to become unique as a whole when th

[jira] [Created] (CALCITE-6882) RelMdColumnUniqueness incorrectly claims fields are not unique if constant refinement occurs in a node above join

2025-03-10 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-6882: --- Summary: RelMdColumnUniqueness incorrectly claims fields are not unique if constant refinement occurs in a node above join Key: CALCITE-6882 URL: https://issues.apache.org

Re: Questions about RelMdColumnUniqueness

2025-03-07 Thread Ian Bertolacci
That example makes sense but isn’t directly related to the issue here. In this example: `select T1.id, count(*) from T1 inner join T2 on T1.foreignKey = T2.ID where T2.foo = 1234 group by T1.id` AggregateRemoveRule wants to know if `T1.id` after the filter is unique. The answer should be “yes” b

Re: Questions about RelMdColumnUniqueness

2025-03-07 Thread Ian Bertolacci
Two comments: First: on our side, we’d like to know if *removing* the use of this predicate pullup information would have *negative* consequences for correctness. If it does not impact correctness: we can override the behavior to not consider this information, and move forwards. Second: a collea

Re: Questions about RelMdColumnUniqueness

2025-03-07 Thread Ian Bertolacci
Ah, the chained provider helps. Thanks! -Ian

Re: Questions about RelMdColumnUniqueness

2025-03-07 Thread Ian Bertolacci
Related: I have absolutely no idea how to make a minor override to RelMdColumnUniqueness without modifying the class itself. I really don’t understand how all this bespoke reflection works, or how to augment the behavior of existing handlers. Is there any documentation, guides, or examples that

Questions about RelMdColumnUniqueness

2025-03-07 Thread Ian Bertolacci
union the parameter columns with the result of decorateWithConstantColumnsFromPredicates, so I imagine this impacts other RelNode types and optimizations. Is my understanding of this correct? Thanks! -Ian Bertolacci [1] https://issues.apache.org/jira/browse/CALCITE-3428?focusedCommentId=17933163

Re: RelFieldTrimmer not optimally trimming after filters under joins?

2025-03-04 Thread Ian Bertolacci
I just hacked together an override where it will build a redundant project on each side if necessary. That should eliminate any overhead of invoking any planners or rules. (For our needs, additional projects have not performance implications) -Ian From: Ian Bertolacci Reply-To: &quo

Re: RelFieldTrimmer not optimally trimming after filters under joins?

2025-03-04 Thread Ian Bertolacci
ry node in the tree before trimming, and then clean up with ProjectRemoveRule. On Tue, Mar 4, 2025 at 1:33 PM Ian Bertolacci wrote: > I’m looking at using RelFieldTrimmer, and I’m noticing that if a side of a > join has unnecessary fields after a filter, there is no trim-fields project > on

RelFieldTrimmer not optimally trimming after filters under joins?

2025-03-04 Thread Ian Bertolacci
I’m looking at using RelFieldTrimmer, and I’m noticing that if a side of a join has unnecessary fields after a filter, there is no trim-fields project on that side to reduce the width of the row. Is this expected, or is there a configuration or pre-processing step that I am missing? For example

Re: Understanding Statistic unique keys

2025-02-28 Thread Ian Bertolacci
leBitSet columns) { for (ImmutableBitSet key : keysCopy) { if (columns.contains(key)) { return true; } } return false; } If any key combination includes any of the key combinations of the list, then it is a key. On Fri, Feb 28,

Understanding Statistic unique keys

2025-02-28 Thread Ian Bertolacci
Howdy, From Statistic.getKeys: Returns a list of unique keys, or null if no key exist. I’m not understanding why this is a list of bitsets. Is the idea that each entry in the list is a bitset of keys which are unique when used together? For example, lets say I have this table: C0 | C1 | C2 0 | 2

[jira] [Created] (CALCITE-6626) SqlToRelConverter mixes uses of configured RelBuilder and Logical.create methods.

2024-10-14 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-6626: --- Summary: SqlToRelConverter mixes uses of configured RelBuilder and Logical.create methods. Key: CALCITE-6626 URL: https://issues.apache.org/jira/browse/CALCITE-6626

Tutorials/Documentation on Schemas and Catalogs?

2024-09-23 Thread Ian Bertolacci
Howdy, I want to know more about Calcite’s schemas and catalogs. Obviously I’m do some schema stuff right to use Calcite, but I feel like I could be doing a lot more. Do we have any thorough documents or tutorials on this subject? I feel like most of the stuff I see creates schemas mostly as boile

[jira] [Created] (CALCITE-6554) nested correlated sub-query in aggregation does not have inner correlation variable bound to inner projection

2024-08-28 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-6554: --- Summary: nested correlated sub-query in aggregation does not have inner correlation variable bound to inner projection Key: CALCITE-6554 URL: https://issues.apache.org/jira

RE: Direction on CALCITE-5213, nested correlated subquery conversion

2024-08-26 Thread Ian Bertolacci
6825 On 2024/08/20 16:22:34 Ian Bertolacci wrote: > Hello, JIRA CALCITE-5213 has been open for a while now and still seems to be > an issue. > I’ve included small example which demonstrates the issue. > I’m hoping someone can figure out what might be happening here (hopefully I

Direction on CALCITE-5213, nested correlated subquery conversion

2024-08-20 Thread Ian Bertolacci
Hello, JIRA CALCITE-5213 has been open for a while now and still seems to be an issue. I’ve included small example which demonstrates the issue. I’m hoping someone can figure out what might be happening here (hopefully I’m just doing something wrong) and see if there are possible solutions. Thank

[jira] [Created] (CALCITE-6508) Parse error when using scalar sub-query as operant to Array constructor function

2024-07-31 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-6508: --- Summary: Parse error when using scalar sub-query as operant to Array constructor function Key: CALCITE-6508 URL: https://issues.apache.org/jira/browse/CALCITE-6508

[jira] [Created] (CALCITE-6504) JOIN_SUB_QUERY_TO_CORRELATE/Join SubQueryRemoveRule produces incorrect tree when using correlated sub-query in on clause of equi-join

2024-07-26 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-6504: --- Summary: JOIN_SUB_QUERY_TO_CORRELATE/Join SubQueryRemoveRule produces incorrect tree when using correlated sub-query in on clause of equi-join Key: CALCITE-6504 URL: https

[jira] [Created] (CALCITE-6499) Deep Clone SqlNodes

2024-07-24 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-6499: --- Summary: Deep Clone SqlNodes Key: CALCITE-6499 URL: https://issues.apache.org/jira/browse/CALCITE-6499 Project: Calcite Issue Type: Improvement

Preserving alias/Frames in RelBuilder when extending RelBuilder?

2024-06-20 Thread Ian Bertolacci
see what the top Frame’s alias is without modifying the core RelBuilder code? Thanks! -Ian Bertolacci

RE: Re: Existing rules for duplication of filter conditions above joins which should not be pushed down by FilterIntoJoinRule ?

2023-09-27 Thread Ian Bertolacci
om.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14534098 > > On Tue, Sep 26, 2023 at 10:10 PM Ian Bertolacci > mailto:ia...@workday.com.inva>lid> wrote: > > > > Hi, > > I was wondering if there exist any rules to duplicate filters which ex

Existing rules for duplication of filter conditions above joins which should not be pushed down by FilterIntoJoinRule ?

2023-09-26 Thread Ian Bertolacci
Hi, I was wondering if there exist any rules to duplicate filters which exist above the join, whose effect is dependent on the result of the join and therefore cannot be *pushed* below a join, but could be *duplicated* below the join. For example: `select … from A LEFT join B on … where B.field

RE: Re: Filter push-down below join not occurring for custom UDF

2023-08-30 Thread Ian Bertolacci
2 for how to activate it, the rest 15 to 23 on > > how to read the output): > > https://www.slideshare.net/StamatisZampetakis/debugging-planning-issues-using-calcites-builtin-loggers > > . > > > > Hth, > > Alessandro > > > > > > > > On Wed,

RE: Re: Filter push-down below join not occurring for custom UDF

2023-08-30 Thread Ian Bertolacci
> > . > > > > Hth, > > Alessandro > > > > > > > > On Wed, 30 Aug 2023 at 04:14, Ian Bertolacci > > mailto:ia...@workday.com.inva>lid> wrote: > > > > > Hello, > > > We have defined some extra comparison functions for

Filter push-down below join not occurring for custom UDF

2023-08-29 Thread Ian Bertolacci
Hello, We have defined some extra comparison functions for our users. However, we’ve noticed that filter push-down (using ` CoreRules.FILTER_INTO_JOIN`) does not occur when the operands to the functions come from the opposite side of an outer join (i.e. from the right side of a left outer join,

Why is Filter's condition required to be flat?

2023-08-09 Thread Ian Bertolacci
Hello, I’m curious about why Filter requires that the condition be a flattened tree? We have some transformations which occasionally result in non-flat trees, which causes issues for us in testing. I know we can avoid this by constructing expressions using RelBuilder or the RexUtil.composeConjun

[jira] [Created] (CALCITE-5722) Sarg.isComplementedPoints fails with anti-points which are equal under `compareTo` but not `equals`

2023-05-24 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-5722: --- Summary: Sarg.isComplementedPoints fails with anti-points which are equal under `compareTo` but not `equals` Key: CALCITE-5722 URL: https://issues.apache.org/jira/browse

Re: Re: Rules to squash redundant join sides?

2023-04-04 Thread Ian Bertolacci
I’ve filed CALCITE-5631 with the example in SQL and RelNode forms https://issues.apache.org/jira/browse/CALCITE-5631 -Ian

[jira] [Created] (CALCITE-5631) Optimization to merge redundant joins

2023-04-04 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-5631: --- Summary: Optimization to merge redundant joins Key: CALCITE-5631 URL: https://issues.apache.org/jira/browse/CALCITE-5631 Project: Calcite Issue Type

Re: Re: Rules to squash redundant join sides?

2023-03-30 Thread Ian Bertolacci
nVSxbgOx-CLhOl2WSB_2MMTXI1BMG$> On Thu, Mar 30, 2023 at 1:27 AM Ian Bertolacci wrote: > > Howdy, > Is there a collection of rules which squash a tree of binary joins if the > same side of each join is mergeable? > > For example: > ``` > 201:LogicalProject(P4=[$70], P5=[$72]) > └

Rules to squash redundant join sides?

2023-03-29 Thread Ian Bertolacci
. I figure that there exists some set of existing rules which when applied together would accomplish what we want here. The joins arise from correlated subqueries, but are also synthetically generated, so it is not as simple as asking the user to manually do a single join. Thanks! -Ian Bertolacci

RE: Re: Why does timestamp diff return a value inconsistent with the time unit?

2023-02-07 Thread Ian Bertolacci
n > INTERVAL MINUTE, and the third returns an INTERVAL HOUR. All of these > intervals have the same internal representation — 31,536,000,000 milliseconds > — but they are printed differently because their types are different. > > INTERVAL MONTH and INTERVAL YEAR have a differe

Why does timestamp diff return a value inconsistent with the time unit?

2023-02-06 Thread Ian Bertolacci
I’ve noticed that Calcite evaluates to different time unit types than the given time unit type in a timestamp difference (I haven’t tested datetimes). For example: `(TIMESTAMP'1971-01-01 00:00:00' - TIMESTAMP'1970-01-01 00:00:00') $TIMEUNIT` gives 3153600 (milliseconds) when $TIMEUNIT = SECON

[jira] [Created] (CALCITE-5387) type-mismatch on nullability in JOIN_PUSH_TRANSITIVE_PREDICATES

2022-11-16 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-5387: --- Summary: type-mismatch on nullability in JOIN_PUSH_TRANSITIVE_PREDICATES Key: CALCITE-5387 URL: https://issues.apache.org/jira/browse/CALCITE-5387 Project

Adding implementations of operators for RexExecutor?

2022-11-10 Thread Ian Bertolacci
Howdy, I’m playing around with some testing expressions after transformation, and would like to use RexExecutor to evaluate\* the original expression and expression resulting from the transformation. (\*these expressions do not have input refs or any other kinds of “free-variables”) However, thi

Direction on CALCITE-4120?

2022-11-01 Thread Ian Bertolacci
Howdy, I’m was hoping to take on CALCITE-4120 but I think I need some nudging into the right direction. Basically, the immediate cause is that JdbcMeta and JdbcResultset use different calendars, which would imply that the immediate solution is to simply align them on which calendar to use. But I

[jira] [Created] (CALCITE-5273) RelToSqlConverter allows unparsing of invalid CASE expression

2022-09-07 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-5273: --- Summary: RelToSqlConverter allows unparsing of invalid CASE expression Key: CALCITE-5273 URL: https://issues.apache.org/jira/browse/CALCITE-5273 Project

[jira] [Created] (CALCITE-5272) RelBuilder/RexBuilder allow creation of invalid CASE expression

2022-09-07 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-5272: --- Summary: RelBuilder/RexBuilder allow creation of invalid CASE expression Key: CALCITE-5272 URL: https://issues.apache.org/jira/browse/CALCITE-5272 Project

RE: Re: How are custom UDFs, operators and their implementations provided to Calcite when using JdbcMeta?

2022-08-25 Thread Ian Bertolacci
rgs in UDFs [1]. I could never get excited > about it because it didn’t explain how things would look to the SQL user. > > Julian > > [1] https://issues.apache.org/jira/browse/CALCITE-2772 > <https://issues.apache.org/jira/browse/CALCITE-2772><https://issues.apache.org/jira

How are custom UDFs, operators and their implementations provided to Calcite when using JdbcMeta?

2022-08-23 Thread Ian Bertolacci
Hello, Our current approach to defining custom UDFs and their implementations works by… 1. Defining the udf and its implementation in a class member function 2. Creating a Calcite definitions in the form of `schema.Function`s via `ScalarFunctionImpl.create` or `AggregateFunctionImpl.create

[jira] [Created] (CALCITE-5213) PROJECT_TO_SUBQUERY producing Incorrect tree from nested correlated subqueries in projections with correlations in filters.

2022-07-15 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-5213: --- Summary: PROJECT_TO_SUBQUERY producing Incorrect tree from nested correlated subqueries in projections with correlations in filters. Key: CALCITE-5213 URL: https

[jira] [Created] (CALCITE-5212) Attempting to create a Decimal with scale specified but precision not specified results in Decimal with scale 0

2022-07-15 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-5212: --- Summary: Attempting to create a Decimal with scale specified but precision not specified results in Decimal with scale 0 Key: CALCITE-5212 URL: https://issues.apache.org

[jira] [Created] (CALCITE-5210) "type mismatch" litmus test failure during during SqlToRelConverter for group-by on `case` having `in` expression predicates exceeding SqlRelConverter.Config InSubQuery

2022-07-11 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-5210: --- Summary: "type mismatch" litmus test failure during during SqlToRelConverter for group-by on `case` having `in` expression predicates exceeding SqlRelConverter.Config InSubQueryThreshold wit

[jira] [Created] (CALCITE-5209) ArrayIndexOutOfBoundsException during SqlToRelConverter for group-by with `in` expression predicates exceeding SqlRelConverter.Config InSubQueryThreshold

2022-07-11 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-5209: --- Summary: ArrayIndexOutOfBoundsException during SqlToRelConverter for group-by with `in` expression predicates exceeding SqlRelConverter.Config InSubQueryThreshold Key: CALCITE-5209

Re: Vararg/Variadic UDFs or workarounds?

2022-05-19 Thread Ian Bertolacci
requires modifications to the Calcite code base, and we’re doing just about all we can to not maintain our own fork of Calcite. Any suggestions? -Ian J. Bertolacci From: Ian Bertolacci Date: Friday, April 8, 2022 at 10:04 AM To: dev@calcite.apache.org Subject: [External Sender] Re: Vararg

[jira] [Created] (CALCITE-5092) Calcite Web: API doc search gives links with invalid "undefined" subpath resulting in 404

2022-04-13 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-5092: --- Summary: Calcite Web: API doc search gives links with invalid "undefined" subpath resulting in 404 Key: CALCITE-5092 URL: https://issues.apache.org/jira/browse/CA

Re: Vararg/Variadic UDFs or workarounds?

2022-04-08 Thread Ian Bertolacci
491 [3] https://issues.apache.org/jira/browse/CALCITE-4394 On Tue, Apr 5, 2022 at 12:15 AM Ian Bertolacci wrote: > Howdy! > We’re trying to add a vararg/variadic UDF, but cannot seem to make it work > out. > > In our system, we define our UDFs to the Schema’s functio

Vararg/Variadic UDFs or workarounds?

2022-04-04 Thread Ian Bertolacci
Howdy! We’re trying to add a vararg/variadic UDF, but cannot seem to make it work out. In our system, we define our UDFs to the Schema’s function multimap, and so have classes with methods which are provided to ScalarFunctionImpl.create(theClass, “methodName” ) to create the Function object, an

getArray from Calcite JDBC ResultSet

2022-03-29 Thread Ian Bertolacci
Hi, I recently noticed that I cannot get arrays from Calcite’s JDBC ResultSet. In particular array literals, or simple field expressions whose type is Array BigInt all give this exception: java.sql.SQLException: invalid column ordinal: 2 This is regardless of how many other columns there are or wh

Database Engineering Opportunity at Workday

2022-02-14 Thread Ian Bertolacci
Howdy! We have an opening on our team, and people in the Calcite development organization would be a really good fit! Job Posting: https://workday.wd5.myworkdayjobs.com/Workday/job/USA-CA-Pleasanton/Sr-Software-Engineer--Query-_JR-61589 This specific position is for the Pleasanton California Wor

Mailing list's policy on job postings?

2022-01-04 Thread Ian Bertolacci
Howdy, What is this mailing list’s policy regarding job postings? Thanks! -Ian J. Bertolacci

Re: Re: Adding a custom SQL type?

2022-01-04 Thread Ian Bertolacci
mains in Calcite. If someone wants to put in the effort, it could be revived. Julian [1] https://urldefense.com/v3/__http://farrago.sourceforge.net/design/UserDefinedTypesAndRoutines.html__;!!Iz9xO38YGHZK!oiFiyX0IxZRZIIF5fjOcsDWM6k0LeVfXDPSmwxWWMg-Kt5oNwGr1vXNC8XzRS-AndbSm$

Re: Adding a custom SQL type?

2022-01-04 Thread Ian Bertolacci
9xO38YGHZK!oiFiyX0IxZRZIIF5fjOcsDWM6k0LeVfXDPSmwxWWMg-Kt5oNwGr1vXNC8XzRS-AndbSm$ > On Jan 4, 2022, at 12:06 PM, Ian Bertolacci wrote: > > Howdy, > How difficult would it be for a Calcite user to add their own type to the type system? > Is there a define process for doing this?

Adding a custom SQL type?

2022-01-04 Thread Ian Bertolacci
Howdy, How difficult would it be for a Calcite user to add their own type to the type system? Is there a define process for doing this? In our system, a relationship is a semantic type which is physically a long integer. We’ve been able to get by with typing relaltionship fields as SqlTypeName.

Re: Is there a mechanism for constant folding in Calcite?

2021-10-26 Thread Ian Bertolacci
> > ReduceExpressionsRule is always used to do constant folding. > > > Best, > Chunwei > > > On Tue, Oct 26, 2021 at 4:34 AM Ian Bertolacci > wrote: > >> Howdy, >> Does Calcite have any mechanism for

Is there a mechanism for constant folding in Calcite?

2021-10-25 Thread Ian Bertolacci
Howdy, Does Calcite have any mechanism for applying constant folding to RexNodes in a query? We’ve been wondering why expressions like `1 + 2` don’t get folded into the constant `3`. We’re aware of RexSimplify, but it only does constant folding for Boolean expressions (i.e. logical and (some) c

[jira] [Created] (CALCITE-4852) RelToSqlConverter creates unparseable SQL string from right associative multi-way join.

2021-10-14 Thread Ian Bertolacci (Jira)
Ian Bertolacci created CALCITE-4852: --- Summary: RelToSqlConverter creates unparseable SQL string from right associative multi-way join. Key: CALCITE-4852 URL: https://issues.apache.org/jira/browse/CALCITE-4852

How to match root node in a HEP Rule?

2021-05-03 Thread Ian Bertolacci
Hello, I am trying to write a rule that matches (among other things) the root of a RelNode tree. Unfortunately, it seems that HepRuleCall.parents is only initialized and populated if the rule extends CommonRelSubExpr, which doesn’t really apply in my case. (see: https://github.com/apache/calci