[jira] [Created] (CALCITE-2354) How to add existing user-defined functions in Schema

2018-06-05 Thread Subbarao (JIRA)
Subbarao created CALCITE-2354:
-

 Summary: How to add existing user-defined functions in Schema
 Key: CALCITE-2354
 URL: https://issues.apache.org/jira/browse/CALCITE-2354
 Project: Calcite
  Issue Type: Bug
  Components: jdbc-adapter
Reporter: Subbarao
Assignee: Julian Hyde


Iam already having some of the functions in oracle database i.e :user defined 
functions like FN_CODE("columnname").Then how can i add these type of already 
existing functions in Apache calcite schema



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2323) The configuration parameter "defaultNullCollation" which enum NullCollation { LOW, HIGH, FIRST, LAST } to allow alternative policies, but it can't take effect for ove

2018-06-05 Thread John Fang (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502797#comment-16502797
 ] 

John Fang commented on CALCITE-2323:


[~julianhyde] can you help me review it again?

> The configuration parameter "defaultNullCollation" which enum NullCollation { 
> LOW, HIGH, FIRST, LAST } to allow alternative policies, but it can't take 
> effect for over();
> --
>
> Key: CALCITE-2323
> URL: https://issues.apache.org/jira/browse/CALCITE-2323
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: John Fang
>Assignee: Julian Hyde
>Priority: Major
>
> For example, the following query:
> *select deptno, rank() over(partition by empno order by deptno) from emp 
> order by row_number() over(partition by empno order by deptno.*
> The default null order is nulls last for deptno in calcite. But the null 
> order still is nulls last if we set the parameter "defaultNullCollation" with 
> NullCollation.LOW.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2352) Upgrade checkstyle to support Java8 lambdas

2018-06-05 Thread Laurent Goujon (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502781#comment-16502781
 ] 

Laurent Goujon commented on CALCITE-2352:
-

I figured out why the guava issue: checkstyle requires guava 19.0, but was 
getting 14.0 from maven.

Posted a patch on github with the upgrade, plus all the changes to comply with 
the new version.

> Upgrade checkstyle to support Java8 lambdas
> ---
>
> Key: CALCITE-2352
> URL: https://issues.apache.org/jira/browse/CALCITE-2352
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica
>Reporter: Laurent Goujon
>Priority: Major
>
> Version of checkstyle used by Avatica (5.7) doesn't support constructs from 
> Java8 like lambdas and static methods in interfaces.
> This would result in lots of small changes to adjust to the stricter rules.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2353) Allow user to override SqlSetOption in alterStatementParserMethods

2018-06-05 Thread Andrew Pilloud (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502770#comment-16502770
 ] 

Andrew Pilloud commented on CALCITE-2353:
-

That is what I intended. I opened a PR that does this; 
https://github.com/apache/calcite/pull/722

> Allow user to override SqlSetOption in alterStatementParserMethods
> --
>
> Key: CALCITE-2353
> URL: https://issues.apache.org/jira/browse/CALCITE-2353
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Andrew Pilloud
>Assignee: Julian Hyde
>Priority: Major
>
> If alterStatementParserMethods are added before SqlSetOption then the user 
> can replace SqlSetOption. This change matches how statementParserMethods are 
> added at the top level.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2352) Upgrade checkstyle to support Java8 lambdas

2018-06-05 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502759#comment-16502759
 ] 

ASF GitHub Bot commented on CALCITE-2352:
-

GitHub user laurentgo opened a pull request:

https://github.com/apache/calcite-avatica/pull/56

[CALCITE-2352] Update to checkstyle 6.18

Update project to maven-checkstyle-plugin 3.0.0/checkstyle 6.18.
Fix all new reported violations.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/laurentgo/calcite-avatica 
laurentgo/CALCITE-2352

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/calcite-avatica/pull/56.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #56


commit acb675de97b9b0743c09368820a770e2ceda05f8
Author: Laurent Goujon 
Date:   2018-06-06T02:39:38Z

[CALCITE-2352] Update to checkstyle 6.18

Update project to maven-checkstyle-plugin 3.0.0/checkstyle 6.18.
Fix all new reported violations.




