[jira] [Commented] (CALCITE-2348) handling non-deterministic operator in rules

2018-06-02 Thread Julian Hyde (JIRA)


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

Julian Hyde commented on CALCITE-2348:
--

This is by design. If the operator is non-deterministic and you push it down 
(or otherwise transform the query in such a way that it receives different 
calls, or the same calls in a different order) then the query will give 
different results.

> handling non-deterministic operator in rules
> 
>
> Key: CALCITE-2348
> URL: https://issues.apache.org/jira/browse/CALCITE-2348
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.17.0
>Reporter: godfrey he
>Assignee: Julian Hyde
>Priority: Major
>
> Currently,  rules do not handle non-deterministic operator,
> e.g. FilterAggregateTransposeRule can't push down a non-deterministic filter 
> through an aggregate.
> {code:java}
> // rand_substr is a non-deterministic udf
> @Test public void testPushFilterPastAggWithNondeterministicFilter() {
>   final String sql = "select ename, empno, c from\n"
>   + " (select ename, empno, count(*) as c from emp group by ename, empno) 
> t\n"
>   + " where rand_substr(ename, 1, 3) = 'Tom' and empno = 10";
>   checkPlanning(FilterAggregateTransposeRule.INSTANCE, sql);
> }{code}
>  



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


[jira] [Commented] (CALCITE-759) Add DayOfWeek and other missing date/time functions

2018-06-02 Thread Julian Hyde (JIRA)


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

Julian Hyde commented on CALCITE-759:
-

Thanks for doing this analysis. Very useful.

Of the ones that are supported by multiple databases (DATEPART, DAY, LAST_DAY, 
TO_CHAR, TO_TIMESTAMP), are their specifications largely the same?

WEEKDAY (Mon=0, Sun=6) seems to occur in MySQL but not in ODBC or any other 
database I could find. So we should use MySQL as the standard. Frankly, low 
priority, because WEEKDAY\(x) == MOD(EXTRACT(DOW FROM x) + 1, 7).

If there is a conflict between ODBC and another database, the ODBC semantics 
should only apply if they call using ODBC function syntax: {code}{fn 
FUNCTION_NAME(arg, ...)}{code}

I think the high priority ones are the TO_xxx functions (e.g. TO_CHAR, 
TO_TIMESTAMP). Anything that involves formatting or parsing is too complicated 
to achieve using the existing functions.

What do other people think are the important functions to add to Calcite?

> Add DayOfWeek and other missing date/time functions
> ---
>
> Key: CALCITE-759
> URL: https://issues.apache.org/jira/browse/CALCITE-759
> Project: Calcite
>  Issue Type: Bug
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
>  Labels: dialect, newbie
>
> Calcite implements EXTRACT, FLOOR, CEIL, CAST, +, - on date/time values and 
> much can be accomplished with these. But there are other useful functions in 
> other databases.
> For example MySQL has DayOfWeek. See 
> https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html. It is 
> tricky to achieve the same in Calcite (you'd need to subtract the epoch and 
> take the interval modulo 7).
> We need to review the date/time functions in MySQL, Postgres and Oracle, and 
> add functions to ensure that you can accomplish the same things in Calcite 
> fairly easily.



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


[jira] [Resolved] (CALCITE-2350) Cannot shade Avatica with Guava 21.0 or higher

2018-06-02 Thread Julian Hyde (JIRA)


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

Julian Hyde resolved CALCITE-2350.
--
Resolution: Fixed

