[jira] [Created] (CALCITE-5078) ORDER BY gets confused by upper/lower case

2022-03-31 Thread Magnus Mogren (Jira)
Magnus Mogren created CALCITE-5078:
--

 Summary: ORDER BY gets confused by upper/lower case
 Key: CALCITE-5078
 URL: https://issues.apache.org/jira/browse/CALCITE-5078
 Project: Calcite
  Issue Type: Bug
Affects Versions: 1.30.0
Reporter: Magnus Mogren


This SQL returnes the values in the wrong order:

{{SELECT * FROM (VALUES ('a'), ('B')) AS tbl(col1) order by col1 asc}}

"B" is returned before "a".



 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


Jenkins build is back to normal : Calcite » Calcite-snapshots #106

2022-03-31 Thread Apache Jenkins Server
See 




[jira] [Created] (CALCITE-5077) ResetSession implements driver.SessionResetter.

2022-03-31 Thread liguozhong (Jira)
liguozhong created CALCITE-5077:
---

 Summary: ResetSession implements driver.SessionResetter.
 Key: CALCITE-5077
 URL: https://issues.apache.org/jira/browse/CALCITE-5077
 Project: Calcite
  Issue Type: Improvement
Reporter: liguozhong


avatica sql query fails after running for a period of time on our online loki, 
this PR attempts to solve this "NoSuchConnectionException" problem.
 