> Upgrade checkstyle to support Java8 lambdas
> ---
>
> Key: CALCITE-2352
> URL: https://issues.apache.org/jira/browse/CALCITE-2352
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica
>Reporter: Laurent Goujon
>Priority: Major
>
> Version of checkstyle used by Avatica (5.7) doesn't support constructs from 
> Java8 like lambdas and static methods in interfaces.
> This would result in lots of small changes to adjust to the stricter rules.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (CALCITE-2345) add tests using Fongo to Mongo Adapter

2018-06-05 Thread Andrei Sereda (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502735#comment-16502735
 ] 

Andrei Sereda edited comment on CALCITE-2345 at 6/6/18 1:52 AM:


Pls take a look at [723|https://github.com/apache/calcite/pull/723]. I have 
tried to create a base class {{MongoIntegrationBase}}. 

Bad news is that fongo is pretty slow with large data-sets. And [is 
limiting|https://github.com/fakemongo/fongo/blob/master/src/main/java/com/mongodb/FongoDBCollection.java#L163]
 collection to 100k elements:
{quote}Whoa, hold up there.  Fongo's designed for lightweight testing.  100,000 
items per collection max{quote}
Doesn't look like in practice it was meant for more than several dozen 
elements. Currently many tests run for 30 sec each.

You will notice that I'm doing [ugly 
string/replace|https://github.com/apache/calcite/pull/723/files#diff-2784ba4a7d4b5ad74d2af2b03bc31a89R121]
 of {{SchemaFactory}} class in order to inject populated database instance. 
Couldn't find a more elegant way when model is loaded from file.



was (Author: asereda):
Pls take a look at [723|https://github.com/apache/calcite/pull/723]. I have 
tried to create a base class {{MongoIntegrationBase}}. 

Bad news is that fongo is pretty slow with large data-sets. And [is 
limiting|https://github.com/fakemongo/fongo/blob/master/src/main/java/com/mongodb/FongoDBCollection.java#L163]
 collection to 100k elements:
{quote}Whoa, hold up there.  Fongo's designed for lightweight testing.  100,000 
items per collection max{quote}
Doesn't look like in practice it was meant for more than several dozen 
elements. Currently many tests run for 30 sec each.





> add tests using Fongo to Mongo Adapter
> --
>
> Key: CALCITE-2345
> URL: https://issues.apache.org/jira/browse/CALCITE-2345
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Andrei Sereda
>Assignee: Michael Mior
>Priority: Major
>
> Better test coverage for unit tests using 
> [Fongo|https://github.com/fakemongo/fongo] which is in-memory implementation 
> of Mongo API.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2345) add tests using Fongo to Mongo Adapter

2018-06-05 Thread Andrei Sereda (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502735#comment-16502735
 ] 

Andrei Sereda commented on CALCITE-2345:


Pls take a look at [723|https://github.com/apache/calcite/pull/723]. I have 
tried to create a base class {{MongoIntegrationBase}}. 

Bad news is that fongo is pretty slow with large data-sets. And [is 
limiting|https://github.com/fakemongo/fongo/blob/master/src/main/java/com/mongodb/FongoDBCollection.java#L163]
 collection to 100k elements:
{quote}Whoa, hold up there.  Fongo's designed for lightweight testing.  100,000 
items per collection max{quote}
Doesn't look like in practice it was meant for more than several dozen 
elements. Currently many tests run for 30 sec each.





> add tests using Fongo to Mongo Adapter
> --
>
> Key: CALCITE-2345
> URL: https://issues.apache.org/jira/browse/CALCITE-2345
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Andrei Sereda
>Assignee: Michael Mior
>Priority: Major
>
> Better test coverage for unit tests using 
> [Fongo|https://github.com/fakemongo/fongo] which is in-memory implementation 
> of Mongo API.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2353) Allow user to override SqlSetOption in alterStatementParserMethods

2018-06-05 Thread Shuyi Chen (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502690#comment-16502690
 ] 

Shuyi Chen commented on CALCITE-2353:
-

By swapping the order, the parser will match the user DDL rule first, so you 
can implement your own SET operation, is that what you intend to do?

I am not an expert in the parser logic, but it sounds fine to me. 

> Allow user to override SqlSetOption in alterStatementParserMethods
> --
>
> Key: CALCITE-2353
> URL: https://issues.apache.org/jira/browse/CALCITE-2353
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Andrew Pilloud
>Assignee: Julian Hyde
>Priority: Major
>
> If alterStatementParserMethods are added before SqlSetOption then the user 
> can replace SqlSetOption. This change matches how statementParserMethods are 
> added at the top level.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (CALCITE-2353) Allow user to override SqlSetOption in alterStatementParserMethods

2018-06-05 Thread Andrew Pilloud (JIRA)
Andrew Pilloud created CALCITE-2353:
---

 Summary: Allow user to override SqlSetOption in 
alterStatementParserMethods
 Key: CALCITE-2353
 URL: https://issues.apache.org/jira/browse/CALCITE-2353
 Project: Calcite
  Issue Type: Bug
  Components: core
Reporter: Andrew Pilloud
Assignee: Julian Hyde


If alterStatementParserMethods are added before SqlSetOption then the user can 
replace SqlSetOption. This change matches how statementParserMethods are added 
at the top level.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CALCITE-2341) ImmutableBitSetTest fails with JDK11

2018-06-05 Thread Francis Chuang (JIRA)


 [ 
https://issues.apache.org/jira/browse/CALCITE-2341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Francis Chuang updated CALCITE-2341:

Component/s: avatica

> ImmutableBitSetTest fails with JDK11
> 
>
> Key: CALCITE-2341
> URL: https://issues.apache.org/jira/browse/CALCITE-2341
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica, core
>Reporter: Laurent Goujon
>Assignee: Laurent Goujon
>Priority: Minor
> Fix For: avatica-1.12.0
>
>
> A error message change in JDK11 causes ImmutableBitSetTest to fail



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CALCITE-2341) ImmutableBitSetTest fails with JDK11

2018-06-05 Thread Francis Chuang (JIRA)


 [ 
https://issues.apache.org/jira/browse/CALCITE-2341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Francis Chuang updated CALCITE-2341:

Fix Version/s: avatica-1.12.0

> ImmutableBitSetTest fails with JDK11
> 
>
> Key: CALCITE-2341
> URL: https://issues.apache.org/jira/browse/CALCITE-2341
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Laurent Goujon
>Assignee: Laurent Goujon
>Priority: Minor
> Fix For: avatica-1.12.0
>
>
> A error message change in JDK11 causes ImmutableBitSetTest to fail



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2352) Upgrade checkstyle to support Java8 lambdas

2018-06-05 Thread Laurent Goujon (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502356#comment-16502356
 ] 

Laurent Goujon commented on CALCITE-2352:
-

True that plugin doesn't need to be updated, but 2.17 is from 2015 and 3.0.0 is 
2018, so it seemed also logical to look at it at the same time (note that 3.0.0 
is based on checkstyle 6.18 which was released in May 2016, so clearly the 
plugin maintainer is pretty conservative too)

> Upgrade checkstyle to support Java8 lambdas
> ---
>
> Key: CALCITE-2352
> URL: https://issues.apache.org/jira/browse/CALCITE-2352
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica
>Reporter: Laurent Goujon
>Priority: Major
>
> Version of checkstyle used by Avatica (5.7) doesn't support constructs from 
> Java8 like lambdas and static methods in interfaces.
> This would result in lots of small changes to adjust to the stricter rules.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2352) Upgrade checkstyle to support Java8 lambdas

2018-06-05 Thread Kevin Risden (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502341#comment-16502341
 ] 

Kevin Risden commented on CALCITE-2352:
---

I had looked at upgrading Checkstyle to 8.x and the latest we could go to was 
7.x due to hydromatic-toolbox as [~laurentgo] pointed out. This did generate a 
bunch of checkstyle violations due to new versions of Checkstyle. 

The checkstyle plugin doesn't need to be updated to update checkstyle itself. 
https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/upgrading-checkstyle.html

> Upgrade checkstyle to support Java8 lambdas
> ---
>
> Key: CALCITE-2352
> URL: https://issues.apache.org/jira/browse/CALCITE-2352
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica
>Reporter: Laurent Goujon
>Priority: Major
>
> Version of checkstyle used by Avatica (5.7) doesn't support constructs from 
> Java8 like lambdas and static methods in interfaces.
> This would result in lots of small changes to adjust to the stricter rules.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2339) JDBC adapter should transform timestamp arithmetic for target database

2018-06-05 Thread Julian Hyde (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502245#comment-16502245
 ] 

Julian Hyde commented on CALCITE-2339:
--

Looks basically good:
 * missing MINUTE from the switch
 * I don't think the visitor can throw FoundOne
 * only call the method if the condition is not null, do not check for nulls in 
the method, and assume the method returns not-null
 * indentation is off in a couple of places
 * need some unit tests
 * rather than trying to do constant reduction to convert interval to integer, 
could you just use "cast( AS INTEGER)"? less code to 
maintain

> JDBC adapter should transform timestamp arithmetic for target database 
> ---
>
> Key: CALCITE-2339
> URL: https://issues.apache.org/jira/browse/CALCITE-2339
> Project: Calcite
>  Issue Type: Bug
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
> Attachments: Datetime Addition - Calcite.pdf
>
>
> JDBC adapter should transform timestamp arithmetic for target database.
> There are two ways in Calcite to add intervals to timestamps: the 
> TIMESTAMP_ADD function and the " + " operator.
> The attached document (authored by James Doung) describes their pros and cons.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2352) Upgrade checkstyle to support Java8 lambdas

2018-06-05 Thread Laurent Goujon (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502184#comment-16502184
 ] 

Laurent Goujon commented on CALCITE-2352:
-

At least 5.9 I believe for lambda, and probably 6.1. I did several tries and 
run into several issues:
- maven-checkstyle-plugin 3.0.0 (which would be 6.18) has some guava issue with 
maven or another plugin, causing the project to fail right away. Previous 
plugin version (2.17) seems okay though
- recent versions of checkstyle (8.2 or higher) removed FileContentHolder 
module, and it seems it might require a new build of hydromatic-toolbox as the 
checkstyle verifier is probably depending on it
- depending on which checkstyle version being used, it generates betweem 100 
and 200 violations.

Calcite seems to be on 3.0.0 plugin/Checkstyle 6.18 btw


> Upgrade checkstyle to support Java8 lambdas
> ---
>
> Key: CALCITE-2352
> URL: https://issues.apache.org/jira/browse/CALCITE-2352
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica
>Reporter: Laurent Goujon
>Priority: Major
>
> Version of checkstyle used by Avatica (5.7) doesn't support constructs from 
> Java8 like lambdas and static methods in interfaces.
> This would result in lots of small changes to adjust to the stricter rules.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2352) Upgrade checkstyle to support Java8 lambdas

2018-06-05 Thread Josh Elser (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16502160#comment-16502160
 ] 

Josh Elser commented on CALCITE-2352:
-

[~laurentgo] do you know what version we have to go to?

> Upgrade checkstyle to support Java8 lambdas
> ---
>
> Key: CALCITE-2352
> URL: https://issues.apache.org/jira/browse/CALCITE-2352
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica
>Reporter: Laurent Goujon
>Priority: Major
>
> Version of checkstyle used by Avatica (5.7) doesn't support constructs from 
> Java8 like lambdas and static methods in interfaces.
> This would result in lots of small changes to adjust to the stricter rules.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (CALCITE-2339) JDBC adapter should transform timestamp arithmetic for target database

2018-06-05 Thread James Duong (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16501595#comment-16501595
 ] 

James Duong edited comment on CALCITE-2339 at 6/5/18 4:09 PM:
--

I've put up a PR for what I'm thinking should happen:

[https://github.com/apache/calcite/pull/721]

 

(This is an initial implementation to demonstrate the idea. I intend to add 
more tests for this).

 

This PR adds a new RexUtil method to convert a RexNode holding a datetime_plus 
call to an equivalent RexNode holding a TimestampAdd call.

I've changed RelToSqlConverter to check if a SqlDialect needs this 
transformation and apply it. However this introduces an odd bit of behavior 
where we need to use RexBuilder from within RelToSqlConverter (because the 
conversion process creates RexNodes, but we can't check if a dialect needs this 
conversion until we're in RelToSqlConverter already).

 

This patch handles interval literals as well as multiplications of interval 
literals. (the latter needed because the TimestampAddConvertlet creates a 
multiplication expression when normalizing a TimestampAdd call to a 
datetime_plus call).

 

I also noticed that CALCITE-2188 already implements dialect-level unparsing of 
datetime_plus to timestampadd. However this is only applicable to SqlDialects


was (Author: jduong):
I've put up a PR for what I'm thinking should happen:

[https://github.com/apache/calcite/pull/721]

 

(This is an initial implementation to demonstrate the idea. I intend to add 
more tests for this).

 

This PR adds a new RexUtil method to convert a RexNode holding a datetime_plus 
call to an equivalent RexNode holding a TimestampAdd call.

I've changed RelToSqlConverter to check if a SqlDialect needs this 
transformation and apply it. However this introduces an odd bit of behavior 
where we need to use RexBuilder from within RelToSqlConverter (because the 
conversion process creates RexNodes, but we can't check if a dialect needs this 
conversion until we're in RelToSqlConverter already).

 

This patch handles interval literals as well as multiplications of interval 
literals. (the latter needed because the TimestampAddConvertlet creates a 
multiplication expression when normalizing a TimestampAdd call to a 
datetime_plus call).

 

I also noticed that CALCITE-2188 already implements dialect-level unparsing of 
datetime_plus to timestampadd. However this is only applicable to SqlDialects. 
Also, it doesn't appear to handle multiplications of interval literals.

> JDBC adapter should transform timestamp arithmetic for target database 
> ---
>
> Key: CALCITE-2339
> URL: https://issues.apache.org/jira/browse/CALCITE-2339
> Project: Calcite
>  Issue Type: Bug
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
> Attachments: Datetime Addition - Calcite.pdf
>
>
> JDBC adapter should transform timestamp arithmetic for target database.
> There are two ways in Calcite to add intervals to timestamps: the 
> TIMESTAMP_ADD function and the " + " operator.
> The attached document (authored by James Doung) describes their pros and cons.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (CALCITE-2352) Upgrade checkstyle to support Java8 lambdas

2018-06-05 Thread Laurent Goujon (JIRA)
Laurent Goujon created CALCITE-2352:
---

 Summary: Upgrade checkstyle to support Java8 lambdas
 Key: CALCITE-2352
 URL: https://issues.apache.org/jira/browse/CALCITE-2352
 Project: Calcite
  Issue Type: Bug
  Components: avatica
Reporter: Laurent Goujon


Version of checkstyle used by Avatica (5.7) doesn't support constructs from 
Java8 like lambdas and static methods in interfaces.

This would result in lots of small changes to adjust to the stricter rules.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2319) Druid Expressions - Output Type of Boolean expressions should be set to LONG.

2018-06-05 Thread Julian Hyde (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16501982#comment-16501982
 ] 

Julian Hyde commented on CALCITE-2319:
--

Thanks - long is much better.

Can you clarify: which values are considered true, which false, and which 
unknown?

> Druid Expressions - Output Type of Boolean expressions should be set to LONG.
> -
>
> Key: CALCITE-2319
> URL: https://issues.apache.org/jira/browse/CALCITE-2319
> Project: Calcite
>  Issue Type: Bug
>Reporter: Nishant Bangarwa
>Assignee: Nishant Bangarwa
>Priority: Major
>
> Sample Query - 
> {code} 
> SELECT \"product_id\" > 1000 as pid_category, COUNT(\"store_sales\") FROM 
> FOODMART_TABLE GROUP BY \"product_id\" > 1000";
> {code}
> For the above query output type of virtual column is set to string whereas it 
> should be set to float as druid expression return type is float. 
> {code}
> "{"queryType":"groupBy","dataSource":"foodmart","granularity":"all","dimensions":[{"type":"default","dimension":"vc","outputName":"vc","outputType":"STRING"}],"virtualColumns":[{"type":"expression","name":"vc","expression":"(CAST(\"product_id\",
>  'LONG') > 
> 1000)","outputType":"FLOAT"}],"limitSpec":{"type":"default"},"aggregations":[{"type":"filtered","filter":{"type":"not","field":{"type":"selector","dimension":"store_sales","value":null}},"aggregator":{"type":"count","name":"EXPR$1","fieldName":"store_sales"}}],"intervals":["1900-01-09T00:00:00.000Z/2992-01-10T00:00:00.000Z"]}"
> {code} 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2341) ImmutableBitSetTest fails with JDK11

2018-06-05 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16501900#comment-16501900
 ] 

ASF GitHub Bot commented on CALCITE-2341:
-

Github user risdenk commented on the issue:

https://github.com/apache/calcite-avatica/pull/55
  
:+1: Thanks!


> ImmutableBitSetTest fails with JDK11
> 
>
> Key: CALCITE-2341
> URL: https://issues.apache.org/jira/browse/CALCITE-2341
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Laurent Goujon
>Assignee: Laurent Goujon
>Priority: Minor
>
> A error message change in JDK11 causes ImmutableBitSetTest to fail



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2341) ImmutableBitSetTest fails with JDK11

2018-06-05 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16501883#comment-16501883
 ] 

