[jira] [Created] (CALCITE-5276) Implicitly convert strings to geometries

2022-09-08 Thread Bertil Chapuis (Jira)
Bertil Chapuis created CALCITE-5276:
---

 Summary: Implicitly convert strings to geometries
 Key: CALCITE-5276
 URL: https://issues.apache.org/jira/browse/CALCITE-5276
 Project: Calcite
  Issue Type: Improvement
Reporter: Bertil Chapuis






--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5277) Make EnumerableRelImplementor stashedParameters order deterministic to increase BINDABLE_CACHE hit rate

2022-09-08 Thread Ruben Q L (Jira)
Ruben Q L created CALCITE-5277:
--

 Summary: Make EnumerableRelImplementor stashedParameters order 
deterministic to increase BINDABLE_CACHE hit rate
 Key: CALCITE-5277
 URL: https://issues.apache.org/jira/browse/CALCITE-5277
 Project: Calcite
  Issue Type: Improvement
  Components: core
Reporter: Ruben Q L
 Fix For: 1.32.0


Make EnumerableRelImplementor stashedParameters order deterministic to increase 
BINDABLE_CACHE hit rate



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: How to get lineage for virtual column

2022-09-08 Thread Jiajun Xie
My real goal is to know which virtual columns are used in query.

- I tried to use `getColumnOrigins`, here is one test in RelMetadataTest
```
@Test void testVirtualColumnOrigins() {
final String sql = "select E from VIRTUALCOLUMNS.VC_T1 "
+ "for system_time as of TIMESTAMP '2011-01-02 00:00:00'";
// Actual column name is A, but I need E.
sql(sql).withCatalogReaderFactory(MockCatalogReaderExtended::create)
.assertColumnOriginSingle("VC_T1", "E", false);
// I know that A is reasonable value because E = A + 1. (The root column
origin should be A.)
}
```

- Visit SqlNode is another solution, but there are some fields not be
trimmed.

I want to know if anyone has suggestions to get virtual column that query
used.

Thank you for your reply.

On Thu, 8 Sept 2022 at 14:55, Julian Hyde  wrote:

> You know, when people ask ‘Does Calcite support lineage?’, I’m never quite
> sure. People mean different things by lineage, and it takes a bit of effort
> to set up the required APIs.
>
> I think the way to solve this question is with unit tests.
>
> Can write a unit test that fails, or point to an existing test that almost
> does what you need? For example, is there a test to get the lineage of a
> view column?
>
> Julian
>
>
> > On Sep 5, 2022, at 2:52 AM, Jiajun Xie 
> wrote:
> >
> > Hi, all:
> > I want to know which virtual column is in use. For example,
> > ```
> > CREATE TABLE peoples(age int, virtual_age int as (age + 1) virtual);
> > SELECT virtual_age from peoples;
> > ```
> > After converting, the virtual column is expanded to expression.
> > ```
> > LogicalProject(virtual_age=[+($0, 1)])
> >  LogicalTableScan(table=[[default_ns, default, peoples]])
> > ```
> > So `RelMetadataQuery#getColumnOrigins` return RelColumnOrigin that is
> > age(not is virtual_age).
> >
> > I try to rewrite code in the implementation class of
> > `InitializerExpressionFactory`, but I can't know which column is in use.
> > When I confirm which column is in use, I can't know if the expression is
> > from a virtual column.
> >
> > Does anyone have relevant experience?  Thanks~
>
>


Re: How to get lineage for virtual column

2022-09-08 Thread Mark Grey
I had attempted this once before in the case of non-virtual columns, and
can only second what Julian mentioned regarding starting from the tests and
working backwards through the Validator APIs specifically in a debugger.

This does remind me though that I filed this addressing a bug I found while
doing that awhile back:  Maybe possible to get a review and merge? :)

https://github.com/apache/calcite/pull/2683
https://issues.apache.org/jira/browse/CALCITE-4972


On Thu, Sep 8, 2022 at 8:54 AM Jiajun Xie  wrote:

> My real goal is to know which virtual columns are used in query.
>
> - I tried to use `getColumnOrigins`, here is one test in RelMetadataTest
> ```
> @Test void testVirtualColumnOrigins() {
> final String sql = "select E from VIRTUALCOLUMNS.VC_T1 "
> + "for system_time as of TIMESTAMP '2011-01-02 00:00:00'";
> // Actual column name is A, but I need E.
> sql(sql).withCatalogReaderFactory(MockCatalogReaderExtended::create)
> .assertColumnOriginSingle("VC_T1", "E", false);
> // I know that A is reasonable value because E = A + 1. (The root column
> origin should be A.)
> }
> ```
>
> - Visit SqlNode is another solution, but there are some fields not be
> trimmed.
>
> I want to know if anyone has suggestions to get virtual column that query
> used.
>
> Thank you for your reply.
>
> On Thu, 8 Sept 2022 at 14:55, Julian Hyde  wrote:
>
> > You know, when people ask ‘Does Calcite support lineage?’, I’m never
> quite
> > sure. People mean different things by lineage, and it takes a bit of
> effort
> > to set up the required APIs.
> >
> > I think the way to solve this question is with unit tests.
> >
> > Can write a unit test that fails, or point to an existing test that
> almost
> > does what you need? For example, is there a test to get the lineage of a
> > view column?
> >
> > Julian
> >
> >
> > > On Sep 5, 2022, at 2:52 AM, Jiajun Xie 
> > wrote:
> > >
> > > Hi, all:
> > > I want to know which virtual column is in use. For example,
> > > ```
> > > CREATE TABLE peoples(age int, virtual_age int as (age + 1) virtual);
> > > SELECT virtual_age from peoples;
> > > ```
> > > After converting, the virtual column is expanded to expression.
> > > ```
> > > LogicalProject(virtual_age=[+($0, 1)])
> > >  LogicalTableScan(table=[[default_ns, default, peoples]])
> > > ```
> > > So `RelMetadataQuery#getColumnOrigins` return RelColumnOrigin that is
> > > age(not is virtual_age).
> > >
> > > I try to rewrite code in the implementation class of
> > > `InitializerExpressionFactory`, but I can't know which column is in
> use.
> > > When I confirm which column is in use, I can't know if the expression
> is
> > > from a virtual column.
> > >
> > > Does anyone have relevant experience?  Thanks~
> >
> >
>


[DISCUSS] Towards Calcite 1.32.0

2022-09-08 Thread Ruben Q L
Hello,

It has been more than one month since our last release. It is a good time
to keep momentum and try to move on with the next one.

On a separate thread, Julian Hyde volunteered to be Release Manager for
this one (thanks Julian!).

As usual, there are several unresolved tickets [1], let's try to sort them
out as soon as possible: merge the PRs if ready, or move the tickets to a
future version.

Best regards,
Ruben

[1]
https://issues.apache.org/jira/secure/Dashboard.jspa?selectPageId=12333950


Re: [DISCUSS] Towards Calcite 1.32.0

2022-09-08 Thread Julian Hyde
I would like to make a release candidate and start a vote this evening
(i.e. 11 hours from now). In three hours I shall close the main
branch.

If you are a committer and there is a PR that you would like to merge,
please either do it in the next three hours or reply to this email
asking for permission.