level=error ts=2022-03-31T12:51:09.356233496Z caller=table_manager.go:233 
msg="error syncing tables" err="An error was encountered while processing your 
request: NoSuchConnectionException\{connectionId='Connection not found: invalid 
id, closed, or expired: ccd95a16-5496-7001-f99b-1ab0e5f19e05'}"



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


Re: [DISCUSS] Github PR link to JIRA issue

2022-03-31 Thread Julian Hyde
Ah, I see. In the page for a commit (e.g. [1]) the text “[CALCITE-5064]” 
appears as a blue hyperlink whereas the page for the corresponding pull request 
(e.g. [2]) the “[CALCITE-5064]” text is not a hyperlink.

Is that what you meant, Haisheng?

Julian


[1] 
https://github.com/apache/calcite/commit/d85b2a602a547290bd5be0bba68092b702400731
 


[2] https://github.com/apache/calcite/pull/2752 
 

> On Mar 31, 2022, at 11:05 AM, Michael Mior  wrote:
> 
> Stamatis,
> 
> Unless I'm misunderstanding, Haisheng was referring to links in the
> opposite direction. That is, linking to JIRA issues from GitHub. The
> setting you reference is for creating a link from JIRA to GitHub.
> 
> --
> Michael Mior
> mm...@apache.org
> 
> 
> Le jeu. 31 mars 2022 à 13:53, Stamatis Zampetakis  a
> écrit :
> 
>> It's already done via .asf.yaml [1].
>> 
>> Best,
>> Stamatis
>> 
>> [1]
>> 
>> https://github.com/apache/calcite/blob/88cc385f98c551c1aca7ffab101934f1c34fdffd/.asf.yaml#L35
>> 
>> On Thu, Mar 31, 2022 at 7:19 PM Michael Mior  wrote:
>> 
>>> Not sure what might have changed, but here's the GitHub documentation on
>>> the feature. If this isn't working as expected, I would contact INFRA to
>>> make sure things are correctly configured. (Apparently in the future,
>> this
>>> may be done via .asf.yaml)
>>> 
>>> 
>>> 
>> https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/configuring-autolinks-to-reference-external-resources
>>> 
>>> 
>>> --
>>> Michael Mior
>>> mm...@apache.org
>>> 
>>> 
>>> Le mer. 30 mars 2022 à 13:46, Haisheng Yuan  a écrit :
>>> 
 Hi all,
 
 Previously, the JIRA issue e.g. [CALCITE-6789] in Calcite github PR and
 commit message will be automatically linked to the JIRA site. Now there
>>> is
 no link anymore.
 
 Does anyone know what happened? What can we do to add the link back?
 
 Thanks,
 Haisheng Yuan
 
>>> 
>> 



Build failed in Jenkins: Calcite » Calcite-snapshots #105

2022-03-31 Thread Apache Jenkins Server
See 


Changes:

[Ruben Q L] [CALCITE-5075] Build fails due to rat check on Gemfile.lock


--
[...truncated 328.21 KB...]
 14.4sec,   15 completed,   0 failed,   0 skipped, Gradle Test Run 
:testkit:test

> Task :plus:test
 31.0sec, org.apache.calcite.adapter.tpch.TpchTest 
> testQuery02Conversion()

> Task :druid:publishDruidPublicationToNexusRepository

> Task :mongodb:test
 15.2sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testFilterSortDesc()
 14.9sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testCountViaInt()
 15.4sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testDate()
 15.4sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testZips()
 15.6sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testFilterRedundant()
 15.4sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testInPlan()
 15.7sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testGroupByHaving()
 15.9sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testSort()
 15.6sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testFilter()
 16.1sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testLimit()
 15.9sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testGroupByOneColumnNotProjected()
 15.7sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testOffsetLimit()
 15.7sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testSortLimit()
 15.7sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testCountGroupByEmptyMultiplyBy2()
 16.2sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testFilterReversed()
 16.4sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testGroupByOneColumnReversed()
 16.4sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testSelectWhere()
 16.3sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testGroupByAvg()
 16.6sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testCountGroupByEmpty()
 16.2sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testGroupByAvgSumCount()
 16.2sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testGroupByMinMaxSum()
 16.2sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testDistinctCountOrderBy()
 16.3sec, 
org.apache.calcite.adapter.mongodb.MongoAdapterTest > 
testGroupComposite()

> Task :spark:test
 36.7sec, org.apache.calcite.test.SparkAdapterTest 
> testGroupBy()
 36.6sec, org.apache.calcite.test.SparkAdapterTest 
> testAggFuncNoGroupBy()
WARNING  37.1sec,   38 completed,   0 failed,   4 
skipped, org.apache.calcite.test.SparkAdapterTest
WARNING  41.4sec,   38 completed,   0 failed,   4 
skipped, Gradle Test Run :spark:test

> Task :piglet:test
 27.6sec, org.apache.calcite.test.PigRelOpTest > 
testLoadWithoutSchema()
 27.9sec, org.apache.calcite.test.PigRelOpTest > 
testLoadWithSchema()
  6.8sec, org.apache.calcite.test.PigRelOpTest > 
testSimpleForEach1()
 28.5sec, org.apache.calcite.test.PigRelOpTest > 
testFlattenStrSplit()
  2.3sec, org.apache.calcite.test.PigletTest > 
testGroupExample()
WARNING  30.0sec,   19 completed,   0 failed,   1 
skipped, org.apache.calcite.test.PigletTest
  3.7sec, org.apache.calcite.test.PigRelExTest > 
testProjection()
 30.2sec, org.apache.calcite.test.PigScriptTest > 
testReadScript()
 30.5sec,1 completed,   0 failed,   0 skipped, 
org.apache.calcite.test.PigScriptTest
 30.3sec, 

Re: [DISCUSS] Github PR link to JIRA issue

2022-03-31 Thread Michael Mior
Stamatis,

Unless I'm misunderstanding, Haisheng was referring to links in the
opposite direction. That is, linking to JIRA issues from GitHub. The
setting you reference is for creating a link from JIRA to GitHub.

--
Michael Mior
mm...@apache.org


Le jeu. 31 mars 2022 à 13:53, Stamatis Zampetakis  a
écrit :

> It's already done via .asf.yaml [1].
>
> Best,
> Stamatis
>
> [1]
>
> https://github.com/apache/calcite/blob/88cc385f98c551c1aca7ffab101934f1c34fdffd/.asf.yaml#L35
>
> On Thu, Mar 31, 2022 at 7:19 PM Michael Mior  wrote:
>
> > Not sure what might have changed, but here's the GitHub documentation on
> > the feature. If this isn't working as expected, I would contact INFRA to
> > make sure things are correctly configured. (Apparently in the future,
> this
> > may be done via .asf.yaml)
> >
> >
> >
> https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/configuring-autolinks-to-reference-external-resources
> >
> >
> > --
> > Michael Mior
> > mm...@apache.org
> >
> >
> > Le mer. 30 mars 2022 à 13:46, Haisheng Yuan  a écrit :
> >
> > > Hi all,
> > >
> > > Previously, the JIRA issue e.g. [CALCITE-6789] in Calcite github PR and
> > > commit message will be automatically linked to the JIRA site. Now there
> > is
> > > no link anymore.
> > >
> > > Does anyone know what happened? What can we do to add the link back?
> > >
> > > Thanks,
> > > Haisheng Yuan
> > >
> >
>


Re: [DISCUSS] Github PR link to JIRA issue

2022-03-31 Thread Stamatis Zampetakis
It's already done via .asf.yaml [1].

Best,
Stamatis

[1]
https://github.com/apache/calcite/blob/88cc385f98c551c1aca7ffab101934f1c34fdffd/.asf.yaml#L35

On Thu, Mar 31, 2022 at 7:19 PM Michael Mior  wrote:

> Not sure what might have changed, but here's the GitHub documentation on
> the feature. If this isn't working as expected, I would contact INFRA to
> make sure things are correctly configured. (Apparently in the future, this
> may be done via .asf.yaml)
>
>
> https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/configuring-autolinks-to-reference-external-resources
>
>
> --
> Michael Mior
> mm...@apache.org
>
>
> Le mer. 30 mars 2022 à 13:46, Haisheng Yuan  a écrit :
>
> > Hi all,
> >
> > Previously, the JIRA issue e.g. [CALCITE-6789] in Calcite github PR and
> > commit message will be automatically linked to the JIRA site. Now there
> is
> > no link anymore.
> >
> > Does anyone know what happened? What can we do to add the link back?
> >
> > Thanks,
> > Haisheng Yuan
> >
>


Re: [DISCUSS] Github PR link to JIRA issue

2022-03-31 Thread Michael Mior
Not sure what might have changed, but here's the GitHub documentation on
the feature. If this isn't working as expected, I would contact INFRA to
make sure things are correctly configured. (Apparently in the future, this
may be done via .asf.yaml)

https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/configuring-autolinks-to-reference-external-resources


--
Michael Mior
mm...@apache.org


Le mer. 30 mars 2022 à 13:46, Haisheng Yuan  a écrit :

> Hi all,
>
> Previously, the JIRA issue e.g. [CALCITE-6789] in Calcite github PR and
> commit message will be automatically linked to the JIRA site. Now there is
> no link anymore.
>
> Does anyone know what happened? What can we do to add the link back?
>
> Thanks,
> Haisheng Yuan
>


[jira] [Created] (CALCITE-5076) parserConfig is not set correct when use some methods in CalcitePrepareImpl

2022-03-31 Thread zhangyang (Jira)
zhangyang created CALCITE-5076:
--

 Summary: parserConfig is not set correct when use  some methods  
in CalcitePrepareImpl
 Key: CALCITE-5076
 URL: https://issues.apache.org/jira/browse/CALCITE-5076
 Project: Calcite
  Issue Type: Bug
Reporter: zhangyang
 Attachments: image-2022-03-31-23-44-44-916.png, 
image-2022-03-31-23-45-01-468.png, image-2022-03-31-23-45-33-979.png

when i use org.apache.calcite.prepare.CalcitePrepareImpl#parse_ and 
org.apache.calcite.prepare.CalcitePrepareImpl.CalcitePreparingStmt#expandView, 
i noticed that in the two methods, the SqlParser uses the default 
SqlParser.Config, not created from the context.

!image-2022-03-31-23-45-01-468.png!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Created] (CALCITE-5075) Build fails due to rat check on Gemfile.lock

