[jira] [Created] (CALCITE-5216) Cannot parse parenthesized nested with clause

2022-07-19 Thread Wenrui Meng (Jira)
Wenrui Meng created CALCITE-5216:


 Summary: Cannot parse parenthesized nested with clause
 Key: CALCITE-5216
 URL: https://issues.apache.org/jira/browse/CALCITE-5216
 Project: Calcite
  Issue Type: Bug
  Components: core
Affects Versions: 1.30.0
Reporter: Wenrui Meng
Assignee: Julian Hyde


 CALCITE-35  introduced issues to parse the parenthesized sub-query such as 
union and nested with. It's considered as a regression. 

CALCITE-5194  resolved the parenthesized union issue while the nested with 
still failed on parsing. 

 

Here is a sample nested with SQL statement that fails the parsing

 
{code:java}
with a as (with b as (select 1)(select 1)) select * from a   {code}
 

Here is the stack trace summary
{code:java}
    at 
org.apache.calcite.sql.parser.SqlParserTest$TesterImpl.parseStmtAndHandleEx(SqlParserTest.java:10184)
    at 
org.apache.calcite.sql.parser.SqlParserTest$TesterImpl.check(SqlParserTest.java:10169)
    at 
org.apache.calcite.sql.parser.SqlParserFixture.ok(SqlParserFixture.java:83)
    at 
org.apache.calcite.sql.parser.SqlParserTest.testNestedWith(SqlParserTest.java:7941)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
    at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
    at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at 
org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
    at 
org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
 ..
Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered "(" at 
line 1, column 32.  {code}



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


Re: [DISCUSS] Towards Calcite 1.31.0

2022-07-19 Thread Andrei Sereda
Hello,

Anything specific you'd like to be added to the release notes of 1.31 ?
If so, please provide a short summary as well as JIRA id.


Andrei.

On Tue, Jul 12, 2022 at 10:07 PM Andrei Sereda  wrote:

> Hi Julian,
>
>
> > Andrei, Are there any remaining blockers for 1.31?
> No blockers for 1.31. Any pending issues can be moved towards 1.32.
>
> > Can we proceed with an RC0?
>
> Yes, I'll start the release very soon.
>
> Thanks for fixing the regression.
>
> Andrei.
>
>
> On Tue, Jul 12, 2022 at 4:35 PM Julian Hyde 
> wrote:
>
>> I merged https://issues.apache.org/jira/browse/CALCITE-5194 <
>> https://issues.apache.org/jira/browse/CALCITE-5194>, the fix for the
>> regression due to https://issues.apache.org/jira/browse/CALCITE-35 <
>> https://issues.apache.org/jira/browse/CALCITE-35>, yesterday.
>>
>> Andrei, Are there any remaining blockers for 1.31? Can we proceed with an
>> RC0?
>>
>> Julian
>>
>>
>> > On Jun 21, 2022, at 11:29 PM, Yanjing Wang 
>> wrote:
>> >
>> > Thanks Andrei, now there is nobody to review these PRs, It's ok to
>> change
>> > to 1.32,I think pr-2838 
>> for
>> > CALCITE-5045 
>> should be
>> > merged before 1.31, because it's simple and Yingyu Wang  encountered
>> this
>> > problem also.
>> >
>> > Andrei Sereda  于2022年6月22日周三 10:06写道:
>> >
>> >> Julian, how much time do you think is necessary to fix CALCITE-35
>> >> regression ?
>> >>
>> >> Yanjing, I see some discussions/attempts in JIRA/github to review the
>> PRs.
>> >> Do you think it can still be reviewed and merged before 1.31 ?
>> >>
>> >> Viliam (and Julian), thanks for fixing (and merging) CALCITE-5157
>> >>
>> >> Dmitry (and Stamatis / Ruben), thanks for fixing (and merging)
>> >> CALCITE-5134.
>> >> As I understand CALCITE-5127 is delayed until 1.32 ?
>> >>
>> >>
>> >>
>> >> On Tue, Jun 21, 2022 at 2:57 AM Julian Hyde 
>> >> wrote:
>> >>
>> >>> I agree that it’s a regression, and caused by my CALCITE-35 change.
>> I’ve
>> >>> assigned the bug to myself. I’m not sure I have time to fix it this
>> week,
>> >>> so we can back out my change if necessary to get the release out on
>> >>> schedule. If someone else can fix it I would be grateful.
>> >>>
>> >>>
>>  On Jun 19, 2022, at 2:26 AM, Vova Vysotskyi 
>> >>> wrote:
>> 
>>  Hello,
>> 
>>  I have found the following regression while verifying the new release
>> >> to
>> >>> work with Apache Drill:
>> >> https://issues.apache.org/jira/browse/CALCITE-5194
>> >>> .
>>  This issue appeared after changes for
>> >>> https://issues.apache.org/jira/browse/CALCITE-35.
>>  Since it is a regression, I suggest treating it as a blocker for the
>> >>> upcoming release.
>> 
>>  Kind regards,
>>  Volodymyr Vysotskyi
>> 
>>  On 2022/06/16 06:38:45 Viliam Durina wrote:
>> > I'll try to work on comments in CALCITE-5157
>> >  today
>> >
>> > On Wed, 15 Jun 2022 at 07:30, Yanjing Wang <
>> zhuangzixiao...@gmail.com
>> >>>
>> > wrote:
>> >
>> >> Hi Andrei,
>> >> The followings need review process to merge.
>> >> https://issues.apache.org/jira/browse/CALCITE-4512
>> >> https://issues.apache.org/jira/browse/CALCITE-5045
>> >> https://issues.apache.org/jira/browse/CALCITE-5043
>> >> https://issues.apache.org/jira/browse/CALCITE-4987
>> >> It would be great if they were fixed in this release.
>> >>
>> >> Dmitry Sysolyatin  于2022年6月14日周二 17:18写道:
>> >>
>> >>> Hi!
>> >>> It would be good to merge:
>> >>> https://issues.apache.org/jira/browse/CALCITE-5134
>> >>> https://issues.apache.org/jira/browse/CALCITE-5127
>> >>>
>> >>> Both of those issues are related to correct execution queries with
>> >>> subqueries.
>> >>>
>> >>> On Tue, Jun 14, 2022 at 6:59 AM Andrei Sereda 
>> >>> wrote:
>> >>>
>>  Thanks to all who reviewed the PRs for 1.31 release.
>> 
>>  There are about 16 issues remaining tagged for 1.31 (list
>>  <
>> 
>> >>>
>> >>
>> >>>
>> >>
>> https://issues.apache.org/jira/issues/?jql=project%20%3D%20CALCITE%20AND%20fixVersion%20%3D%201.31.0%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20%22In%20Review%22%2C%20%22In%20Implementation%22)%20ORDER%20BY%20priority%20DESC
>> >
>>  ).
>> 
>>  Please let me know which ones are important for this release (and
>> >>> I'll
>>  wait) otherwise I'll re-tag those issues for next release 1.32.
>> 
>>  Regards,
>>  Andrei.
>> 
>> 
>> 
>>  On Mon, Jun 13, 2022 at 1:05 PM Julian Hyde <
>> >> jhyde.apa...@gmail.com>
>>  wrote:
>> 
>> > I’m on vacation this week so don’t ask me to review PRs.
>> >
>> > It looks like we’re on course for an RC this week, and
>> definitely
>> 