ASF GitHub Bot commented on CALCITE-2341:
-

Github user asfgit closed the pull request at:

https://github.com/apache/calcite-avatica/pull/55


> ImmutableBitSetTest fails with JDK11
> 
>
> Key: CALCITE-2341
> URL: https://issues.apache.org/jira/browse/CALCITE-2341
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Laurent Goujon
>Assignee: Laurent Goujon
>Priority: Minor
>
> A error message change in JDK11 causes ImmutableBitSetTest to fail



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2341) ImmutableBitSetTest fails with JDK11

2018-06-05 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16501878#comment-16501878
 ] 

ASF GitHub Bot commented on CALCITE-2341:
-

GitHub user laurentgo opened a pull request:

https://github.com/apache/calcite-avatica/pull/55

[CALCITE-2341] Fix javadoc plugin incompatibility

Fix the javadoc plugin incompatibility with JDK10 or higher but
updating the plugin version from 3.0.0 to 3.0.1

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/laurentgo/calcite-avatica 
laurentgo/CALCITE-2341-javadoc

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/calcite-avatica/pull/55.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #55


commit d09f99eacc53da9fd4092f61a8dc14c6b84c5483
Author: Laurent Goujon 
Date:   2018-06-05T14:40:26Z

[CALCITE-2341] Fix javadoc plugin incompatibility