2022-03-31 Thread Ruben Q L (Jira)
Ruben Q L created CALCITE-5075:
--

 Summary: Build fails due to rat check on Gemfile.lock
 Key: CALCITE-5075
 URL: https://issues.apache.org/jira/browse/CALCITE-5075
 Project: Calcite
  Issue Type: Bug
Reporter: Ruben Q L
 Fix For: 1.31.0


After CALCITE-5070, build fails with message:
{noformat}
> Task :rat
Files with unapproved licenses:
 - /home/travis/build/apache/calcite/site/Gemfile.lock

> Task :rat FAILED
{noformat}

This file needs to be added to {{.ratignore}}.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


Build failed in Jenkins: Calcite » Calcite-snapshots #104

2022-03-31 Thread Apache Jenkins Server
See 


Changes:


--
[...truncated 54.08 KB...]
File "SimpleCharStream.java" does not exist.  Will create one.
Parser generated with 0 errors and 1 warnings.

> Task :server:javaCCMain
File "TokenMgrError.java" does not exist.  Will create one.
File "ParseException.java" does not exist.  Will create one.
File "Token.java" does not exist.  Will create one.
File "SimpleCharStream.java" does not exist.  Will create one.
Parser generated with 0 errors and 1 warnings.

> Task :server:processResources NO-SOURCE
> Task :server:autostyleConfigsCheck
> Task :core:versionClass
> Task :core:processResources
> Task :server:autostyleJavaCheck
> Task :server:autostyleKotlinGradleCheck
> Task :server:autostyleCheck

