[jira] [Created] (CALCITE-4326) NPE possible win EnumerableWindow when agg.call.name is null

2020-10-10 Thread Vladimir Sitnikov (Jira)
Vladimir Sitnikov created CALCITE-4326:
--

 Summary: NPE possible win EnumerableWindow when agg.call.name is 
null
 Key: CALCITE-4326
 URL: https://issues.apache.org/jira/browse/CALCITE-4326
 Project: Calcite
  Issue Type: Sub-task
  Components: core
Affects Versions: 1.26.0
Reporter: Vladimir Sitnikov


{code:java}
  final RelDataTypeFactory.Builder typeBuilder = typeFactory.builder();
  typeBuilder.addAll(inputPhysType.getRowType().getFieldList());
  for (AggImpState agg : aggs) {
typeBuilder.add(agg.call.name, agg.call.type);
  }
{code}

AggregateCall#name is nullable



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: Draft board report for October 2020

2020-10-10 Thread Vladimir Sitnikov
Julian>You must be an old C programmer, using 1 and 0 for true

I still support Oracle DB 10g/11g apps, so booleans and filter() do not
even exist in my world :)

It turns out ./sqlsh is something that can execute "select count(*) from
git_commits" directly (no models required).
It would be nice to unify sqlline and sqlsh into a single command.

Vladimir


Re: Potential issue with RexSimplify/Sarg in Calcite 1.26

2020-10-10 Thread Igor Lozynskyi
Hi!

I created a JIRA ticket regarding this issue:
https://issues.apache.org/jira/browse/CALCITE-4325

Regards,
Igor Lozynskyi
On 9 Oct 2020, 23:24 +0300, Julian Hyde , wrote:
> Those cases you have found are indeed regressions. Please log a JIRA case.
>
> For the record, I am still a strong believer in the Sarg approach.
> Expressions such as
>
> (deptno <> 20 OR deptno IS NULL) AND deptno = 10
>
> are complex when expressed as ANDs and ORs but can become a single
> Sarg and therefore are easy to optimize. I suspect that we regressed
> on these particular expressions because we did not have tests, and
> converting part of the expression to a Sarg broke some delicate
> simplification that was looking for a particular pattern of ANDs and
> ORs.
>
> Julian
>
> On Fri, Oct 9, 2020 at 9:23 AM Igor Lozynskyi  
> wrote:
> >
> > Hi all!
> >
> > In a downstream project, we are trying to migrate from Calcite 1.25 to 1.26.
> > The migration took us a bit longer than usual, so we could not give 
> > feedback during the release voting time frame. The migration seems to be 
> > successful except for one issue with filter simplification.
> >
> > Now, the Rex expressions like follows:
> > `(deptno = 20 OR deptno IS NULL) AND deptno = 10`
> > Are simplified to:
> > `deptno IS NULL`
> > Instead of:
> > `FALSE`
> >
> > Similarly, the following expression:
> > `(deptno <> 20 OR deptno IS NULL) AND deptno = 10`
> > Is simplified to:
> > `deptno = 10 OR deptno IS NULL`
> > Instead of:
> > `deptno = 10`
> >
> > These discrepancies were identified by our test suites.
> >
> > A diff with related unit tests (for RelBuilderTest.java) is in the 
> > attachment.
> >
> > Is this change is desired, or this is an issue?
> >
> > With best regards,
> > Igor Lozynskyi


[jira] [Created] (CALCITE-4325) RexSimplify/Sarg incorrectly simplifies complex expressions with NULL

2020-10-10 Thread Igor Lozynskyi (Jira)
Igor Lozynskyi created CALCITE-4325:
---

 Summary: RexSimplify/Sarg incorrectly simplifies complex 
expressions with NULL
 Key: CALCITE-4325
 URL: https://issues.apache.org/jira/browse/CALCITE-4325
 Project: Calcite
  Issue Type: Bug
  Components: core
Affects Versions: 1.26.0
 Environment: All environments
Reporter: Igor Lozynskyi
 Attachments: rex-simplify-issue-tests.patch

In Calcite 1.26, the Rex expressions like follows:
 `(deptno = 20 OR deptno IS NULL) AND deptno = 10`
 Are simplified to:
 `deptno IS NULL`
 Instead of:
 `FALSE`

Similarly, the following expression:
 `(deptno <> 20 OR deptno IS NULL) AND deptno = 10`
 Is simplified to:
 `deptno = 10 OR deptno IS NULL`
 Instead of:
 `deptno = 10`

A diff with related unit tests (for RelBuilderTest.java) is in the attachment.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)