Fixed in 
[f44b1127|http://git-wip-us.apache.org/repos/asf/calcite-avatica/commit/f44b1127].

> Cannot shade Avatica with Guava 21.0 or higher
> --
>
> Key: CALCITE-2350
> URL: https://issues.apache.org/jira/browse/CALCITE-2350
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica
>Affects Versions: avatica-1.11.0
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
> Fix For: avatica-1.12.0
>
>
> When building Avatica with Guava version 23.0, I run into an error while 
> shading:
> {noformat}
> $ mvn -Dguava.version=23.0 -DskipTests clean package
> [INFO] --- maven-shade-plugin:2.1:shade (default) @ avatica-standalone-server 
> ---
> [INFO] Including org.apache.calcite.avatica:avatica-core:jar:1.12.0-SNAPSHOT 
> in the shaded jar.
> [INFO] Including 
> org.apache.calcite.avatica:avatica-metrics:jar:1.12.0-SNAPSHOT in the shaded 
> jar.
> [INFO] Including com.fasterxml.jackson.core:jackson-core:jar:2.9.4 in the 
> shaded jar.
> [INFO] Including com.fasterxml.jackson.core:jackson-annotations:jar:2.9.4 in 
> the shaded jar.
> [INFO] Including com.fasterxml.jackson.core:jackson-databind:jar:2.9.4 in the 
> shaded jar.
> [INFO] Including com.google.protobuf:protobuf-java:jar:3.3.0 in the shaded 
> jar.
> [INFO] Including org.apache.httpcomponents:httpclient:jar:4.5.2 in the shaded 
> jar.
> [INFO] Including commons-logging:commons-logging:jar:1.2 in the shaded jar.
> [INFO] Including commons-codec:commons-codec:jar:1.9 in the shaded jar.
> [INFO] Including org.apache.httpcomponents:httpcore:jar:4.4.4 in the shaded 
> jar.
> [INFO] Including 
> org.apache.calcite.avatica:avatica-server:jar:1.12.0-SNAPSHOT in the shaded 
> jar.
> [INFO] Including javax.servlet:javax.servlet-api:jar:3.0.1 in the shaded jar.
> [INFO] Including com.google.guava:guava:jar:23.0 in the shaded jar.
> [INFO] Including com.google.code.findbugs:jsr305:jar:1.3.9 in the shaded jar.
> [INFO] Including com.google.errorprone:error_prone_annotations:jar:2.0.18 in 
> the shaded jar.
> [INFO] Including com.google.j2objc:j2objc-annotations:jar:1.1 in the shaded 
> jar.
> [INFO] Including org.codehaus.mojo:animal-sniffer-annotations:jar:1.14 in the 
> shaded jar.
> [INFO] Including org.eclipse.jetty:jetty-http:jar:9.2.19.v20160908 in the 
> shaded jar.
> [INFO] Including org.eclipse.jetty:jetty-security:jar:9.2.19.v20160908 in the 
> shaded jar.
> [INFO] Including org.eclipse.jetty:jetty-server:jar:9.2.19.v20160908 in the 
> shaded jar.
> [INFO] Including org.eclipse.jetty:jetty-io:jar:9.2.19.v20160908 in the 
> shaded jar.
> [INFO] Including org.eclipse.jetty:jetty-util:jar:9.2.19.v20160908 in the 
> shaded jar.
> [INFO] Including com.beust:jcommander:jar:1.48 in the shaded jar.
> [INFO] Including org.slf4j:slf4j-api:jar:1.7.13 in the shaded jar.
> [INFO] Including org.slf4j:slf4j-log4j12:jar:1.7.13 in the shaded jar.
> [INFO] Including log4j:log4j:jar:1.2.17 in the shaded jar.
> [INFO] 
> 
> [INFO] Reactor Summary:
> [INFO] 
> [INFO] Apache Calcite Avatica Project 1.12.0-SNAPSHOT . SUCCESS [ 2.028 s]
> [INFO] Apache Calcite Avatica Metrics . SUCCESS [ 1.900 s]
> [INFO] Apache Calcite Avatica . SUCCESS [ 16.995 
> s]
> [INFO] Apache Calcite Avatica Server .. SUCCESS [ 2.231 s]
> [INFO] Apache Calcite Avatica Standalone Server ... FAILURE [ 3.765 s]
> [INFO] Apache Calcite Avatica Docker images ... SKIPPED
> [INFO] Apache Calcite Avatica Dropwizard Metrics 3  SKIPPED
> [INFO] Apache Calcite Avatica Noop Driver . SKIPPED
> [INFO] Apache Calcite Avatica Compatibility Kit ... SKIPPED
> [INFO] Apache Calcite Avatica (Shaded) 1.12.0-SNAPSHOT  SKIPPED
> [INFO] 
> 
> [INFO] BUILD FAILURE
> [INFO] 
> 
> [INFO] Total time: 27.391 s
> [INFO] Finished at: 2018-06-01T13:55:54-07:00
> [INFO] 
> 
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-shade-plugin:2.1:shade (default) on project 
> avatica-standalone-server: Error creating shaded jar: Error in ASM processing 
> class com/google/common/cache/LocalCache$EntrySet.class: 52264 -> [Help 
> 1]{noformat}
>  
> The error occurs on all JDK versions, and Guava versions 21.0, 22.0 and 23.0. 
> Avatica builds fine on Guava version 14.0 through 20.0.



--
This message was sent by Atlassian JIRA

[jira] [Commented] (CALCITE-2351) MongoDB integration test failures

2018-06-02 Thread Michael Mior (JIRA)


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

Michael Mior commented on CALCITE-2351:
---

Ah, my mistake. I didn't look carefully and I was thinking it was an equality 
predicate. In any case, assigned this to you. Thanks!

> MongoDB integration test failures 
> --
>
> Key: CALCITE-2351
> URL: https://issues.apache.org/jira/browse/CALCITE-2351
> Project: Calcite
>  Issue Type: Bug
>  Components: mongodb
>Reporter: Igor Kryvenko
>Assignee: Igor Kryvenko
>Priority: Major
>
> {{MongoAdapterIT#testFilterReversed}} fails with command
> {code}
> mvn clean test -Dtest=MongoAdapterIT#testFilterReversed
> {code}
> *Output:*
> {code}
> Expected: is "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=ATHENS\n"
>  but: was "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=HERNDON\n"
> at 
> org.apache.calcite.test.MongoAdapterIT.testFilterReversed(MongoAdapterIT.java:712)
> {code}
> *{{sqlline}} output:*
> {code}
> 0: jdbc:calcite:model=mongodb/target/test-cla> select state, city from zips 
> where 'WI' < state LIMIT 2;
> 2018-06-02 16:58:07,546 [main] INFO  - Opened connection 
> [connectionId{localValue:2, serverValue:353}] to localhost:27017
> +---+--+
> | STATE | CITY |
> +---+--+
> | WV| BLUEWELL |
> | WV| HERNDON  |
> +---+--+
> 2 rows selected (0.759 seconds)
> {code}
> *Mongo shell:*
> {code}
> > db.zips.find({"state": { $gt :'WI'}}).limit(2);
> { "_id" : "24701", "city" : "BLUEWELL", "loc" : [ -81.229023, 37.279788 ], 
> "pop" : 22561, "state" : "WV" }
> { "_id" : "24726", "city" : "HERNDON", "loc" : [ -81.346777, 37.526431 ], 
> "pop" : 2220, "state" : "WV" }
> {code}



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


[jira] [Assigned] (CALCITE-2351) MongoDB integration test failures

2018-06-02 Thread Michael Mior (JIRA)


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

Michael Mior reassigned CALCITE-2351:
-

Assignee: Igor Kryvenko  (was: Julian Hyde)

> MongoDB integration test failures 
> --
>
> Key: CALCITE-2351
> URL: https://issues.apache.org/jira/browse/CALCITE-2351
> Project: Calcite
>  Issue Type: Bug
>  Components: mongodb
>Reporter: Igor Kryvenko
>Assignee: Igor Kryvenko
>Priority: Major
>
> {{MongoAdapterIT#testFilterReversed}} fails with command
> {code}
> mvn clean test -Dtest=MongoAdapterIT#testFilterReversed
> {code}
> *Output:*
> {code}
> Expected: is "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=ATHENS\n"
>  but: was "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=HERNDON\n"
> at 
> org.apache.calcite.test.MongoAdapterIT.testFilterReversed(MongoAdapterIT.java:712)
> {code}
> *{{sqlline}} output:*
> {code}
> 0: jdbc:calcite:model=mongodb/target/test-cla> select state, city from zips 
> where 'WI' < state LIMIT 2;
> 2018-06-02 16:58:07,546 [main] INFO  - Opened connection 
> [connectionId{localValue:2, serverValue:353}] to localhost:27017
> +---+--+
> | STATE | CITY |
> +---+--+
> | WV| BLUEWELL |
> | WV| HERNDON  |
> +---+--+
> 2 rows selected (0.759 seconds)
> {code}
> *Mongo shell:*
> {code}
> > db.zips.find({"state": { $gt :'WI'}}).limit(2);
> { "_id" : "24701", "city" : "BLUEWELL", "loc" : [ -81.229023, 37.279788 ], 
> "pop" : 22561, "state" : "WV" }
> { "_id" : "24726", "city" : "HERNDON", "loc" : [ -81.346777, 37.526431 ], 
> "pop" : 2220, "state" : "WV" }
> {code}



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


[jira] [Commented] (CALCITE-2351) MongoDB integration test failures

2018-06-02 Thread Igor Kryvenko (JIRA)


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

Igor Kryvenko commented on CALCITE-2351:


[~michaelmior] Can I assign this JIRA to me to further investigation?
Thanks, Igor.

> MongoDB integration test failures 
> --
>
> Key: CALCITE-2351
> URL: https://issues.apache.org/jira/browse/CALCITE-2351
> Project: Calcite
>  Issue Type: Bug
>  Components: mongodb
>Reporter: Igor Kryvenko
>Assignee: Julian Hyde
>Priority: Major
>
> {{MongoAdapterIT#testFilterReversed}} fails with command
> {code}
> mvn clean test -Dtest=MongoAdapterIT#testFilterReversed
> {code}
> *Output:*
> {code}
> Expected: is "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=ATHENS\n"
>  but: was "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=HERNDON\n"
> at 
> org.apache.calcite.test.MongoAdapterIT.testFilterReversed(MongoAdapterIT.java:712)
> {code}
> *{{sqlline}} output:*
> {code}
> 0: jdbc:calcite:model=mongodb/target/test-cla> select state, city from zips 
> where 'WI' < state LIMIT 2;
> 2018-06-02 16:58:07,546 [main] INFO  - Opened connection 
> [connectionId{localValue:2, serverValue:353}] to localhost:27017
> +---+--+
> | STATE | CITY |
> +---+--+
> | WV| BLUEWELL |
> | WV| HERNDON  |
> +---+--+
> 2 rows selected (0.759 seconds)
> {code}
> *Mongo shell:*
> {code}
> > db.zips.find({"state": { $gt :'WI'}}).limit(2);
> { "_id" : "24701", "city" : "BLUEWELL", "loc" : [ -81.229023, 37.279788 ], 
> "pop" : 22561, "state" : "WV" }
> { "_id" : "24726", "city" : "HERNDON", "loc" : [ -81.346777, 37.526431 ], 
> "pop" : 2220, "state" : "WV" }
> {code}



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


[jira] [Commented] (CALCITE-2351) MongoDB integration test failures

2018-06-02 Thread Igor Kryvenko (JIRA)


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

Igor Kryvenko commented on CALCITE-2351:


Test data doesn't seem as outdated, maybe there is some problem in mongodb 
module.

> MongoDB integration test failures 
> --
>
> Key: CALCITE-2351
> URL: https://issues.apache.org/jira/browse/CALCITE-2351
> Project: Calcite
>  Issue Type: Bug
>  Components: mongodb
>Reporter: Igor Kryvenko
>Assignee: Julian Hyde
>Priority: Major
>
> {{MongoAdapterIT#testFilterReversed}} fails with command
> {code}
> mvn clean test -Dtest=MongoAdapterIT#testFilterReversed
> {code}
> *Output:*
> {code}
> Expected: is "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=ATHENS\n"
>  but: was "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=HERNDON\n"
> at 
> org.apache.calcite.test.MongoAdapterIT.testFilterReversed(MongoAdapterIT.java:712)
> {code}
> *{{sqlline}} output:*
> {code}
> 0: jdbc:calcite:model=mongodb/target/test-cla> select state, city from zips 
> where 'WI' < state LIMIT 2;
> 2018-06-02 16:58:07,546 [main] INFO  - Opened connection 
> [connectionId{localValue:2, serverValue:353}] to localhost:27017
> +---+--+
> | STATE | CITY |
> +---+--+
> | WV| BLUEWELL |
> | WV| HERNDON  |
> +---+--+
> 2 rows selected (0.759 seconds)
> {code}
> *Mongo shell:*
> {code}
> > db.zips.find({"state": { $gt :'WI'}}).limit(2);
> { "_id" : "24701", "city" : "BLUEWELL", "loc" : [ -81.229023, 37.279788 ], 
> "pop" : 22561, "state" : "WV" }
> { "_id" : "24726", "city" : "HERNDON", "loc" : [ -81.346777, 37.526431 ], 
> "pop" : 2220, "state" : "WV" }
> {code}



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


[jira] [Commented] (CALCITE-759) Add DayOfWeek and other missing date/time functions

2018-06-02 Thread Sergey Nuyanzin (JIRA)


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

Sergey Nuyanzin commented on CALCITE-759:
-

Ok,  I see
 there is the initial attempt to do such review (I do not include functions 
which already present in master's calcite/avatica).

based on 
[MySQL|https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html], 
[SQL 
Server|https://docs.microsoft.com/en-us/sql/t-sql/functions/date-and-time-data-types-and-functions-transact-sql?view=sql-server-2017],
 
[Oracle|https://docs.oracle.com/database/121/NLSPG/ch4datetime.htm#GUID-429C290A-C201-4272-A369-FF8F4F8E54F7]
 and 
[PostgreSQL|https://www.postgresql.org/docs/9.1/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT]
I am not sure that this this the final list however please let me know if I am 
on the right way or not. Also is yes I could take participant at least in part 
of its implementation however IMHO it would be nice to divide it on some 
subtasks and answer which are more important and which are less
||Name||Microsoft SQL Server||MySQL||Oracle||PostgreSQL||Comment||
|AGE| | | |+|age(timestamp, timestamp) Subtract arguments, producing a 
"symbolic" result that uses years and months{code:java}
age(timestamp '2001-04-10', timestamp '1957-06-13') 43 years 9 mons 27 
days{code}
age(timestamp) Subtract from current_date (at midnight){code:java}
age(timestamp '1957-06-13') 43 years 8 mons 3 days{code}|
|DATEADD|+| | | |DATEADD (datepart , number , date ) Returns a new datetime 
value by adding an interval to the specified datepart of the specified date. 
The data type of the date argument|
|DATEFROMPARTS|+| | | |DATEFROMPARTS ( year, month, day ) Returns a date value 
for the specified year, month, and day.|
|DATETIME2FROMPARTS|+| | | |DATETIME2FROMPARTS ( year, month, day, hour, 
minute, seconds, fractions, precision) Returns a datetime2 value for the 
specified date and time, with the specified precision.|
|DATETIMEFROMPARTS|+| | | |DATETIMEFROMPARTS ( year, month, day, hour, minute, 
seconds, milliseconds) Returns a datetime value for the specified date and 
time.|
|DATETIMEOFFSETFROMPARTS|+| | | |DATETIMEOFFSETFROMPARTS ( year, month, day, 
hour, minute, seconds, fractions, hour_offset, minute_offset, precision) 
Returns a datetimeoffset value for the specified date and time, with the 
specified offsets and precision.|
|DATEPART|+| | |+|could be done as synonym for extract based on PostrgreSQL|
|DAY|+|+| | |could be done as synonym for DAYOFMONTH based on MySQL docs|
|DATE_TRUNC| | | |+|Truncate to specified precision; see also Section 
9.9.2{code:java}
date_trunc('hour', timestamp '2001-02-16 20:38:40') 2001-02-16 
20:00:00{code}|
|DATE| |+| | |Extract the date part of a date or datetime expression|
|DATEDIFF|+| | | |Returns the number of date or time datepart boundaries, 
crossed between two specified dates. Returns int|
|DATEDIFF_BIG|+| | | |Returns the number of date or time datepart boundaries, 
crossed between two specified dates. Returns bigint|
|DATE_SUB| |+| | |Subtract a time value (interval) from a date|
|DATEDIFF| |+| | |Subtract two dates|
|TIMEDIFF| |+| | |Subtract time|
|TIMESTAMPDIFF| |+| | |Subtract an interval from a datetime expression|
|PERIOD_DIFF| |+| | |Return the number of months between periods|
|SUBDATE| |+| | |Synonym for DATE_SUB() when invoked with three arguments|
|SUBTIME| |+| | |Subtract times|
|EOMONTH|+| | | |EOMONTH ( start_date [, month_to_add ] ) Returns the last day 
of the month containing the specified date, with an optional offset. Return 
type is the type of the start_date argument, or alternately, the date data type|
|LAST_DAY| |+|+| |Returns the last day of the month that contains date|
|NEXT_DAY| | |+| |Returns the date of the first weekday named by char that is 
later than date|
|MICROSECOND| |+| | |Return the microseconds from argument|
|MONTHNAME| |+| | |Return the name of the month|
|TIME| |+| | |Extract the time portion of the expression passed|
|SEC_TO_TIME| |+| | |Converts seconds to 'HH:MM:SS' format|
|MAKEDATE| |+| | |Create a date from the year and day of year|
|MAKETIME| |+| | |Create time from hour, minute, second|
|FROM_DAYS| |+| | |Convert a day number to a date|
|FROM_UNIXTIME| |+| | |Format Unix timestamp as a date|
|NUMTODSINTERVAL| | |+| |Converts number n to an INTERVAL DAY TO SECOND literal|
|NUMTOYMINTERVAL| | |+| |Converts number n to an INTERVAL YEAR TO MONTH literal|
|ROUND| | |+| |Returns date rounded to the unit specified by the fmt format 
model|
|TRUNC| | |+| |Returns date with the time portion of the day truncated to the 
unit specified by the fmt format model|
|JUSTIFY_DAYS| | | |+|Adjust interval so 30-day time periods are represented as 
months{code:java}
justify_days(interval '35 days')1 mon 5 days{code}|
|JUSTIFY_HOURS| | | |+|Adjust interval so 24-hour time periods are represented 
as 

[jira] [Commented] (CALCITE-2351) MongoDB integration test failures

2018-06-02 Thread Igor Kryvenko (JIRA)


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

Igor Kryvenko commented on CALCITE-2351:


But, there is also row with {{STATE=WV; CITY=ATHENS}}, 
{code}
db.zips.find({"city": "ATHENS", "state": 'WV' }).limit(2);
{ "_id" : "24712", "city" : "ATHENS", "loc" : [ -80.997362, 37.432298 ], "pop" 
: 2863, "state" : "WV" }

{code}

> MongoDB integration test failures 
> --
>
> Key: CALCITE-2351
> URL: https://issues.apache.org/jira/browse/CALCITE-2351
> Project: Calcite
>  Issue Type: Bug
>  Components: mongodb
>Reporter: Igor Kryvenko
>Assignee: Julian Hyde
>Priority: Major
>
> {{MongoAdapterIT#testFilterReversed}} fails with command
> {code}
> mvn clean test -Dtest=MongoAdapterIT#testFilterReversed
> {code}
> *Output:*
> {code}
> Expected: is "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=ATHENS\n"
>  but: was "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=HERNDON\n"
> at 
> org.apache.calcite.test.MongoAdapterIT.testFilterReversed(MongoAdapterIT.java:712)
> {code}
> *{{sqlline}} output:*
> {code}
> 0: jdbc:calcite:model=mongodb/target/test-cla> select state, city from zips 
> where 'WI' < state LIMIT 2;
> 2018-06-02 16:58:07,546 [main] INFO  - Opened connection 
> [connectionId{localValue:2, serverValue:353}] to localhost:27017
> +---+--+
> | STATE | CITY |
> +---+--+
> | WV| BLUEWELL |
> | WV| HERNDON  |
> +---+--+
> 2 rows selected (0.759 seconds)
> {code}
> *Mongo shell:*
> {code}
> > db.zips.find({"state": { $gt :'WI'}}).limit(2);
> { "_id" : "24701", "city" : "BLUEWELL", "loc" : [ -81.229023, 37.279788 ], 
> "pop" : 22561, "state" : "WV" }
> { "_id" : "24726", "city" : "HERNDON", "loc" : [ -81.346777, 37.526431 ], 
> "pop" : 2220, "state" : "WV" }
> {code}



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


[jira] [Commented] (CALCITE-2351) MongoDB integration test failures

2018-06-02 Thread Igor Kryvenko (JIRA)


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

Igor Kryvenko commented on CALCITE-2351:


[~michaelmior] Code from test
{code}
CalciteAssert.that()
.enable(enabled())
.with(ZIPS)
.query("select state, city from zips where 'WI' < state")
.limit(2)
.returns("STATE=WV; CITY=BLUEWELL\n"
+ "STATE=WV; CITY=ATHENS\n");
{code}

> MongoDB integration test failures 
> --
>
> Key: CALCITE-2351
> URL: https://issues.apache.org/jira/browse/CALCITE-2351
> Project: Calcite
>  Issue Type: Bug
>  Components: mongodb
>Reporter: Igor Kryvenko
>Assignee: Julian Hyde
>Priority: Major
>
> {{MongoAdapterIT#testFilterReversed}} fails with command
> {code}
> mvn clean test -Dtest=MongoAdapterIT#testFilterReversed
> {code}
> *Output:*
> {code}
> Expected: is "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=ATHENS\n"
>  but: was "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=HERNDON\n"
> at 
> org.apache.calcite.test.MongoAdapterIT.testFilterReversed(MongoAdapterIT.java:712)
> {code}
> *{{sqlline}} output:*
> {code}
> 0: jdbc:calcite:model=mongodb/target/test-cla> select state, city from zips 
> where 'WI' < state LIMIT 2;
> 2018-06-02 16:58:07,546 [main] INFO  - Opened connection 
> [connectionId{localValue:2, serverValue:353}] to localhost:27017
> +---+--+
> | STATE | CITY |
> +---+--+
> | WV| BLUEWELL |
> | WV| HERNDON  |
> +---+--+
> 2 rows selected (0.759 seconds)
> {code}
> *Mongo shell:*
> {code}
> > db.zips.find({"state": { $gt :'WI'}}).limit(2);
> { "_id" : "24701", "city" : "BLUEWELL", "loc" : [ -81.229023, 37.279788 ], 
> "pop" : 22561, "state" : "WV" }
> { "_id" : "24726", "city" : "HERNDON", "loc" : [ -81.346777, 37.526431 ], 
> "pop" : 2220, "state" : "WV" }
> {code}



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


[jira] [Commented] (CALCITE-2351) MongoDB integration test failures

2018-06-02 Thread Michael Mior (JIRA)


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

Michael Mior commented on CALCITE-2351:
---

[~ikryvenko], did your query really have WI in the where clause? I see this 
both in sqlline and the Mongo shell but the query is returning records with the 
state WV.

> MongoDB integration test failures 
> --
>
> Key: CALCITE-2351
> URL: https://issues.apache.org/jira/browse/CALCITE-2351
> Project: Calcite
>  Issue Type: Bug
>  Components: mongodb
>Reporter: Igor Kryvenko
>Assignee: Julian Hyde
>Priority: Major
>
> {{MongoAdapterIT#testFilterReversed}} fails with command
> {code}
> mvn clean test -Dtest=MongoAdapterIT#testFilterReversed
> {code}
> *Output:*
> {code}
> Expected: is "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=ATHENS\n"
>  but: was "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=HERNDON\n"
> at 
> org.apache.calcite.test.MongoAdapterIT.testFilterReversed(MongoAdapterIT.java:712)
> {code}
> *{{sqlline}} output:*
> {code}
> 0: jdbc:calcite:model=mongodb/target/test-cla> select state, city from zips 
> where 'WI' < state LIMIT 2;
> 2018-06-02 16:58:07,546 [main] INFO  - Opened connection 
> [connectionId{localValue:2, serverValue:353}] to localhost:27017
> +---+--+
> | STATE | CITY |
> +---+--+
> | WV| BLUEWELL |
> | WV| HERNDON  |
> +---+--+
> 2 rows selected (0.759 seconds)
> {code}
> *Mongo shell:*
> {code}
> > db.zips.find({"state": { $gt :'WI'}}).limit(2);
> { "_id" : "24701", "city" : "BLUEWELL", "loc" : [ -81.229023, 37.279788 ], 
> "pop" : 22561, "state" : "WV" }
> { "_id" : "24726", "city" : "HERNDON", "loc" : [ -81.346777, 37.526431 ], 
> "pop" : 2220, "state" : "WV" }
> {code}



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


[jira] [Created] (CALCITE-2351) MongoDB integration test failures

2018-06-02 Thread Igor Kryvenko (JIRA)
Igor Kryvenko created CALCITE-2351:
--

 Summary: MongoDB integration test failures 
 Key: CALCITE-2351
 URL: https://issues.apache.org/jira/browse/CALCITE-2351
 Project: Calcite
  Issue Type: Bug
  Components: mongodb
Reporter: Igor Kryvenko
Assignee: Julian Hyde


{{MongoAdapterIT#testFilterReversed}} fails with command
{code}
mvn clean test -Dtest=MongoAdapterIT#testFilterReversed
{code}
*Output:*
{code}
Expected: is "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=ATHENS\n"
 but: was "STATE=WV; CITY=BLUEWELL\nSTATE=WV; CITY=HERNDON\n"
at 
org.apache.calcite.test.MongoAdapterIT.testFilterReversed(MongoAdapterIT.java:712)
{code}
*{{sqlline}} output:*

{code}
0: jdbc:calcite:model=mongodb/target/test-cla> select state, city from zips 
where 'WI' < state LIMIT 2;
2018-06-02 16:58:07,546 [main] INFO  - Opened connection 
[connectionId{localValue:2, serverValue:353}] to localhost:27017
+---+--+
| STATE | CITY |
+---+--+
| WV| BLUEWELL |
| WV| HERNDON  |
+---+--+
2 rows selected (0.759 seconds)

{code}


*Mongo shell:*
{code}
> db.zips.find({"state": { $gt :'WI'}}).limit(2);
{ "_id" : "24701", "city" : "BLUEWELL", "loc" : [ -81.229023, 37.279788 ], 
"pop" : 22561, "state" : "WV" }
{ "_id" : "24726", "city" : "HERNDON", "loc" : [ -81.346777, 37.526431 ], "pop" 
: 2220, "state" : "WV" }
{code}



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


[jira] [Commented] (CALCITE-2349) Failed to build RexCall with SqlDatetimeSubtractionOperator

2018-06-02 Thread yuqi (JIRA)


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

yuqi commented on CALCITE-2349:
---

[~julianhyde]
I'am a little confused, DateTime is not a type in calcite, but a type set, 
SqlTypeName do not contains type of DateTime


{code:java}
  public static final List DATETIME_TYPES =
  ImmutableList.of(DATE, TIME, TIME_WITH_LOCAL_TIME_ZONE,
  TIMESTAMP, TIMESTAMP_WITH_LOCAL_TIME_ZONE);
{code}

So, i can't understand why you say it only accept datetime. 

More about it,  I wonder why calcite can pass that sql, as you know field 
time_d is a timestamp 
 !screenshot-1.png! 

Value of $2 is a timestamp, if i do make call the RexBuilder.makeCall(),  the 
function will goes well.




> Failed to build RexCall with SqlDatetimeSubtractionOperator
> ---
>
> Key: CALCITE-2349
> URL: https://issues.apache.org/jira/browse/CALCITE-2349
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.16.0
>Reporter: yuqi
>Assignee: Julian Hyde
>Priority: Minor
> Fix For: 1.17.0
>
> Attachments: 1.png, screenshot-1.png
>
>
> When use RexBuilder to build RexCall with SqlDatetimeSubtractionOperator, it 
> will throw exception.
> {code:java}
> java.lang.IndexOutOfBoundsException: index (2) must be less than size (2)
>   at 
> com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:310)
>   at 
> com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:293)
>   at 
> com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:67)
>   at 
> org.apache.calcite.rex.RexCallBinding.getOperandType(RexCallBinding.java:132)
>   at 
> org.apache.calcite.sql.type.OrdinalReturnTypeInference.inferReturnType(OrdinalReturnTypeInference.java:40)
>   at 
> org.apache.calcite.sql.type.SqlTypeTransformCascade.inferReturnType(SqlTypeTransformCascade.java:54)
>   at 
> org.apache.calcite.sql.SqlOperator.inferReturnType(SqlOperator.java:470)
>   at 
> org.apache.calcite.rex.RexBuilder.deriveReturnType(RexBuilder.java:274)
>   at org.apache.calcite.rex.RexBuilder.makeCall(RexBuilder.java:248)
>   at com.netease.yuqi.calcatetest.TestThree.main(TestThree.java:100)
> {code}
> Below is My code:
> {code:java}
> public static void main(String[] args) {
>   try {
>   SchemaPlus rootSchema = 
> Frameworks.createRootSchema(true);
>   rootSchema.add("USERS", new AbstractTable() {
>   public RelDataType getRowType(final 
> RelDataTypeFactory typeFactory) {
>   RelDataTypeFactory.FieldInfoBuilder 
> builder = typeFactory.builder();
>   builder.add("ID", new BasicSqlType(new 
> RelDataTypeSystemImpl() {
>   }, SqlTypeName.INTEGER));
>   builder.add("NAME", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.CHAR));
>   builder.add("TIME_D", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.TIMESTAMP));
>   return builder.build();
>   }
>   });
>   rootSchema.add("TABLE_RESULT", new AbstractTable() {
>   public RelDataType getRowType(final 
> RelDataTypeFactory typeFactory) {
>   RelDataTypeFactory.FieldInfoBuilder 
> builder = typeFactory.builder();
>   builder.add("ID", new BasicSqlType(new 
> RelDataTypeSystemImpl() {
>   }, SqlTypeName.INTEGER));
>   builder.add("NAME", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.CHAR));
>   builder.add("SCORE", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.INTEGER));
>   return builder.build();
>   }
>   });
>   final FrameworkConfig config = 
> Frameworks.newConfigBuilder()
>   .parserConfig(SqlParser.Config.DEFAULT)
>   .defaultSchema(rootSchema)
>   .build();
>   Planner planner = Frameworks.getPlanner(config);
>   SqlNode parse1 = planner.parse("insert into 
> 

[jira] [Updated] (CALCITE-2349) Failed to build RexCall with SqlDatetimeSubtractionOperator

2018-06-02 Thread yuqi (JIRA)


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

yuqi updated CALCITE-2349:
--
Attachment: screenshot-1.png

> Failed to build RexCall with SqlDatetimeSubtractionOperator
> ---
>
> Key: CALCITE-2349
> URL: https://issues.apache.org/jira/browse/CALCITE-2349
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.16.0
>Reporter: yuqi
>Assignee: Julian Hyde
>Priority: Minor
> Fix For: 1.17.0
>
> Attachments: 1.png, screenshot-1.png
>
>
> When use RexBuilder to build RexCall with SqlDatetimeSubtractionOperator, it 
> will throw exception.
> {code:java}
> java.lang.IndexOutOfBoundsException: index (2) must be less than size (2)
>   at 
> com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:310)
>   at 
> com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:293)
>   at 
> com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:67)
>   at 
> org.apache.calcite.rex.RexCallBinding.getOperandType(RexCallBinding.java:132)
>   at 
> org.apache.calcite.sql.type.OrdinalReturnTypeInference.inferReturnType(OrdinalReturnTypeInference.java:40)
>   at 
> org.apache.calcite.sql.type.SqlTypeTransformCascade.inferReturnType(SqlTypeTransformCascade.java:54)
>   at 
> org.apache.calcite.sql.SqlOperator.inferReturnType(SqlOperator.java:470)
>   at 
> org.apache.calcite.rex.RexBuilder.deriveReturnType(RexBuilder.java:274)
>   at org.apache.calcite.rex.RexBuilder.makeCall(RexBuilder.java:248)
>   at com.netease.yuqi.calcatetest.TestThree.main(TestThree.java:100)
> {code}
> Below is My code:
> {code:java}
> public static void main(String[] args) {
>   try {
>   SchemaPlus rootSchema = 
> Frameworks.createRootSchema(true);
>   rootSchema.add("USERS", new AbstractTable() {
>   public RelDataType getRowType(final 
> RelDataTypeFactory typeFactory) {
>   RelDataTypeFactory.FieldInfoBuilder 
> builder = typeFactory.builder();
>   builder.add("ID", new BasicSqlType(new 
> RelDataTypeSystemImpl() {
>   }, SqlTypeName.INTEGER));
>   builder.add("NAME", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.CHAR));
>   builder.add("TIME_D", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.TIMESTAMP));
>   return builder.build();
>   }
>   });
>   rootSchema.add("TABLE_RESULT", new AbstractTable() {
>   public RelDataType getRowType(final 
> RelDataTypeFactory typeFactory) {
>   RelDataTypeFactory.FieldInfoBuilder 
> builder = typeFactory.builder();
>   builder.add("ID", new BasicSqlType(new 
> RelDataTypeSystemImpl() {
>   }, SqlTypeName.INTEGER));
>   builder.add("NAME", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.CHAR));
>   builder.add("SCORE", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.INTEGER));
>   return builder.build();
>   }
>   });
>   final FrameworkConfig config = 
> Frameworks.newConfigBuilder()
>   .parserConfig(SqlParser.Config.DEFAULT)
>   .defaultSchema(rootSchema)
>   .build();
>   Planner planner = Frameworks.getPlanner(config);
>   SqlNode parse1 = planner.parse("insert into 
> table_result(id, name, score) select a.id as id, a.name as name, 1 from users 
> a where month(a.time_d - interval '30' day) >= 2");
>   SqlNode validate = planner.validate(parse1);
>   RelRoot root = planner.rel(validate);
>   RexBuilder builder1 = 
> root.rel.getCluster().getRexBuilder();
>   LogicalFilter filter = (LogicalFilter) 
> root.rel.getInput(0).getInput(0);
> //get RexCall of SqlDatetimeSubtractionOperator
>   RexCall call = (RexCall) ((RexCall) ((RexCall) 
> 

[jira] [Commented] (CALCITE-1160) Avatica javadoc

2018-06-02 Thread Francis Chuang (JIRA)


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

Francis Chuang commented on CALCITE-1160:
-

Added avatica-1.12.0 as a fixed version because [~risdenk] added a few fixes 
related to this issue after the 1.11.0 release.

> Avatica javadoc
> ---
>
> Key: CALCITE-1160
> URL: https://issues.apache.org/jira/browse/CALCITE-1160
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica, site
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
> Fix For: avatica-1.11.0, avatica-1.12.0
>
>
> Figure out how we want to publish Avatica javadoc.
> Right now the javadoc points to the javadoc that was generated in the 
> previous calcite release. When I generate javadoc for calcite 1.7 the 
> contents will no longer include avatica packages. The javadoc for each 
> package will still be there in the web site until I explicitly delete it.
> * Should http://calcite.apache.org/avatica/docs/ have "api" and "test api" 
> links?
> * Should avatica javadoc be separate from calcite javadoc?
> * Make calcite javadoc reference avatica javadoc (i.e. uses of avatica 
> classes should be hyperlinks)
> * Document a process to re-generate avatica javadoc as part of an avatica 
> release



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


[jira] [Resolved] (CALCITE-1160) Avatica javadoc

2018-06-02 Thread Francis Chuang (JIRA)


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

Francis Chuang resolved CALCITE-1160.
-
Resolution: Fixed

> Avatica javadoc
> ---
>
> Key: CALCITE-1160
> URL: https://issues.apache.org/jira/browse/CALCITE-1160
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica, site
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
> Fix For: avatica-1.12.0, avatica-1.11.0
>
>
> Figure out how we want to publish Avatica javadoc.
> Right now the javadoc points to the javadoc that was generated in the 
> previous calcite release. When I generate javadoc for calcite 1.7 the 
> contents will no longer include avatica packages. The javadoc for each 
> package will still be there in the web site until I explicitly delete it.
> * Should http://calcite.apache.org/avatica/docs/ have "api" and "test api" 
> links?
> * Should avatica javadoc be separate from calcite javadoc?
> * Make calcite javadoc reference avatica javadoc (i.e. uses of avatica 
> classes should be hyperlinks)
> * Document a process to re-generate avatica javadoc as part of an avatica 
> release



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


[jira] [Updated] (CALCITE-1160) Avatica javadoc

2018-06-02 Thread Francis Chuang (JIRA)


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

Francis Chuang updated CALCITE-1160:

Fix Version/s: avatica-1.12.0

> Avatica javadoc
> ---
>
> Key: CALCITE-1160
> URL: https://issues.apache.org/jira/browse/CALCITE-1160
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica, site
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
> Fix For: avatica-1.11.0, avatica-1.12.0
>
>
> Figure out how we want to publish Avatica javadoc.
> Right now the javadoc points to the javadoc that was generated in the 
> previous calcite release. When I generate javadoc for calcite 1.7 the 
> contents will no longer include avatica packages. The javadoc for each 
> package will still be there in the web site until I explicitly delete it.
> * Should http://calcite.apache.org/avatica/docs/ have "api" and "test api" 
> links?
> * Should avatica javadoc be separate from calcite javadoc?
> * Make calcite javadoc reference avatica javadoc (i.e. uses of avatica 
> classes should be hyperlinks)
> * Document a process to re-generate avatica javadoc as part of an avatica 
> release



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


[jira] [Reopened] (CALCITE-1160) Avatica javadoc

2018-06-02 Thread Francis Chuang (JIRA)


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

Francis Chuang reopened CALCITE-1160:
-

> Avatica javadoc
> ---
>
> Key: CALCITE-1160
> URL: https://issues.apache.org/jira/browse/CALCITE-1160
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica, site
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
> Fix For: avatica-1.11.0
>
>
> Figure out how we want to publish Avatica javadoc.
> Right now the javadoc points to the javadoc that was generated in the 
> previous calcite release. When I generate javadoc for calcite 1.7 the 
> contents will no longer include avatica packages. The javadoc for each 
> package will still be there in the web site until I explicitly delete it.
> * Should http://calcite.apache.org/avatica/docs/ have "api" and "test api" 
> links?
> * Should avatica javadoc be separate from calcite javadoc?
> * Make calcite javadoc reference avatica javadoc (i.e. uses of avatica 
> classes should be hyperlinks)
> * Document a process to re-generate avatica javadoc as part of an avatica 
> release



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


[jira] [Updated] (CALCITE-1937) Web site for Avatica Go

2018-06-02 Thread Francis Chuang (JIRA)


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

Francis Chuang updated CALCITE-1937:

Fix Version/s: avatica-1.12.0

> Web site for Avatica Go
> ---
>
> Key: CALCITE-1937
> URL: https://issues.apache.org/jira/browse/CALCITE-1937
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica-go
>Reporter: Julian Hyde
>Assignee: Francis Chuang
>Priority: Major
> Fix For: avatica-1.12.0
>
>
> Create a web site for calcite-avatica-go.
> How about this:
> * At run time, the pages should appear under http://calcite.apache.org/avatica
> * The pages should be source-controlled under calcite-avatica-go/site, in 
> markdown format (same as calcite and avatica), and generated into svn using 
> similar trickery to calcite and avatica.
> * Reduce the amount of content in 
> https://github.com/apache/calcite-avatica-go/blob/master/README.md. The 
> "documentation" stuff should move to under http://calcite.apache.org/avatica. 
> So the page will be mainly a re-direct to the Apache home page. Similar to 
> https://github.com/apache/calcite-avatica/blob/master/README.md, in fact.
> * Add a go_history.md file.
> Should avatica-go appear on http://calcite.apache.org/avatica/downloads, or 
> should it have its own download page? I think it probably the former.



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


[jira] [Resolved] (CALCITE-2022) ConnectionConfigImplTest failing on Jenkins

2018-06-02 Thread Francis Chuang (JIRA)


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

Francis Chuang resolved CALCITE-2022.
-
Resolution: Fixed

> ConnectionConfigImplTest failing on Jenkins
> ---
>
> Key: CALCITE-2022
> URL: https://issues.apache.org/jira/browse/CALCITE-2022
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica
>Reporter: Josh Elser
>Assignee: Josh Elser
>Priority: Minor
> Fix For: avatica-1.12.0
>
>
> {noformat}
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec <<< 
> FAILURE! - in org.apache.calcite.avatica.ConnectionConfigImplTest
> testTrustStore(org.apache.calcite.avatica.ConnectionConfigImplTest)  Time 
> elapsed: 0.015 sec  <<< FAILURE!
> java.lang.AssertionError: 
> Expected: is "C:\my\truststore.jks"
>  but: was "F:\my\truststore.jks"
>   at 
> org.apache.calcite.avatica.ConnectionConfigImplTest.testTrustStore(ConnectionConfigImplTest.java:41)
> {noformat}
> Looks like a pretty simple test failure on Windows that Jenkins caught for us.



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


[jira] [Updated] (CALCITE-2333) Stop releasing ZIPs

2018-06-02 Thread Francis Chuang (JIRA)


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

Francis Chuang updated CALCITE-2333:

Fix Version/s: 1.12.0

> Stop releasing ZIPs
> ---
>
> Key: CALCITE-2333
> URL: https://issues.apache.org/jira/browse/CALCITE-2333
> Project: Calcite
>  Issue Type: Task
>  Components: avatica, avatica-go, core
>Reporter: Francis Chuang
>Assignee: Francis Chuang
>Priority: Trivial
> Fix For: avatica-1.12.0, 1.17.0
>
>
> There was some discussion on the mailing list regarding releasing our source 
> in just 1 format.
> See 
> [https://mail-archives.apache.org/mod_mbox/calcite-dev/201804.mbox/%3CD60019E6-FC62-4C24-B2F0-5278E51E5626%40apache.org%3E]
> There is some consensus around just releasing a tar.gz. I think this is a 
> good idea and is something we should aim for, for the Calcite 1.17 and 
> Avatica 1.12 releases.
> The following changes will be needed:
>  * Update build script for avatica-go.
>  * Update maven config for avatica.
>  * Update calcite config for calcite.
> We will need to update the website to deal the zip files not existing. My 
> proposal is that we edit the old release posts to include a `has_zip: true` 
> property. For the old releases, the website should render a link to the zip. 
> For the new releases, we do not need to do anything.



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


[jira] [Updated] (CALCITE-2333) Stop releasing ZIPs

2018-06-02 Thread Francis Chuang (JIRA)


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

Francis Chuang updated CALCITE-2333:

Fix Version/s: (was: 1.12.0)
   avatica-1.12.0

> Stop releasing ZIPs
> ---
>
> Key: CALCITE-2333
> URL: https://issues.apache.org/jira/browse/CALCITE-2333
> Project: Calcite
>  Issue Type: Task
>  Components: avatica, avatica-go, core
>Reporter: Francis Chuang
>Assignee: Francis Chuang
>Priority: Trivial
> Fix For: avatica-1.12.0, 1.17.0
>
>
> There was some discussion on the mailing list regarding releasing our source 
> in just 1 format.
> See 
> [https://mail-archives.apache.org/mod_mbox/calcite-dev/201804.mbox/%3CD60019E6-FC62-4C24-B2F0-5278E51E5626%40apache.org%3E]
> There is some consensus around just releasing a tar.gz. I think this is a 
> good idea and is something we should aim for, for the Calcite 1.17 and 
> Avatica 1.12 releases.
> The following changes will be needed:
>  * Update build script for avatica-go.
>  * Update maven config for avatica.
>  * Update calcite config for calcite.
> We will need to update the website to deal the zip files not existing. My 
> proposal is that we edit the old release posts to include a `has_zip: true` 
> property. For the old releases, the website should render a link to the zip. 
> For the new releases, we do not need to do anything.



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


[jira] [Commented] (CALCITE-2349) Failed to build RexCall with SqlDatetimeSubtractionOperator

2018-06-02 Thread Julian Hyde (JIRA)


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

Julian Hyde commented on CALCITE-2349:
--

That operator is only for subtracting a datetime from a datetime.

> Failed to build RexCall with SqlDatetimeSubtractionOperator
> ---
>
> Key: CALCITE-2349
> URL: https://issues.apache.org/jira/browse/CALCITE-2349
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.16.0
>Reporter: yuqi
>Assignee: Julian Hyde
>Priority: Minor
> Fix For: 1.17.0
>
> Attachments: 1.png
>
>
> When use RexBuilder to build RexCall with SqlDatetimeSubtractionOperator, it 
> will throw exception.
> {code:java}
> java.lang.IndexOutOfBoundsException: index (2) must be less than size (2)
>   at 
> com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:310)
>   at 
> com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:293)
>   at 
> com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:67)
>   at 
> org.apache.calcite.rex.RexCallBinding.getOperandType(RexCallBinding.java:132)
>   at 
> org.apache.calcite.sql.type.OrdinalReturnTypeInference.inferReturnType(OrdinalReturnTypeInference.java:40)
>   at 
> org.apache.calcite.sql.type.SqlTypeTransformCascade.inferReturnType(SqlTypeTransformCascade.java:54)
>   at 
> org.apache.calcite.sql.SqlOperator.inferReturnType(SqlOperator.java:470)
>   at 
> org.apache.calcite.rex.RexBuilder.deriveReturnType(RexBuilder.java:274)
>   at org.apache.calcite.rex.RexBuilder.makeCall(RexBuilder.java:248)
>   at com.netease.yuqi.calcatetest.TestThree.main(TestThree.java:100)
> {code}
> Below is My code:
> {code:java}
> public static void main(String[] args) {
>   try {
>   SchemaPlus rootSchema = 
> Frameworks.createRootSchema(true);
>   rootSchema.add("USERS", new AbstractTable() {
>   public RelDataType getRowType(final 
> RelDataTypeFactory typeFactory) {
>   RelDataTypeFactory.FieldInfoBuilder 
> builder = typeFactory.builder();
>   builder.add("ID", new BasicSqlType(new 
> RelDataTypeSystemImpl() {
>   }, SqlTypeName.INTEGER));
>   builder.add("NAME", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.CHAR));
>   builder.add("TIME_D", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.TIMESTAMP));
>   return builder.build();
>   }
>   });
>   rootSchema.add("TABLE_RESULT", new AbstractTable() {
>   public RelDataType getRowType(final 
> RelDataTypeFactory typeFactory) {
>   RelDataTypeFactory.FieldInfoBuilder 
> builder = typeFactory.builder();
>   builder.add("ID", new BasicSqlType(new 
> RelDataTypeSystemImpl() {
>   }, SqlTypeName.INTEGER));
>   builder.add("NAME", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.CHAR));
>   builder.add("SCORE", new 
> BasicSqlType(new RelDataTypeSystemImpl() {
>   }, SqlTypeName.INTEGER));
>   return builder.build();
>   }
>   });
>   final FrameworkConfig config = 
> Frameworks.newConfigBuilder()
>   .parserConfig(SqlParser.Config.DEFAULT)
>   .defaultSchema(rootSchema)
>   .build();
>   Planner planner = Frameworks.getPlanner(config);
>   SqlNode parse1 = planner.parse("insert into 
> table_result(id, name, score) select a.id as id, a.name as name, 1 from users 
> a where month(a.time_d - interval '30' day) >= 2");
>   SqlNode validate = planner.validate(parse1);
>   RelRoot root = planner.rel(validate);
>   RexBuilder builder1 = 
> root.rel.getCluster().getRexBuilder();
>   LogicalFilter filter = (LogicalFilter) 
> root.rel.getInput(0).getInput(0);
> //get RexCall of SqlDatetimeSubtractionOperator
>   

[jira] [Commented] (CALCITE-2350) Cannot shade Avatica with Guava 21.0 or higher

2018-06-02 Thread Julian Hyde (JIRA)


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

Julian Hyde commented on CALCITE-2350:
--

Great detective work, [~Sergey Nuyanzin]. I tried upgrading maven-shade-plugin 
to 3.0.0 (which is the version wherein MSHADE-228 is fixed) and it seems to 
work. I'll now try the latest, 3.1.1, and if that works I'll commit.

> Cannot shade Avatica with Guava 21.0 or higher
> --
>
> Key: CALCITE-2350
> URL: https://issues.apache.org/jira/browse/CALCITE-2350
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica
>Affects Versions: avatica-1.11.0
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
> Fix For: avatica-1.12.0
>
>
> When building Avatica with Guava version 23.0, I run into an error while 
> shading:
> {noformat}
> $ mvn -Dguava.version=23.0 -DskipTests clean package
> [INFO] --- maven-shade-plugin:2.1:shade (default) @ avatica-standalone-server 
> ---
> [INFO] Including org.apache.calcite.avatica:avatica-core:jar:1.12.0-SNAPSHOT 
> in the shaded jar.
> [INFO] Including 
> org.apache.calcite.avatica:avatica-metrics:jar:1.12.0-SNAPSHOT in the shaded 
> jar.
> [INFO] Including com.fasterxml.jackson.core:jackson-core:jar:2.9.4 in the 
> shaded jar.
> [INFO] Including com.fasterxml.jackson.core:jackson-annotations:jar:2.9.4 in 
> the shaded jar.
> [INFO] Including com.fasterxml.jackson.core:jackson-databind:jar:2.9.4 in the 
> shaded jar.
> [INFO] Including com.google.protobuf:protobuf-java:jar:3.3.0 in the shaded 
> jar.
> [INFO] Including org.apache.httpcomponents:httpclient:jar:4.5.2 in the shaded 
> jar.
> [INFO] Including commons-logging:commons-logging:jar:1.2 in the shaded jar.
> [INFO] Including commons-codec:commons-codec:jar:1.9 in the shaded jar.
> [INFO] Including org.apache.httpcomponents:httpcore:jar:4.4.4 in the shaded 
> jar.
> [INFO] Including 
> org.apache.calcite.avatica:avatica-server:jar:1.12.0-SNAPSHOT in the shaded 
> jar.
> [INFO] Including javax.servlet:javax.servlet-api:jar:3.0.1 in the shaded jar.
> [INFO] Including com.google.guava:guava:jar:23.0 in the shaded jar.
> [INFO] Including com.google.code.findbugs:jsr305:jar:1.3.9 in the shaded jar.
> [INFO] Including com.google.errorprone:error_prone_annotations:jar:2.0.18 in 
> the shaded jar.
> [INFO] Including com.google.j2objc:j2objc-annotations:jar:1.1 in the shaded 
> jar.
> [INFO] Including org.codehaus.mojo:animal-sniffer-annotations:jar:1.14 in the 
> shaded jar.
> [INFO] Including org.eclipse.jetty:jetty-http:jar:9.2.19.v20160908 in the 
> shaded jar.
> [INFO] Including org.eclipse.jetty:jetty-security:jar:9.2.19.v20160908 in the 
> shaded jar.
> [INFO] Including org.eclipse.jetty:jetty-server:jar:9.2.19.v20160908 in the 
> shaded jar.
> [INFO] Including org.eclipse.jetty:jetty-io:jar:9.2.19.v20160908 in the 
> shaded jar.
> [INFO] Including org.eclipse.jetty:jetty-util:jar:9.2.19.v20160908 in the 
> shaded jar.
> [INFO] Including com.beust:jcommander:jar:1.48 in the shaded jar.
> [INFO] Including org.slf4j:slf4j-api:jar:1.7.13 in the shaded jar.
> [INFO] Including org.slf4j:slf4j-log4j12:jar:1.7.13 in the shaded jar.
> [INFO] Including log4j:log4j:jar:1.2.17 in the shaded jar.
> [INFO] 
> 
> [INFO] Reactor Summary:
> [INFO] 
> [INFO] Apache Calcite Avatica Project 1.12.0-SNAPSHOT . SUCCESS [ 2.028 s]
> [INFO] Apache Calcite Avatica Metrics . SUCCESS [ 1.900 s]
> [INFO] Apache Calcite Avatica . SUCCESS [ 16.995 
> s]
> [INFO] Apache Calcite Avatica Server .. SUCCESS [ 2.231 s]
> [INFO] Apache Calcite Avatica Standalone Server ... FAILURE [ 3.765 s]
> [INFO] Apache Calcite Avatica Docker images ... SKIPPED
> [INFO] Apache Calcite Avatica Dropwizard Metrics 3  SKIPPED
> [INFO] Apache Calcite Avatica Noop Driver . SKIPPED
> [INFO] Apache Calcite Avatica Compatibility Kit ... SKIPPED
> [INFO] Apache Calcite Avatica (Shaded) 1.12.0-SNAPSHOT  SKIPPED
> [INFO] 
> 
> [INFO] BUILD FAILURE
> [INFO] 
> 
> [INFO] Total time: 27.391 s
> [INFO] Finished at: 2018-06-01T13:55:54-07:00
> [INFO] 
> 
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-shade-plugin:2.1:shade (default) on project 
> avatica-standalone-server: Error creating shaded jar: Error in ASM processing 
> class com/google/common/cache/LocalCache$EntrySet.class: 52264 -> [Help 
> 1]{noformat}
>  
> The error occurs on all JDK versions,