> Task :release:distTar
Source distribution is created: 


> Task :release:distTarSha512
> Task :release:assemble
> Task :release:autostyleConfigsCheck NO-SOURCE
> Task :release:autostyleKotlinGradleCheck
> Task :release:autostyleCheck
> Task :release:check
> Task :release:build
> Task :publish UP-TO-DATE
> Task :validateNexusCredentials UP-TO-DATE
> Task :core:fmppTest

> Task :core:javaCCTest
Java Compiler Compiler Version 4.0 (Parser Generator)
(type "javacc" with no arguments for help)
Reading from file 

 . . .
Warning: Output directory 
"
 does not exist. Creating the directory.
Note: UNICODE_INPUT option is specified. Please make sure you create the 
parser/lexer using a Reader with the correct character encoding.

> Task :file:checkstyleMain
> Task :kafka:checkstyleMain
> Task :pig:checkstyleMain
> Task :innodb:checkstyleMain
> Task :mongodb:checkstyleMain
> Task :cassandra:checkstyleMain
> Task :redis:checkstyleMain
> Task :splunk:checkstyleMain
> Task :server:checkstyleMain
> Task :example:function:checkstyleMain
> Task :example:csv:checkstyleMain
> Task :babel:checkstyleMain
> Task :ubenchmark:checkstyleJmh
> Task :plus:checkstyleMain
> Task :geode:checkstyleMain
> Task :spark:checkstyleMain
> Task :ubenchmark:checkstyleMain NO-SOURCE
> Task :ubenchmark:checkstyleTest NO-SOURCE
> Task :ubenchmark:compileTestJava NO-SOURCE
> Task :ubenchmark:processTestResources NO-SOURCE
> Task :ubenchmark:testClasses UP-TO-DATE
> Task :ubenchmark:processJmhResources NO-SOURCE

> Task :rat
Files with unapproved licenses:
 - 



> Task :ubenchmark:forbiddenApisMain NO-SOURCE
> Task :ubenchmark:forbiddenApisTest NO-SOURCE
> Task :ubenchmark:jandexTest NO-SOURCE
> Task :ubenchmark:test NO-SOURCE
> Task :ubenchmark:publish UP-TO-DATE
> Task :rat FAILED
> Task :example:function:checkstyleTest
> Task :splunk:checkstyleTest
> Task :kafka:checkstyleTest
> Task :elasticsearch:checkstyleMain
> Task :redis:checkstyleTest
> Task :spark:checkstyleTest
> Task :babel:checkstyleTest
> Task :cassandra:checkstyleTest
> Task :pig:checkstyleTest
> Task :geode:checkstyleTest
> Task :mongodb:checkstyleTest
> Task :example:csv:checkstyleTest
> Task :piglet:checkstyleMain
> Task :server:checkstyleTest
> Task :innodb:checkstyleTest
> Task :plus:checkstyleTest
> Task :file:checkstyleTest
> Task :druid:checkstyleMain

> Task :core:javaCCTest
File "TokenMgrError.java" does not exist.  Will create one.
File "ParseException.java" does not exist.  Will create one.
File "Token.java" does not exist.  Will create one.
File "SimpleCharStream.java" does not exist.  Will create one.
Parser generated with 0 errors and 1 warnings.

> Task :testkit:checkstyleMain

> Task :linq4j:compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Build calcite FAILURE reason:  
  
Execution failed for task ':rat':