There is a PR with draft release notes [
https://github.com/apache/calcite/pull/2902 ]. Please review. I won't
merge the PR, but I will rebase it onto the release branch after
fixing any issues.

Julian

On Thu, Sep 8, 2022 at 10:07 AM Ruben Q L  wrote:
>
> Hello,
>
> It has been more than one month since our last release. It is a good time
> to keep momentum and try to move on with the next one.
>
> On a separate thread, Julian Hyde volunteered to be Release Manager for
> this one (thanks Julian!).
>
> As usual, there are several unresolved tickets [1], let's try to sort them
> out as soon as possible: merge the PRs if ready, or move the tickets to a
> future version.
>
> Best regards,
> Ruben
>
> [1]
> https://issues.apache.org/jira/secure/Dashboard.jspa?selectPageId=12333950


Re: [DISCUSS] Towards Calcite 1.32.0

2022-09-08 Thread Gavin Ray
This may not be the appropriate place to ask, but is there any chance of
merging the below for this release, or maybe next release?
It's been around a few years and I think it is one of the few blockers in
place for taking advantage of MULTISET functionality, much-appreciated if
you want to return nested hierarchical results.

- [CALCITE-4188] Support EnumerableBatchNestedLoopJoin inJdbcToEnumerab… by
angelzouxin · Pull Request #2116 · apache/calcite (github.com)


On Thu, Sep 8, 2022 at 2:53 PM Julian Hyde  wrote:

> I would like to make a release candidate and start a vote this evening
> (i.e. 11 hours from now). In three hours I shall close the main
> branch.
>
> If you are a committer and there is a PR that you would like to merge,
> please either do it in the next three hours or reply to this email
> asking for permission.
>
> There is a PR with draft release notes [
> https://github.com/apache/calcite/pull/2902 ]. Please review. I won't
> merge the PR, but I will rebase it onto the release branch after
> fixing any issues.
>
> Julian
>
> On Thu, Sep 8, 2022 at 10:07 AM Ruben Q L  wrote:
> >
> > Hello,
> >
> > It has been more than one month since our last release. It is a good time
> > to keep momentum and try to move on with the next one.
> >
> > On a separate thread, Julian Hyde volunteered to be Release Manager for
> > this one (thanks Julian!).
> >
> > As usual, there are several unresolved tickets [1], let's try to sort
> them
> > out as soon as possible: merge the PRs if ready, or move the tickets to a
> > future version.
> >
> > Best regards,
> > Ruben
> >
> > [1]
> >
> https://issues.apache.org/jira/secure/Dashboard.jspa?selectPageId=12333950
>


Re: [DISCUSS] Towards Calcite 1.32.0

2022-09-08 Thread Ruben Q L
Thanks for the comment, Gavin.
It seems there are still some open points in that PR, so it looks like a
bit rushed for this one, let's aim for the next release (1.33).
We try to keep a rhythm of one release every two months approximately, so
in around two months we shall have a new opportunity to release this
feature.

Ruben


On Thu, Sep 8, 2022 at 8:09 PM Gavin Ray  wrote:

> This may not be the appropriate place to ask, but is there any chance of
> merging the below for this release, or maybe next release?
> It's been around a few years and I think it is one of the few blockers in
> place for taking advantage of MULTISET functionality, much-appreciated if
> you want to return nested hierarchical results.
>
> - [CALCITE-4188] Support EnumerableBatchNestedLoopJoin inJdbcToEnumerab… by
> angelzouxin · Pull Request #2116 · apache/calcite (github.com)
> 
>
> On Thu, Sep 8, 2022 at 2:53 PM Julian Hyde  wrote:
>
> > I would like to make a release candidate and start a vote this evening
> > (i.e. 11 hours from now). In three hours I shall close the main
> > branch.
> >
> > If you are a committer and there is a PR that you would like to merge,
> > please either do it in the next three hours or reply to this email
> > asking for permission.
> >
> > There is a PR with draft release notes [
> > https://github.com/apache/calcite/pull/2902 ]. Please review. I won't
> > merge the PR, but I will rebase it onto the release branch after
> > fixing any issues.
> >
> > Julian
> >
> > On Thu, Sep 8, 2022 at 10:07 AM Ruben Q L  wrote:
> > >
> > > Hello,
> > >
> > > It has been more than one month since our last release. It is a good
> time
> > > to keep momentum and try to move on with the next one.
> > >
> > > On a separate thread, Julian Hyde volunteered to be Release Manager for
> > > this one (thanks Julian!).
> > >
> > > As usual, there are several unresolved tickets [1], let's try to sort
> > them
> > > out as soon as possible: merge the PRs if ready, or move the tickets
> to a
> > > future version.
> > >
> > > Best regards,
> > > Ruben
> > >
> > > [1]
> > >
> >
> https://issues.apache.org/jira/secure/Dashboard.jspa?selectPageId=12333950
> >
>


Re: [DISCUSS] Towards Calcite 1.32.0

2022-09-08 Thread Aymeric Dispa
Hi,

I've opened this PR a few weeks ago and I think it can be released (
https://github.com/apache/calcite/pull/2860 - just waiting for one
approval).
Would it be possible to include it as part of 1.32.0 ?

Thanks,
Aymeric

On Thu, Sep 8, 2022 at 9:08 PM Ruben Q L  wrote:

> Thanks for the comment, Gavin.
> It seems there are still some open points in that PR, so it looks like a
> bit rushed for this one, let's aim for the next release (1.33).
> We try to keep a rhythm of one release every two months approximately, so
> in around two months we shall have a new opportunity to release this
> feature.
>
> Ruben
>
>
> On Thu, Sep 8, 2022 at 8:09 PM Gavin Ray  wrote:
>
> > This may not be the appropriate place to ask, but is there any chance of
> > merging the below for this release, or maybe next release?
> > It's been around a few years and I think it is one of the few blockers in
> > place for taking advantage of MULTISET functionality, much-appreciated if
> > you want to return nested hierarchical results.
> >
> > - [CALCITE-4188] Support EnumerableBatchNestedLoopJoin inJdbcToEnumerab…
> by
> > angelzouxin · Pull Request #2116 · apache/calcite (github.com)
> > 
> >
> > On Thu, Sep 8, 2022 at 2:53 PM Julian Hyde  wrote:
> >
> > > I would like to make a release candidate and start a vote this evening
> > > (i.e. 11 hours from now). In three hours I shall close the main
> > > branch.
> > >
> > > If you are a committer and there is a PR that you would like to merge,
> > > please either do it in the next three hours or reply to this email
> > > asking for permission.
> > >
> > > There is a PR with draft release notes [
> > > https://github.com/apache/calcite/pull/2902 ]. Please review. I won't
> > > merge the PR, but I will rebase it onto the release branch after
> > > fixing any issues.
> > >
> > > Julian
> > >
> > > On Thu, Sep 8, 2022 at 10:07 AM Ruben Q L  wrote:
> > > >
> > > > Hello,
> > > >
> > > > It has been more than one month since our last release. It is a good
> > time
> > > > to keep momentum and try to move on with the next one.
> > > >
> > > > On a separate thread, Julian Hyde volunteered to be Release Manager
> for
> > > > this one (thanks Julian!).
> > > >
> > > > As usual, there are several unresolved tickets [1], let's try to sort
> > > them
> > > > out as soon as possible: merge the PRs if ready, or move the tickets
> > to a
> > > > future version.
> > > >
> > > > Best regards,
> > > > Ruben
> > > >
> > > > [1]
> > > >
> > >
> >
> https://issues.apache.org/jira/secure/Dashboard.jspa?selectPageId=12333950
> > >
> >
>


Re: [DISCUSS] Towards Calcite 1.32.0

2022-09-08 Thread Mark Grey
Hi,

Apologies for including this in another feature topic thread, but might
also be a good candidate.  Like Aymeric's above also just needs +1
post-rebase.

https://github.com/apache/calcite/pull/2683

Best,

Mark

On Thu, Sep 8, 2022 at 4:12 PM Aymeric Dispa 
wrote:

> Hi,
>
> I've opened this PR a few weeks ago and I think it can be released (
> https://github.com/apache/calcite/pull/2860 - just waiting for one
> approval).
> Would it be possible to include it as part of 1.32.0 ?
>
> Thanks,
> Aymeric
>
> On Thu, Sep 8, 2022 at 9:08 PM Ruben Q L  wrote:
>
> > Thanks for the comment, Gavin.
> > It seems there are still some open points in that PR, so it looks like a
> > bit rushed for this one, let's aim for the next release (1.33).
> > We try to keep a rhythm of one release every two months approximately, so
> > in around two months we shall have a new opportunity to release this
> > feature.
> >
> > Ruben
> >
> >
> > On Thu, Sep 8, 2022 at 8:09 PM Gavin Ray  wrote:
> >
> > > This may not be the appropriate place to ask, but is there any chance
> of
> > > merging the below for this release, or maybe next release?
> > > It's been around a few years and I think it is one of the few blockers
> in
> > > place for taking advantage of MULTISET functionality, much-appreciated
> if
> > > you want to return nested hierarchical results.
> > >
> > > - [CALCITE-4188] Support EnumerableBatchNestedLoopJoin
> inJdbcToEnumerab…
> > by
> > > angelzouxin · Pull Request #2116 · apache/calcite (github.com)
> > > 
> > >
> > > On Thu, Sep 8, 2022 at 2:53 PM Julian Hyde  wrote:
> > >
> > > > I would like to make a release candidate and start a vote this
> evening
> > > > (i.e. 11 hours from now). In three hours I shall close the main
> > > > branch.
> > > >
> > > > If you are a committer and there is a PR that you would like to
> merge,
> > > > please either do it in the next three hours or reply to this email
> > > > asking for permission.
> > > >
> > > > There is a PR with draft release notes [
> > > > https://github.com/apache/calcite/pull/2902 ]. Please review. I
> won't
> > > > merge the PR, but I will rebase it onto the release branch after
> > > > fixing any issues.
> > > >
> > > > Julian
> > > >
> > > > On Thu, Sep 8, 2022 at 10:07 AM Ruben Q L  wrote:
> > > > >
> > > > > Hello,
> > > > >
> > > > > It has been more than one month since our last release. It is a
> good
> > > time
> > > > > to keep momentum and try to move on with the next one.
> > > > >
> > > > > On a separate thread, Julian Hyde volunteered to be Release Manager
> > for
> > > > > this one (thanks Julian!).
> > > > >
> > > > > As usual, there are several unresolved tickets [1], let's try to
> sort
> > > > them
> > > > > out as soon as possible: merge the PRs if ready, or move the
> tickets
> > > to a
> > > > > future version.
> > > > >
> > > > > Best regards,
> > > > > Ruben
> > > > >
> > > > > [1]
> > > > >
> > > >
> > >
> >
> https://issues.apache.org/jira/secure/Dashboard.jspa?selectPageId=12333950
> > > >
> > >
> >
>


[jira] [Created] (CALCITE-5278) Upgrade Janino from 3.1.6 to 3.1.8

2022-09-08 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-5278:


 Summary: Upgrade Janino from 3.1.6 to 3.1.8
 Key: CALCITE-5278
 URL: https://issues.apache.org/jira/browse/CALCITE-5278
 Project: Calcite
  Issue Type: Bug
Reporter: Julian Hyde
 Fix For: 1.32.0


Upgrade Janino from 3.1.6 to 3.1.8. This may or may not solve the issue noted 
in CALCITE-5227, but the upgrade is unlikely to make things worse and may make 
things better.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [DISCUSS] Towards Calcite 1.32.0

2022-09-08 Thread Julian Hyde
Main branch is now closed to commits. There will be an RC0 shortly. It will 
remain closed until we have a successful RC for release 1.32.

Julian
(Release manager, Calcite 1.32.)

On 2022/09/08 20:31:11 Mark Grey wrote:
> Hi,
> 
> Apologies for including this in another feature topic thread, but might
> also be a good candidate.  Like Aymeric's above also just needs +1
> post-rebase.
> 
> https://github.com/apache/calcite/pull/2683
> 
> Best,
> 
> Mark
> 
> On Thu, Sep 8, 2022 at 4:12 PM Aymeric Dispa 
> wrote:
> 
> > Hi,
> >
> > I've opened this PR a few weeks ago and I think it can be released (
> > https://github.com/apache/calcite/pull/2860 - just waiting for one
> > approval).
> > Would it be possible to include it as part of 1.32.0 ?
> >
> > Thanks,
> > Aymeric
> >
> > On Thu, Sep 8, 2022 at 9:08 PM Ruben Q L  wrote:
> >
> > > Thanks for the comment, Gavin.
> > > It seems there are still some open points in that PR, so it looks like a
> > > bit rushed for this one, let's aim for the next release (1.33).
> > > We try to keep a rhythm of one release every two months approximately, so
> > > in around two months we shall have a new opportunity to release this
> > > feature.
> > >
> > > Ruben
> > >
> > >
> > > On Thu, Sep 8, 2022 at 8:09 PM Gavin Ray  wrote:
> > >
> > > > This may not be the appropriate place to ask, but is there any chance
> > of
> > > > merging the below for this release, or maybe next release?
> > > > It's been around a few years and I think it is one of the few blockers
> > in
> > > > place for taking advantage of MULTISET functionality, much-appreciated
> > if
> > > > you want to return nested hierarchical results.
> > > >
> > > > - [CALCITE-4188] Support EnumerableBatchNestedLoopJoin
> > inJdbcToEnumerab…
> > > by
> > > > angelzouxin · Pull Request #2116 · apache/calcite (github.com)
> > > > 
> > > >
> > > > On Thu, Sep 8, 2022 at 2:53 PM Julian Hyde  wrote:
> > > >
> > > > > I would like to make a release candidate and start a vote this
> > evening
> > > > > (i.e. 11 hours from now). In three hours I shall close the main
> > > > > branch.
> > > > >
> > > > > If you are a committer and there is a PR that you would like to
> > merge,
> > > > > please either do it in the next three hours or reply to this email
> > > > > asking for permission.
> > > > >
> > > > > There is a PR with draft release notes [
> > > > > https://github.com/apache/calcite/pull/2902 ]. Please review. I
> > won't
> > > > > merge the PR, but I will rebase it onto the release branch after
> > > > > fixing any issues.
> > > > >
> > > > > Julian
> > > > >
> > > > > On Thu, Sep 8, 2022 at 10:07 AM Ruben Q L  wrote:
> > > > > >
> > > > > > Hello,
> > > > > >
> > > > > > It has been more than one month since our last release. It is a
> > good
> > > > time
> > > > > > to keep momentum and try to move on with the next one.
> > > > > >
> > > > > > On a separate thread, Julian Hyde volunteered to be Release Manager
> > > for
> > > > > > this one (thanks Julian!).
> > > > > >
> > > > > > As usual, there are several unresolved tickets [1], let's try to
> > sort
> > > > > them
> > > > > > out as soon as possible: merge the PRs if ready, or move the
> > tickets
> > > > to a
> > > > > > future version.
> > > > > >
> > > > > > Best regards,
> > > > > > Ruben
> > > > > >
> > > > > > [1]
> > > > > >
> > > > >
> > > >
> > >
> > https://issues.apache.org/jira/secure/Dashboard.jspa?selectPageId=12333950
> > > > >
> > > >
> > >
> >
>