Fix the javadoc plugin incompatibility with JDK10 or higher but
updating the plugin version from 3.0.0 to 3.0.1




> ImmutableBitSetTest fails with JDK11
> 
>
> Key: CALCITE-2341
> URL: https://issues.apache.org/jira/browse/CALCITE-2341
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Laurent Goujon
>Assignee: Laurent Goujon
>Priority: Minor
>
> A error message change in JDK11 causes ImmutableBitSetTest to fail



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2341) ImmutableBitSetTest fails with JDK11

2018-06-05 Thread Laurent Goujon (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16501874#comment-16501874
 ] 

Laurent Goujon commented on CALCITE-2341:
-

I saw the message after committing the patch, sorry.

The issue seems to be caused by an incompatibility between the plugin and JDK10 
and higher. A new version of the plugin have been released (3.0.1). Currently 
testing it.

> ImmutableBitSetTest fails with JDK11
> 
>
> Key: CALCITE-2341
> URL: https://issues.apache.org/jira/browse/CALCITE-2341
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Laurent Goujon
>Assignee: Laurent Goujon
>Priority: Minor
>
> A error message change in JDK11 causes ImmutableBitSetTest to fail



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2339) JDBC adapter should transform timestamp arithmetic for target database

2018-06-05 Thread James Duong (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16501595#comment-16501595
 ] 