org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A 
failure occurred while executing org.nosphere.apache.rat.RatWork
at 
org.gradle.workers.internal.DefaultWorkerExecutor$WorkItemExecution.waitForCompletion(DefaultWorkerExecutor.java:342)
at 
org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:142)
at 
org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:94)
at 
org.gradle.internal.work.DefaultAsyncWorkTracker.waitForAll(DefaultAsyncWorkTracker.java:80)
at 

Build failed in Jenkins: Calcite » Calcite-snapshots #103

2022-03-31 Thread Apache Jenkins Server
See 


Changes:

[Francis Chuang] Fix typo documenting rules for triggering a non-release 
website update


--
[...truncated 53.19 KB...]
File "TokenMgrError.java" does not exist.  Will create one.
File "ParseException.java" does not exist.  Will create one.
File "Token.java" does not exist.  Will create one.
File "SimpleCharStream.java" does not exist.  Will create one.
Parser generated with 0 errors and 1 warnings.

> Task :core:versionClass

> Task :server:javaCCMain
File "TokenMgrError.java" does not exist.  Will create one.
File "ParseException.java" does not exist.  Will create one.
File "Token.java" does not exist.  Will create one.
File "SimpleCharStream.java" does not exist.  Will create one.
Parser generated with 0 errors and 1 warnings.

> Task :core:processResources
> Task :server:processResources NO-SOURCE
> Task :server:autostyleConfigsCheck
> Task :server:autostyleJavaCheck
> Task :server:autostyleKotlinGradleCheck
> Task :server:autostyleCheck

> Task :release:distTar
Source distribution is created: 


> Task :release:distTarSha512
> Task :release:assemble
> Task :release:autostyleConfigsCheck NO-SOURCE
> Task :core:fmppTest
> Task :release:autostyleKotlinGradleCheck
> Task :release:autostyleCheck
> Task :release:check
> Task :release:build
> Task :publish UP-TO-DATE
> Task :validateNexusCredentials UP-TO-DATE

> Task :core:javaCCTest
Java Compiler Compiler Version 4.0 (Parser Generator)
(type "javacc" with no arguments for help)
Reading from file 

 . . .
Warning: Output directory 
"
 does not exist. Creating the directory.
Note: UNICODE_INPUT option is specified. Please make sure you create the 
parser/lexer using a Reader with the correct character encoding.

> Task :geode:checkstyleMain
> Task :splunk:checkstyleMain
> Task :redis:checkstyleMain
> Task :example:csv:checkstyleMain
> Task :cassandra:checkstyleMain
> Task :file:checkstyleMain
> Task :mongodb:checkstyleMain
> Task :plus:checkstyleMain
> Task :spark:checkstyleMain
> Task :ubenchmark:checkstyleJmh
> Task :innodb:checkstyleMain
> Task :server:checkstyleMain
> Task :babel:checkstyleMain
> Task :pig:checkstyleMain
> Task :example:function:checkstyleMain
> Task :kafka:checkstyleMain
> Task :ubenchmark:checkstyleMain NO-SOURCE
> Task :ubenchmark:checkstyleTest NO-SOURCE
> Task :ubenchmark:compileTestJava NO-SOURCE
> Task :ubenchmark:processTestResources NO-SOURCE
> Task :ubenchmark:testClasses UP-TO-DATE
> Task :ubenchmark:processJmhResources NO-SOURCE

> Task :rat
Files with unapproved licenses:
 - 



> Task :rat FAILED
> Task :ubenchmark:forbiddenApisMain NO-SOURCE
> Task :example:function:checkstyleTest
> Task :elasticsearch:checkstyleMain
> Task :pig:checkstyleTest
> Task :spark:checkstyleTest
> Task :piglet:checkstyleMain
> Task :kafka:checkstyleTest
> Task :splunk:checkstyleTest
> Task :geode:checkstyleTest
> Task :babel:checkstyleTest
> Task :mongodb:checkstyleTest
> Task :server:checkstyleTest
> Task :innodb:checkstyleTest
> Task :redis:checkstyleTest
> Task :cassandra:checkstyleTest
> Task :example:csv:checkstyleTest
> Task :file:checkstyleTest
> Task :plus:checkstyleTest
> Task :druid:checkstyleMain