Calcite Release 1.31 started

2022-07-19 Thread Andrei Sereda
Hello,

I'm starting the Calcite 1.31 release. Main branch will be frozen until
completion.

Please avoid committing anything to main until further notice.

Andrei.


calcite+graal native-image

2022-07-19 Thread Egor Ryashin
Hi all,

I’ve been trying to build a native executable with GraalVM and got stuck with 
this exception when running the executable:

java.lang.RuntimeException: java.lang.ClassNotFoundException: 
org.apache.calcite.rel.metadata.janino.GeneratedMetadata_CollationHandler
at 
org.apache.calcite.rel.metadata.JaninoRelMetadataProvider.compile(JaninoRelMetadataProvider.java:180)
at 
org.apache.calcite.rel.metadata.JaninoRelMetadataProvider.generateCompileAndInstantiate(JaninoRelMetadataProvider.java:138)
at 
org.apache.calcite.rel.metadata.JaninoRelMetadataProvider.lambda$static$0(JaninoRelMetadataProvider.java:72)
at 
com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:165)
at 
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)
at 
com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)
at 
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
at com.google.common.cache.LocalCache.get(LocalCache.java:3951)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
at 
com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958)
at 
org.apache.calcite.rel.metadata.JaninoRelMetadataProvider.revise(JaninoRelMetadataProvider.java:189)

I found a ticket that probably relates to the issue 
https://issues.apache.org/jira/browse/CALCITE-4539 
 
I also found that substrait.io  (substrait-java) already 
compiles Calcite dependency to a native executable. Right now, I’m confused, is 
it possible to compile Calcite to a working native executable or not? It would 
be great if somebody could give some insight on how to do that. I tried to 
apply the substrait-java configs and used the GraalVM trace agent generated 
configs too but I still get the above exception nonetheless.

Thanks



Re: A guide to connecting to Calcite with SQuirreL, a SQL GUI client

2022-07-19 Thread Stamatis Zampetakis
Hi Gavin,

Thanks for doing this, very useful!

How about adding an entry about this in the external resources section [1]?
If you feel like it, create a PR and ping me to merge it.

Regarding GUI tools for accessing JDBC endpoints I find the database window
of IntelliJ [2] very convenient as well.

Best,
Stamatis

[1]
https://github.com/apache/calcite/blob/9bdd26159110663c4a207e3e8c378d1c3d16e034/site/community/index.md?plain=1#L200
[2]
https://www.jetbrains.com/help/idea/2021.2/database-tool-window.html#overview

On Tue, Jul 19, 2022 at 12:23 AM Gavin Ray  wrote:

> Hey all,
>
> I took time to write a guide on how to configure SQuirreL SQL so that it
> can connect to Calcite sources
> It's a useful alternative to sqlline if you like GUI tools.
>
> I hope someone else finds it helpful:
> Making Apache Calcite work in SQuirreL SQL Client (github.com)
> 
>