James Duong commented on CALCITE-2339:
--

I've put up a PR for what I'm thinking should happen:

[https://github.com/apache/calcite/pull/721]

 

(This is an initial implementation to demonstrate the idea. I intend to add 
more tests for this).

 

This PR adds a new RexUtil method to convert a RexNode holding a datetime_plus 
call to an equivalent RexNode holding a TimestampAdd call.

I've changed RelToSqlConverter to check if a SqlDialect needs this 
transformation and apply it. However this introduces an odd bit of behavior 
where we need to use RexBuilder from within RelToSqlConverter (because the 
conversion process creates RexNodes, but we can't check if a dialect needs this 
conversion until we're in RelToSqlConverter already).

 

This patch handles interval literals as well as multiplications of interval 
literals. (the latter needed because the TimestampAddConvertlet creates a 
multiplication expression when normalizing a TimestampAdd call to a 
datetime_plus call).

 

I also noticed that CALCITE-2188 already implements dialect-level unparsing of 
datetime_plus to timestampadd. However this is only applicable to SqlDialects. 
Also, it doesn't appear to handle multiplications of interval literals.

> JDBC adapter should transform timestamp arithmetic for target database 
> ---
>
> Key: CALCITE-2339
> URL: https://issues.apache.org/jira/browse/CALCITE-2339
> Project: Calcite
>  Issue Type: Bug
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
> Attachments: Datetime Addition - Calcite.pdf
>
>
> JDBC adapter should transform timestamp arithmetic for target database.
> There are two ways in Calcite to add intervals to timestamps: the 
> TIMESTAMP_ADD function and the " + " operator.
> The attached document (authored by James Doung) describes their pros and cons.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2327) In 3 valued logic mode (b and not b) may not be simplified to false

2018-06-05 Thread Zoltan Haindrich (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16501437#comment-16501437
 ] 

Zoltan Haindrich commented on CALCITE-2327:
---

[~jcamachorodriguez] could you please take a look?  I've removed that block 
which seemed unneccessary

> In 3 valued logic mode (b and not b) may not be simplified to false
> ---
>
> Key: CALCITE-2327
> URL: https://issues.apache.org/jira/browse/CALCITE-2327
> Project: Calcite
>  Issue Type: Bug
>Reporter: Zoltan Haindrich
>Assignee: Zoltan Haindrich
>Priority: Major
>
> currently its simplified to false; but that is not correct when a is unknown



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2319) Druid Expressions - Output Type of Boolean expressions should be set to LONG.