> Task :core:javaCCTest
File "TokenMgrError.java" does not exist.  Will create one.
File "ParseException.java" does not exist.  Will create one.
File "Token.java" does not exist.  Will create one.
File "SimpleCharStream.java" does not exist.  Will create one.
Parser generated with 0 errors and 1 warnings.

> Task :testkit:checkstyleMain

> Task :linq4j:compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Build calcite FAILURE reason:  
  
Execution failed for task ':rat':

org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A 
failure occurred while executing org.nosphere.apache.rat.RatWork
at 
org.gradle.workers.internal.DefaultWorkerExecutor$WorkItemExecution.waitForCompletion(DefaultWorkerExecutor.java:342)
at 
org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:142)
at 
org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:94)
at 

[jira] [Created] (CALCITE-5074) Allowing parser extensions

2022-03-31 Thread Rohan Garg (Jira)
Rohan Garg created CALCITE-5074:
---

 Summary: Allowing parser extensions
 Key: CALCITE-5074
 URL: https://issues.apache.org/jira/browse/CALCITE-5074
 Project: Calcite
  Issue Type: New Feature
Reporter: Rohan Garg


We (I and [~cheddar]) recently had the need to extend various parts of Calcite 
in a non-standard SQL manner in our project which uses Calcite.  For example, 
Calcite's TABLESAMPLE keyword always takes a percentage to sample and we wanted 
to adjust it to also allow for an explicit number of rows.  Given that this is 
non-standard, we felt that it wouldn't make sense to do a PR that actually 
impacts Calcite's normal behavior, so we sought a method of extending Calcite 
to add support for our capabilities while still benefiting from all that 
Calcite offers.

We came up with an idea for having an "override map" that can be provided in 
configuration and will cause the parser to override a specific production rule. 
 We include a commit link to show the idea in action 