2018-06-05 Thread Nishant Bangarwa (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16501416#comment-16501416
 ] 

Nishant Bangarwa commented on CALCITE-2319:
---

[~julianhyde] mapped boolean to long to make it more intutive. 
[~jcamachorodriguez] [~bslim] please review. 

> Druid Expressions - Output Type of Boolean expressions should be set to LONG.
> -
>
> Key: CALCITE-2319
> URL: https://issues.apache.org/jira/browse/CALCITE-2319
> Project: Calcite
>  Issue Type: Bug
>Reporter: Nishant Bangarwa
>Assignee: Nishant Bangarwa
>Priority: Major
>
> Sample Query - 
> {code} 
> SELECT \"product_id\" > 1000 as pid_category, COUNT(\"store_sales\") FROM 
> FOODMART_TABLE GROUP BY \"product_id\" > 1000";
> {code}
> For the above query output type of virtual column is set to string whereas it 
> should be set to float as druid expression return type is float. 
> {code}
> "{"queryType":"groupBy","dataSource":"foodmart","granularity":"all","dimensions":[{"type":"default","dimension":"vc","outputName":"vc","outputType":"STRING"}],"virtualColumns":[{"type":"expression","name":"vc","expression":"(CAST(\"product_id\",
>  'LONG') > 
> 1000)","outputType":"FLOAT"}],"limitSpec":{"type":"default"},"aggregations":[{"type":"filtered","filter":{"type":"not","field":{"type":"selector","dimension":"store_sales","value":null}},"aggregator":{"type":"count","name":"EXPR$1","fieldName":"store_sales"}}],"intervals":["1900-01-09T00:00:00.000Z/2992-01-10T00:00:00.000Z"]}"
> {code} 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CALCITE-2319) Druid Expressions - Output Type of Boolean expressions should be set to LONG.

2018-06-05 Thread Nishant Bangarwa (JIRA)


 [ 
https://issues.apache.org/jira/browse/CALCITE-2319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nishant Bangarwa updated CALCITE-2319:
--
Summary: Druid Expressions - Output Type of Boolean expressions should be 
set to LONG.  (was: Druid Expressions - Output Type of Boolean expressions 
should be set to FLOAT.)

> Druid Expressions - Output Type of Boolean expressions should be set to LONG.
> -
>
> Key: CALCITE-2319
> URL: https://issues.apache.org/jira/browse/CALCITE-2319
> Project: Calcite
>  Issue Type: Bug
>Reporter: Nishant Bangarwa
>Assignee: Nishant Bangarwa
>Priority: Major
>
> Sample Query - 
> {code} 
> SELECT \"product_id\" > 1000 as pid_category, COUNT(\"store_sales\") FROM 
> FOODMART_TABLE GROUP BY \"product_id\" > 1000";
> {code}
> For the above query output type of virtual column is set to string whereas it 
> should be set to float as druid expression return type is float. 
> {code}
> "{"queryType":"groupBy","dataSource":"foodmart","granularity":"all","dimensions":[{"type":"default","dimension":"vc","outputName":"vc","outputType":"STRING"}],"virtualColumns":[{"type":"expression","name":"vc","expression":"(CAST(\"product_id\",
>  'LONG') > 
> 1000)","outputType":"FLOAT"}],"limitSpec":{"type":"default"},"aggregations":[{"type":"filtered","filter":{"type":"not","field":{"type":"selector","dimension":"store_sales","value":null}},"aggregator":{"type":"count","name":"EXPR$1","fieldName":"store_sales"}}],"intervals":["1900-01-09T00:00:00.000Z/2992-01-10T00:00:00.000Z"]}"
> {code} 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)