(https://github.com/rohangarg/calcite/commit/7f0c6ad8c8f6bb2a1d1cca025d35670a8c62b3c4).
  It's a bit fiddly in that each override point needs to be extended with 
if/else template syntax, but that's a pattern that already seems to exist and 
maybe that's a feature rather than a bug?  In either case, if that's too 
fiddly, but this general pattern makes sense, a subsequent task could be taken 
on to try to see if there's another point that this could be added more 
generically without the need for adding the if/else in the template.  Does this 
seem like something that could be merged?

We have included an override grammar that also relaxes the percentage 
constraints on TABLESAMPLE as an example of the type of customization that this 
is attempting to enable.

Just for reference, this customization does exist in other systems as well, so 
it's non-standard but also not unheard of:

1. MS SQL Server : 
https://docs.microsoft.com/en-us/sql/t-sql/queries/from-transact-sql?view=sql-server-ver15#tablesample-clause
2. Snowflake : 
https://docs.snowflake.com/en/sql-reference/constructs/sample.html
3. Google Spanner : 
https://cloud.google.com/spanner/docs/reference/standard-sql/query-syntax#tablesample_operator
4. Apache Spark : 
https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-sampling.html



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


Re: Contributing a custom SQL dialect of Firebolt to Calcite

2022-03-31 Thread Raghav Sharma
Hey Julian!
I followed your suggestions related to the dialect/plugin we want to
contribute to Calcite for Firebolt. Some of the issues that we faced so far:

1. Tests are failing in the RelToSqlConverterTest.java file for Firebolt
reason being the fact the actual parsed query does not contain the
'Identifier Quote String'. For Firebolt, we've chosen '\"' as the
'Identifier Quote String'. Have followed the approach that other dialects
have used and therefore have added support for this in the dialect file as
well as in SqlDialect.java and SqlDialectFactoryImpl.java. Have even
implemented the method 'withFirebolt()' in the test file. Please guide what
else needs to be done for this to be fixed and our test cases to be passed.

2. After adding 'FIREBOLT' to "TEST_DB' in CalciteSystemProperty.java and
running the command: ‘./gradlew -Dcalcite.test.db=FIREBOLT test’,
Calcite throws an error that it could not find the enum for 'FIREBOLT' in
CalciteAssert.java file. Even after adding the enum either with Firebolt's
connection string or using one of the given ones, say POSTGRESQL, it
couldn't locate the driver in both cases. Need your suggestion to tackle
this one.


Thanks & Regards,
Raghav Sharma | SDE 1 | Data Engineering
M: +91 7087637086 I Mail: ragh...@sigmoidanalytics.com



On Tue, Mar 29, 2022 at 1:50 AM Raghav Sharma 
wrote:

> Thank you for the clarification Julian. I will send a mail to
> dev-subscr...@calcite.apache.org for subscribing.
>
>
>
> On Tue, 29 Mar 2022 at 1:45 AM Julian Hyde  wrote:
>
>> You did receive a response[1]. But you didn't receive it because you
>> are not subscribed to this list. Please subscribe[2].
>>
>> Julian
>>
>> [1] https://lists.apache.org/thread/39obrhwpd95bvhc9sb2n4z6zrrwbc21x
>>
>> [2] https://calcite.apache.org/community/#mailing-lists
>>
>> On Mon, Mar 28, 2022 at 1:11 PM Raghav Sharma
>>  wrote:
>> >
>> > Gentle reminder!
>> > We are expecting a response so that we can move ahead with this
>> potential
>> > contribution.
>> >
>> >
>> > Thanks & Regards,
>> > Raghav Sharma | SDE 1 | Data Engineering
>> > M: +91 7087637086 I Mail: ragh...@sigmoidanalytics.com
>> > 
>> >
>> >
>> > On Thu, Mar 24, 2022 at 3:47 PM Raghav Sharma <
>> ragh...@sigmoidanalytics.com>
>> > wrote:
>> >
>> > > Greetings from Sigmoid and Firebolt!
>> > >
>> > >
>> > > This mail is in reference towards contributing a custom sql dialect to
>> > > Calcite.
>> > >
>> > >
>> > > PFB some queries that we have regarding testing the dialect and
>> further
>> > > for contributing:
>> > >
>> > >
>> > > 1. We have developed a SQL dialect for Firebolt. Need to test it
>> against
>> > > the database using calcite. How can we do so? Is this something that
>> can be
>> > > pulled off using the JDBC driver(if so, how?) or is there another way?
>> > >
>> > >
>> > > 2. There are some test files that contain tests for specific dialects.
>> > > Before contributing, should we alter those for Firebolt(if required)
>> or is
>> > > it something that will be taken care of by the Calcite team?
>> > >
>> > >
>> > > 3. Is opening a JIRA case mandatory? Can we raise a PR directly to add
>> > > Firebolt to the master branch of Calcite? Please guide us if there’s
>> an
>> > > alternate option.
>> > >
>> > >
>> > > We are willing to connect over a call as well if that works for you.
>> > >
>> > >
>> > >
>> > > Thanks & Regards,
>> > > Raghav Sharma | SDE 1 | Data Engineering
>> > > M: +91 7087637086 I Mail: ragh...@sigmoidanalytics.com
>> > > 
>> > >
>> > --
>> > Thanks & Regards,
>> > Raghav Sharma | SDE 1 | Data Engineering
>> > M: +91 7087637086 I Mail: ragh...@sigmoidanalytics.com
>> > 
>> >
>> > --
>> >
>> >
>>
> --
> Thanks & Regards,
> Raghav Sharma | SDE 1 | Data Engineering
> M: +91 7087637086 I Mail: ragh...@sigmoidanalytics.com
> 
>

-- 




[jira] [Created] (CALCITE-5073) JoinConditionPushRule cannot infer 'LHS.C1 = LHS.C2' from 'LHS.C1 = RHS.C1 AND LHS.C2 = RHS.C1'

2022-03-31 Thread Benchao Li (Jira)
Benchao Li created CALCITE-5073:
---

 Summary: JoinConditionPushRule cannot infer 'LHS.C1 = LHS.C2' from 
'LHS.C1 = RHS.C1 AND LHS.C2 = RHS.C1'
 Key: CALCITE-5073
 URL: https://issues.apache.org/jira/browse/CALCITE-5073
 Project: Calcite
  Issue Type: Improvement
  Components: core
Affects Versions: 1.30.0
Reporter: Benchao Li
Assignee: Benchao Li
 Fix For: 1.31.0


For the below SQL:
{code:java}
SELECT * FROM T1, T2, T3
WHERE T1.id = T3.id AND T2.id = T3.id{code}
Currently, JoinConditionPushRule cannot infer the condition 'T1.id = T2.id' for 
the first join relation.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)