[jira] [Resolved] (CALCITE-2275) Do not push down NOT condition in JOIN

2018-04-25 Thread Julian Hyde (JIRA)

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

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

Fixed in 
[e78f8c61|http://git-wip-us.apache.org/repos/asf/calcite/commit/e78f8c61]; 
thanks for the PR, [~vitalii]!

> Do not push down NOT condition in JOIN
> --
>
> Key: CALCITE-2275
> URL: https://issues.apache.org/jira/browse/CALCITE-2275
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.16.0
>Reporter: Vitalii Diravka
>Assignee: Vitalii Diravka
>Priority: Major
> Fix For: 1.17.0
>
>
> Using logical NOT operator in Join condition leads to mistakenly push down 
> this condition. Then LogicalProject is created with RexCall expression. It 
> prevents for further inferring predicates (by using 
> JoinPushTransitivePredicatesRule, for instance).
> Query example:
> {code:sql}
> select * from sales.emp d join sales.emp e on e.deptno = d.deptno and 
> d.deptno not in (4, 6)
> {code}



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


[jira] [Updated] (CALCITE-2275) Do not push down NOT condition in JOIN

2018-04-25 Thread Julian Hyde (JIRA)

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

Julian Hyde updated CALCITE-2275:
-
Summary: Do not push down NOT condition in JOIN  (was: Using logical NOT 
operator in Join condition leads to mistakenly push down this condition.)

> Do not push down NOT condition in JOIN
> --
>
> Key: CALCITE-2275
> URL: https://issues.apache.org/jira/browse/CALCITE-2275
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.16.0
>Reporter: Vitalii Diravka
>Assignee: Vitalii Diravka
>Priority: Major
> Fix For: 1.17.0
>
>
> Using logical NOT operator in Join condition leads to mistakenly push down 
> this condition. Then LogicalProject is created with RexCall expression. It 
> prevents for further inferring predicates (by using 
> JoinPushTransitivePredicatesRule, for instance).
> Query example:
> {code:sql}
> select * from sales.emp d join sales.emp e on e.deptno = d.deptno and 
> d.deptno not in (4, 6)
> {code}



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


[jira] [Updated] (CALCITE-2264) In JDBC adapter, do not push down a call to a user-defined function (UDF)

2018-04-25 Thread Julian Hyde (JIRA)

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

Julian Hyde updated CALCITE-2264:
-
Component/s: jdbc-adapter

> In JDBC adapter, do not push down a call to a user-defined function (UDF)
> -
>
> Key: CALCITE-2264
> URL: https://issues.apache.org/jira/browse/CALCITE-2264
> Project: Calcite
>  Issue Type: Bug
>  Components: jdbc-adapter
>Reporter: Piotr Bojko
>Assignee: Julian Hyde
>Priority: Major
> Fix For: 1.17.0
>
>
> Considering chinook tests, having following schema:
> {code:json}
>  {
>   "version": "1.0",
>   "defaultSchema": "ENHANCED",
>   "schemas": [
> {
>   "name": "CHINOOK",
>   "type": "jdbc",
>   "jdbcDriver": "org.hsqldb.jdbc.JDBCDriver",
>   "jdbcUrl": "jdbc:hsqldb:res:chinook",
>   "jdbcUser": "sa",
>   "jdbcPassword": ""
> },
> {
>   "name": "ENHANCED",
>   "type": "custom",
>   "factory": "org.apache.calcite.schema.impl.AbstractSchema$Factory",
>   "operand": {},
>   "tables": [
>   ...
> {
>   "name" : "SIMPLE_CUSTOMER",
>   "type" : "view",
>   "sql" : [
> "SELECT c.firstname, c.lastname, c.email ",
> "FROM chinook.customer AS c"
>   ]
> ...
>   ],
>   "functions": [
> {
>   "name": "ASCONCATOFPARAMS",
>   "className": "org.apache.calcite.chinook.StringConcatFunction"
> }
>   ]
> }
>   ]
> {code}
> Following query produces error:
> {code:sql}
> SELECT email, ASCONCATOFPARAMS(firstname, lastname) AS joined FROM 
> SIMPLE_CUSTOMER limit 3
> {code}
> Exception:
> {code}
> > Caused by: java.lang.RuntimeException: while executing SQL [SELECT "EMAIL" 
> > AS "email", "ASCONCATOFPARAMS"("FIRSTNAME", "LASTNAME") AS "joined"
> > FROM (SELECT *
> > FROM "CUSTOMER"
> > LIMIT 3) AS "t"]
> > at 
> > org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:153)
> > at 
> > org.apache.calcite.linq4j.AbstractEnumerable.iterator(AbstractEnumerable.java:33)
> > at org.apache.calcite.avatica.MetaImpl.createCursor(MetaImpl.java:90)
> > at 
> > org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:174)
> > at 
> > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:67)
> > at 
> > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:44)
> > at 
> > org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:630)
> > at 
> > org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:619)
> > at 
> > org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638)
> > at 
> > org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149)
> > ... 24 more
> > Caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object 
> > not found: ASCONCATOFPARAMS
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
> > at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source)
> > at 
> > org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> > at 
> > org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> > at 
> > org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:143)
> > ... 33 more
> > Caused by: org.hsqldb.HsqlException: user lacks privilege or object not 
> > found: ASCONCATOFPARAMS
> > at org.hsqldb.error.Error.error(Unknown Source)
> > at org.hsqldb.error.Error.error(Unknown Source)
> > at org.hsqldb.Routine.getMethods(Unknown Source)
> > at org.hsqldb.Routine.createRoutines(Unknown Source)
> > at org.hsqldb.ParserDQL.readColumnOrFunctionExpression(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSimpleValueExpressionPrimary(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesValueExpressionPrimary(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesPrimary(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesFactor(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesTerm(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesCommonValueExpression(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadValueExpression(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSelect(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadQuerySpecification(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSimpleTable(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadQueryPrimary(Unknown Source)
> >   

[jira] [Resolved] (CALCITE-2264) User defined function in json schema pushed to jdbc subschema.

2018-04-25 Thread Julian Hyde (JIRA)

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

Julian Hyde resolved CALCITE-2264.
--
   Resolution: Fixed
Fix Version/s: 1.17.0

Fixed in 
[b0f47047|http://git-wip-us.apache.org/repos/asf/calcite/commit/b0f47047]; 
thanks for the PR, [~ptrbojko]!

> User defined function in json schema pushed to jdbc subschema.
> --
>
> Key: CALCITE-2264
> URL: https://issues.apache.org/jira/browse/CALCITE-2264
> Project: Calcite
>  Issue Type: Bug
>  Components: jdbc-adapter
>Reporter: Piotr Bojko
>Assignee: Julian Hyde
>Priority: Major
> Fix For: 1.17.0
>
>
> Considering chinook tests, having following schema:
> {code:json}
>  {
>   "version": "1.0",
>   "defaultSchema": "ENHANCED",
>   "schemas": [
> {
>   "name": "CHINOOK",
>   "type": "jdbc",
>   "jdbcDriver": "org.hsqldb.jdbc.JDBCDriver",
>   "jdbcUrl": "jdbc:hsqldb:res:chinook",
>   "jdbcUser": "sa",
>   "jdbcPassword": ""
> },
> {
>   "name": "ENHANCED",
>   "type": "custom",
>   "factory": "org.apache.calcite.schema.impl.AbstractSchema$Factory",
>   "operand": {},
>   "tables": [
>   ...
> {
>   "name" : "SIMPLE_CUSTOMER",
>   "type" : "view",
>   "sql" : [
> "SELECT c.firstname, c.lastname, c.email ",
> "FROM chinook.customer AS c"
>   ]
> ...
>   ],
>   "functions": [
> {
>   "name": "ASCONCATOFPARAMS",
>   "className": "org.apache.calcite.chinook.StringConcatFunction"
> }
>   ]
> }
>   ]
> {code}
> Following query produces error:
> {code:sql}
> SELECT email, ASCONCATOFPARAMS(firstname, lastname) AS joined FROM 
> SIMPLE_CUSTOMER limit 3
> {code}
> Exception:
> {code}
> > Caused by: java.lang.RuntimeException: while executing SQL [SELECT "EMAIL" 
> > AS "email", "ASCONCATOFPARAMS"("FIRSTNAME", "LASTNAME") AS "joined"
> > FROM (SELECT *
> > FROM "CUSTOMER"
> > LIMIT 3) AS "t"]
> > at 
> > org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:153)
> > at 
> > org.apache.calcite.linq4j.AbstractEnumerable.iterator(AbstractEnumerable.java:33)
> > at org.apache.calcite.avatica.MetaImpl.createCursor(MetaImpl.java:90)
> > at 
> > org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:174)
> > at 
> > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:67)
> > at 
> > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:44)
> > at 
> > org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:630)
> > at 
> > org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:619)
> > at 
> > org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638)
> > at 
> > org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149)
> > ... 24 more
> > Caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object 
> > not found: ASCONCATOFPARAMS
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
> > at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source)
> > at 
> > org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> > at 
> > org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> > at 
> > org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:143)
> > ... 33 more
> > Caused by: org.hsqldb.HsqlException: user lacks privilege or object not 
> > found: ASCONCATOFPARAMS
> > at org.hsqldb.error.Error.error(Unknown Source)
> > at org.hsqldb.error.Error.error(Unknown Source)
> > at org.hsqldb.Routine.getMethods(Unknown Source)
> > at org.hsqldb.Routine.createRoutines(Unknown Source)
> > at org.hsqldb.ParserDQL.readColumnOrFunctionExpression(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSimpleValueExpressionPrimary(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesValueExpressionPrimary(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesPrimary(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesFactor(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesTerm(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesCommonValueExpression(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadValueExpression(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSelect(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadQuerySpecification(Unknown Source)
> > at 

[jira] [Updated] (CALCITE-2264) In JDBC adapter, do not push down a call to a user-defined function (UDF)

2018-04-25 Thread Julian Hyde (JIRA)

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

Julian Hyde updated CALCITE-2264:
-
Summary: In JDBC adapter, do not push down a call to a user-defined 
function (UDF)  (was: User defined function in json schema pushed to jdbc 
subschema.)

> In JDBC adapter, do not push down a call to a user-defined function (UDF)
> -
>
> Key: CALCITE-2264
> URL: https://issues.apache.org/jira/browse/CALCITE-2264
> Project: Calcite
>  Issue Type: Bug
>  Components: jdbc-adapter
>Reporter: Piotr Bojko
>Assignee: Julian Hyde
>Priority: Major
> Fix For: 1.17.0
>
>
> Considering chinook tests, having following schema:
> {code:json}
>  {
>   "version": "1.0",
>   "defaultSchema": "ENHANCED",
>   "schemas": [
> {
>   "name": "CHINOOK",
>   "type": "jdbc",
>   "jdbcDriver": "org.hsqldb.jdbc.JDBCDriver",
>   "jdbcUrl": "jdbc:hsqldb:res:chinook",
>   "jdbcUser": "sa",
>   "jdbcPassword": ""
> },
> {
>   "name": "ENHANCED",
>   "type": "custom",
>   "factory": "org.apache.calcite.schema.impl.AbstractSchema$Factory",
>   "operand": {},
>   "tables": [
>   ...
> {
>   "name" : "SIMPLE_CUSTOMER",
>   "type" : "view",
>   "sql" : [
> "SELECT c.firstname, c.lastname, c.email ",
> "FROM chinook.customer AS c"
>   ]
> ...
>   ],
>   "functions": [
> {
>   "name": "ASCONCATOFPARAMS",
>   "className": "org.apache.calcite.chinook.StringConcatFunction"
> }
>   ]
> }
>   ]
> {code}
> Following query produces error:
> {code:sql}
> SELECT email, ASCONCATOFPARAMS(firstname, lastname) AS joined FROM 
> SIMPLE_CUSTOMER limit 3
> {code}
> Exception:
> {code}
> > Caused by: java.lang.RuntimeException: while executing SQL [SELECT "EMAIL" 
> > AS "email", "ASCONCATOFPARAMS"("FIRSTNAME", "LASTNAME") AS "joined"
> > FROM (SELECT *
> > FROM "CUSTOMER"
> > LIMIT 3) AS "t"]
> > at 
> > org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:153)
> > at 
> > org.apache.calcite.linq4j.AbstractEnumerable.iterator(AbstractEnumerable.java:33)
> > at org.apache.calcite.avatica.MetaImpl.createCursor(MetaImpl.java:90)
> > at 
> > org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:174)
> > at 
> > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:67)
> > at 
> > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:44)
> > at 
> > org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:630)
> > at 
> > org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:619)
> > at 
> > org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638)
> > at 
> > org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149)
> > ... 24 more
> > Caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object 
> > not found: ASCONCATOFPARAMS
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
> > at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source)
> > at 
> > org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> > at 
> > org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> > at 
> > org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:143)
> > ... 33 more
> > Caused by: org.hsqldb.HsqlException: user lacks privilege or object not 
> > found: ASCONCATOFPARAMS
> > at org.hsqldb.error.Error.error(Unknown Source)
> > at org.hsqldb.error.Error.error(Unknown Source)
> > at org.hsqldb.Routine.getMethods(Unknown Source)
> > at org.hsqldb.Routine.createRoutines(Unknown Source)
> > at org.hsqldb.ParserDQL.readColumnOrFunctionExpression(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSimpleValueExpressionPrimary(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesValueExpressionPrimary(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesPrimary(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesFactor(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesTerm(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesCommonValueExpression(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadValueExpression(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSelect(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadQuerySpecification(Unknown Source)
> >

[jira] [Commented] (CALCITE-2282) Allow OperatorTable to be pluggable in the parser

2018-04-25 Thread Julian Hyde (JIRA)

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

Julian Hyde commented on CALCITE-2282:
--

This is one of those "drill a hole" changes I hate.

Isn't there already a way to specify an operator table?



> Allow OperatorTable to be pluggable in the parser
> -
>
> Key: CALCITE-2282
> URL: https://issues.apache.org/jira/browse/CALCITE-2282
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Sudheesh Katkam
>Assignee: Julian Hyde
>Priority: Major
> Attachments: CALCITE-2282.patch.txt
>
>
> SqlAbstractParserImpl [hardcodes OperatorTable to 
> SqlStdOperatorTable|https://github.com/apache/calcite/blob/8327e674e7f0a768d124fa37fd75cda4b8a35bb6/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java#L334|https://github.com/apache/calcite/blob/8327e674e7f0a768d124fa37fd75cda4b8a35bb6/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java#L334].
>  Make this pluggable via a protected method.



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


[jira] [Commented] (CALCITE-2255) Test against JDK 11

2018-04-25 Thread Julian Hyde (JIRA)

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

Julian Hyde commented on CALCITE-2255:
--

Yes. My goal is to not hold someone back from developing using JDK 11 if they 
want to. Sometimes a new JDK is stricter than previous ones, so it's good to 
fix errors in the code to comply with the strictest.

In the test that I run nightly, I have disabled javadoc, for now, if it is JDK 
11.

> Test against JDK 11
> ---
>
> Key: CALCITE-2255
> URL: https://issues.apache.org/jira/browse/CALCITE-2255
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Kevin Risden
>Assignee: Kevin Risden
>Priority: Major
> Fix For: 1.17.0
>
>
> JDK 11 ([http://jdk.java.net/11/)] is in early release and we can start 
> testing against it. With the improvements from CALCITE-2063, we should be 
> able to test against JDK 11 without much effort.
> I opened [https://github.com/docker-library/openjdk/pull/186] and 
> [https://github.com/carlossg/docker-maven/issues/79] to try to get JDK 11 
> support for the docker images we are trying to use. 
> I am working on testing locally as well to see if there is anything broken.



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


[jira] [Commented] (CALCITE-2276) Calcite unable to parse ROW value constructor in certain scenario

2018-04-25 Thread Julian Hyde (JIRA)

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

Julian Hyde commented on CALCITE-2276:
--

In CALCITE-877 (which is when those lines in misc.iq were added) I state that 
ROW is only allowed inside VALUES. So, my statement contradicts your statement 
that ROW(...) and (...) are equivalent. Can you read the standard, so we know 
where we stand?

Even if the standard disallows ROW, I'm open to the idea of adding a compliance 
flag to allow it.

[~danny0405], Your change looks good, but please use the same indentation as 
the other code.

> Calcite unable to parse ROW value constructor in certain scenario
> -
>
> Key: CALCITE-2276
> URL: https://issues.apache.org/jira/browse/CALCITE-2276
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Shuyi Chen
>Assignee: Julian Hyde
>Priority: Major
>
> h2. Original dev mailing list question:
> Now for our production, we can parse a query successfully like this :
> {code}
> -- correlated IN subquery
> -- TC 01.01
> SELECT t1a,
>t1b,
>t1h
> FROM   t1
> WHERE  ( t1a, t1h ) NOT IN (SELECT t2a,
>t2h
> FROM   t2
> WHERE  t2a = t1a
> ORDER  BY t2a)
> AND t1a = 'val1a'
> {code}
> but if we add in `Row`:
> {code}
> -- correlated IN subquery
> -- TC 01.01
> SELECT t1a,
>t1b,
>t1h
> FROM   t1
> WHERE  ROW( t1a, t1h ) NOT IN (SELECT t2a,
>t2h
> FROM   t2
> WHERE  t2a = t1a
> ORDER  BY t2a)
> AND t1a = 'val1a'
> {code}
>  it will throw exception:
> {noformat}
> Caused by: org.apache.calcite.sql.parser.SqlParseException: ROW expression
> encountered in illegal context
>   at 
> org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:351)
>   at 
> org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:133)
>   at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:138)
>   at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:163)
>   at 
> org.apache.flink.table.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:81)
> ... 8 more
> {noformat}
> For the success query, if we exec parsed AST tree rootNode.toString(), it
> will return a query like:
> {code}
> SELECT `t1a`,
>`t1b`,
>`t1h`
> FROM `t1`
> WHERE ROW(`t1a`, `t1h`) NOT IN (SELECT `t2a`, `t2h`
> FROM `t2`
> WHERE `t2a` = `t1a`
> ORDER BY `t2a`)
> AND `t1a` = 'val1a'
> {code}
> This is inconsistent  by Calcite itself semantic.



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


[jira] [Comment Edited] (CALCITE-2276) Calcite unable to parse ROW value constructor in certain scenario

2018-04-25 Thread Yuzhao Chen (JIRA)

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

Yuzhao Chen edited comment on CALCITE-2276 at 4/26/18 4:22 AM:
---

[~julianhyde] [~suez1224]
 I hava fire a PR here [https://github.com/apache/calcite/pull/679]

But i also see the test case in misc.iq:
{code:java}
# Explicit ROW
 select deptno, row (empno, deptno) as r
 from "scott".emp;
-ROW expression encountered in illegal context
-!error{code}
So what is the background we abandon explicit Row value constructor now?


was (Author: danny0405):
[~julianhyde] [~suez1224]
I hava fire a PR here https://github.com/apache/calcite/pull/679

But i also see the test case in misc.iq:
```xml
 # Explicit ROW
 select deptno, row (empno, deptno) as r
 from "scott".emp;
-ROW expression encountered in illegal context
-!error
```
So i want to know why we abandon explicit Row value constructor now?


> Calcite unable to parse ROW value constructor in certain scenario
> -
>
> Key: CALCITE-2276
> URL: https://issues.apache.org/jira/browse/CALCITE-2276
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Shuyi Chen
>Assignee: Julian Hyde
>Priority: Major
>
> h2. Original dev mailing list question:
> Now for our production, we can parse a query successfully like this :
> {code}
> -- correlated IN subquery
> -- TC 01.01
> SELECT t1a,
>t1b,
>t1h
> FROM   t1
> WHERE  ( t1a, t1h ) NOT IN (SELECT t2a,
>t2h
> FROM   t2
> WHERE  t2a = t1a
> ORDER  BY t2a)
> AND t1a = 'val1a'
> {code}
> but if we add in `Row`:
> {code}
> -- correlated IN subquery
> -- TC 01.01
> SELECT t1a,
>t1b,
>t1h
> FROM   t1
> WHERE  ROW( t1a, t1h ) NOT IN (SELECT t2a,
>t2h
> FROM   t2
> WHERE  t2a = t1a
> ORDER  BY t2a)
> AND t1a = 'val1a'
> {code}
>  it will throw exception:
> {noformat}
> Caused by: org.apache.calcite.sql.parser.SqlParseException: ROW expression
> encountered in illegal context
>   at 
> org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:351)
>   at 
> org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:133)
>   at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:138)
>   at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:163)
>   at 
> org.apache.flink.table.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:81)
> ... 8 more
> {noformat}
> For the success query, if we exec parsed AST tree rootNode.toString(), it
> will return a query like:
> {code}
> SELECT `t1a`,
>`t1b`,
>`t1h`
> FROM `t1`
> WHERE ROW(`t1a`, `t1h`) NOT IN (SELECT `t2a`, `t2h`
> FROM `t2`
> WHERE `t2a` = `t1a`
> ORDER BY `t2a`)
> AND `t1a` = 'val1a'
> {code}
> This is inconsistent  by Calcite itself semantic.



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


[jira] [Commented] (CALCITE-2276) Calcite unable to parse ROW value constructor in certain scenario

2018-04-25 Thread Yuzhao Chen (JIRA)

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

Yuzhao Chen commented on CALCITE-2276:
--

[~julianhyde] [~suez1224]
I hava fire a PR here https://github.com/apache/calcite/pull/679

But i also see the test case in misc.iq:
```xml
 # Explicit ROW
 select deptno, row (empno, deptno) as r
 from "scott".emp;
-ROW expression encountered in illegal context
-!error
```
So i want to know why we abandon explicit Row value constructor now?


> Calcite unable to parse ROW value constructor in certain scenario
> -
>
> Key: CALCITE-2276
> URL: https://issues.apache.org/jira/browse/CALCITE-2276
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Shuyi Chen
>Assignee: Julian Hyde
>Priority: Major
>
> h2. Original dev mailing list question:
> Now for our production, we can parse a query successfully like this :
> {code}
> -- correlated IN subquery
> -- TC 01.01
> SELECT t1a,
>t1b,
>t1h
> FROM   t1
> WHERE  ( t1a, t1h ) NOT IN (SELECT t2a,
>t2h
> FROM   t2
> WHERE  t2a = t1a
> ORDER  BY t2a)
> AND t1a = 'val1a'
> {code}
> but if we add in `Row`:
> {code}
> -- correlated IN subquery
> -- TC 01.01
> SELECT t1a,
>t1b,
>t1h
> FROM   t1
> WHERE  ROW( t1a, t1h ) NOT IN (SELECT t2a,
>t2h
> FROM   t2
> WHERE  t2a = t1a
> ORDER  BY t2a)
> AND t1a = 'val1a'
> {code}
>  it will throw exception:
> {noformat}
> Caused by: org.apache.calcite.sql.parser.SqlParseException: ROW expression
> encountered in illegal context
>   at 
> org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:351)
>   at 
> org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:133)
>   at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:138)
>   at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:163)
>   at 
> org.apache.flink.table.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:81)
> ... 8 more
> {noformat}
> For the success query, if we exec parsed AST tree rootNode.toString(), it
> will return a query like:
> {code}
> SELECT `t1a`,
>`t1b`,
>`t1h`
> FROM `t1`
> WHERE ROW(`t1a`, `t1h`) NOT IN (SELECT `t2a`, `t2h`
> FROM `t2`
> WHERE `t2a` = `t1a`
> ORDER BY `t2a`)
> AND `t1a` = 'val1a'
> {code}
> This is inconsistent  by Calcite itself semantic.



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


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

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user F21 commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184262056
  
--- Diff: site/README.md ---
@@ -24,33 +24,62 @@ This directory contains the code for the
 a sub-directory of the
 [Apache Calcite web site](https://calcite.apache.org).
 
-## Setup
+You can build the site manually using your environment or use the docker 
compose file.
+
+## Manually
+
+### Setup your environment
 
 Similar to the instructions to
-[set up the Calcite web site](../site/README.md).
+[set up the Calcite web 
site](https://github.com/apache/calcite-avatica/blob/master/site/README.md).
 
-Site generation currently works best with ruby-2.4.1.
+Site generation currently works best with ruby-2.5.1.
 
 1. `cd site`
 2. `svn co https://svn.apache.org/repos/asf/calcite/site/avatica 
target/avatica`
-3. `sudo apt-get install rubygems ruby2.1-dev zlib1g-dev` (linux)
-4. `sudo gem install bundler github-pages jekyll jekyll-oembed`
--- End diff --

done.


> 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
>
> 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] [Commented] (CALCITE-1937) Web site for Avatica Go

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user F21 commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184261016
  
--- Diff: site/develop/index.md ---
@@ -23,115 +23,9 @@ limitations under the License.
 
 Want to help add a feature or fix a bug?
 
-* TOC
-{:toc}
+Please find the development guides for Avatica's components here:
 
-## Source code
-
-You can get the source code by
-[downloading a release]({{ site.baseurl }}/downloads)
-or from source control.
-
-Calcite uses git for version control.  The canonical source is in
-[Apache](https://git-wip-us.apache.org/repos/asf/calcite.git),
-but most people find the
-[Github mirror](https://github.com/apache/calcite-avatica) more
-user-friendly.
-
-## Download source, build, and run tests
-
-Prerequisites are git, maven (3.2.1 or later) and Java (JDK 1.7 or
-later, 1.8 preferred) on your path.
-
-Create a local copy of the git repository, `cd` to its root directory,
-then build using maven:
-
-{% highlight bash %}
-$ git clone git://github.com/apache/calcite-avatica.git avatica
-$ cd avatica
-$ mvn install
-{% endhighlight %}
-
-The HOWTO describes how to
-[build from a source distribution]({{ site.baseurl 
}}/docs/howto.html#building-from-a-source-distribution),
-[run more or fewer tests]({{ site.baseurl 
}}/docs/howto.html#running-tests) and
-[run integration tests]({{ site.baseurl 
}}/docs/howto.html#running-integration-tests).
-
-### Disabling protobuf generation
-
-On older operating systems, developers trying to build Avatica may 
experience
-issues with the Xolstice maven-protobuf-plugin, similar to the following:
-
-```
-[INFO] Compiling 3 proto file(s) to /avatica/core/src/main/java
-[ERROR] PROTOC FAILED: 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: 
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-[ERROR] /avatica/core/src/main/protobuf/common.proto [0:0]: 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: 
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-[ERROR] /avatica/core/src/main/protobuf/responses.proto [0:0]: 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: 
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-[ERROR] /avatica/core/src/main/protobuf/requests.proto [0:0]: 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: 
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-```
-
-In most cases, it is unnecessary to re-generate the Protobuf messages into 
Java code. Developers
-can side-step this issue by disabling the `compile-protobuf` profile in 
their Maven execution.
-
-{% highlight bash %}
-$ mvn package -P!compile-protobuf
-{% endhighlight %}
-
-
-## Contributing
-
-We welcome contributions.
-
-If you are planning to make a large contribution, talk to us first! It
-helps to agree on the general approach. Log a
-[JIRA case](https://issues.apache.org/jira/browse/CALCITE) for your
-proposed feature or start a discussion on the dev list.
-
-Fork the github repository, and create a branch for your feature.
-
-Develop your feature and test cases, and make sure that
-`mvn install` succeeds. (Run extra tests if your change warrants it.)
-
-Commit your change to your branch, and use a comment that starts with
-the JIRA case number, like this:
-
-{% highlight text %}
-[CALCITE-345] AssertionError in RexToLixTranslator comparing to date 
literal
-{% endhighlight %}
-
-If your change had multiple commits, use `git rebase -i master` to
-squash them into a single commit, and to bring your code up to date
-with the latest on the main line.
-
-Then push your commit(s) to github, and create a pull request from
-your branch to the calcite master branch. Update the JIRA case
-to reference your pull request, and a committer will review your
-changes.
-
-## Continuous Integration Testing
-
-Calcite has a collection of Jenkins jobs on ASF-hosted infrastructure.
-They are all organized in a single view and available at


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

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user F21 commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184260833
  
--- Diff: site/news/avatica-go-releases/index.html ---
@@ -0,0 +1,28 @@
+---
+layout: news
+title: Avatica Go Releases
+permalink: /news/avatica-go-releases/
+author: all
--- End diff --

This was a copied from the original downloads page.


> 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
>
> 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] [Commented] (CALCITE-1937) Web site for Avatica Go

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user F21 commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184260682
  
--- Diff: site/downloads/index.md ---
@@ -22,102 +22,9 @@ limitations under the License.
 {% endcomment %}
 -->
 
-Avatica is released as a source artifact, and also through Maven and 
Docker Hub.
+The following downloads are available from the Avatica project:
 
-# Source releases
-
-Release  | Date   | Commit   | Download
-:--- | :- | :--- | :---
-{% for post in site.categories.release %}{% comment %}
-{% endcomment %}{% if post.fullVersion %}{% comment %}
-{% endcomment %}{% assign v = post.fullVersion %}{% comment %}
-{% endcomment %}{% else %}{% comment %}
-{% endcomment %}{% capture v %}apache-calcite-avatica-{{ post.version }}{% 
endcapture %}{% comment %}
-{% endcomment %}{% endif %}{% comment %}
-{% endcomment %}{% if forloop.index0 < 1 %}{% comment %}
-{% endcomment %}{% capture p 
%}http://www.apache.org/dyn/closer.lua?filename=calcite/{{ v }}{% endcapture 
%}{% comment %}
-{% endcomment %}{% assign q = "=download" %}{% comment %}
-{% endcomment %}{% assign d = "https://www.apache.org/dist; %}{% comment %}
-{% endcomment %}{% else %}{% comment %}
-{% endcomment %}{% capture p %}http://archive.apache.org/dist/calcite/{{ v 
}}{% endcapture %}{% comment %}
-{% endcomment %}{% assign q = "" %}{% comment %}
-{% endcomment %}{% assign d = "https://archive.apache.org/dist; %}{% 
comment %}
-{% endcomment %}{% endif %}{% comment %}
-{% endcomment %}{% capture d1 %}{{ post.date | date: "%F"}}{% endcapture 
%}{% comment %}
-{% endcomment %}{% capture d2 %}2017-05-01{% endcapture %}{% comment %}
-{% endcomment %}{% capture d3 %}2018-03-01{% endcapture %}{% comment %}
-{% endcomment %}{% if d1 > d3 %}{% comment %}
-{% endcomment %}{% assign digest = "sha256" %}{% comment %}
-{% endcomment %}{% elsif d1 > d2 %}{% comment %}
-{% endcomment %}{% assign digest = "mds" %}{% comment %}
-{% endcomment %}{% else %}{% comment %}
-{% endcomment %}{% assign digest = "md5" %}{% comment %}
-{% endcomment %}{% endif %}{% comment %}
-{% endcomment %}{{ post.version }}{% comment %}
-{% endcomment %} | {{ post.date | date_to_string }}{% comment %}
-{% endcomment %} | https://github.com/apache/calcite-avatica/commit/{{ post.sha }}">{{ 
post.sha }}{% comment %}
-{% endcomment %} | tar{% 
comment %}
-{% endcomment %} ({{ digest }}{% comment %}
-{% endcomment %} pgp){% comment %}
-{% endcomment %} {% raw %}{% endraw %}{% comment %}
-{% endcomment %} zip{% 
comment %}
-{% endcomment %} ({{ digest }}{% comment %}
-{% endcomment %} pgp){% comment %}
-{% endcomment %}
-{% endfor %}
-
-Choose a source distribution in either *tar* or *zip* format,
-and [verify](http://www.apache.org/dyn/closer.cgi#verify)
-using the corresponding *pgp* signature (using the committer file in
-[KEYS](http://www.apache.org/dist/calcite/KEYS)).
-If you cannot do that, use the *sha256* hash file (*md5* in older
-releases) to check that the download has completed OK.
-
-For fast downloads, current source distributions are hosted on mirror 
servers;
-older source distributions are in the
-[archive](http://archive.apache.org/dist/calcite/).
-If a download from a mirror fails, retry, and the second download will 
likely
-succeed.
-
-For security, hash and signature files are always hosted at
-[Apache](https://www.apache.org/dist).
-
-# Maven artifacts
-
-Add the following to the dependencies section of your `pom.xml` file:
-
-{% for post in site.categories.release limit:1 %}
-{% assign current_release = post %}
-{% endfor %}
-
-{% highlight xml %}
-
-  
-org.apache.calcite.avatica
-avatica
-{{ current_release.version }}
-  
-  
-org.apache.calcite.avatica
-avatica-server
-{{ current_release.version }}
-  
-
-{% endhighlight %}
-
-As of Apache Calcite Avatica 1.9.0, the following un-shaded client 
artifact is also available:
-
-{% highlight xml %}
-
-  
-org.apache.calcite.avatica
-avatica-core
-{{ current_release.version }}
-  
-
-{% endhighlight %}
-
-# Docker images
-
-From release 1.10.0 onwards, Docker images for Avatica Server are 
available at
-[Docker Hub](https://hub.docker.com/r/apache/calcite-avatica).
+Component | Download
+: | 

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

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user F21 commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184260415
  
--- Diff: site/develop/avatica.md ---
@@ -0,0 +1,138 @@
+---
+layout: page
+title: Developing Avatica
+permalink: develop/avatica.html
+---
+
+
+Want to help add a feature or fix a bug?
+
+* TOC
+{:toc}
+
+## Source code
+
+You can get the source code by
+[downloading a release]({{ site.baseurl }}/downloads)
+or from source control.
+
+Calcite uses git for version control.  The canonical source is in
+[Apache](https://git-wip-us.apache.org/repos/asf/calcite.git),
+but most people find the
+[Github mirror](https://github.com/apache/calcite-avatica) more
+user-friendly.
+
+## Download source, build, and run tests
+
+Prerequisites are git, maven (3.2.1 or later) and Java (JDK 1.7 or
--- End diff --

Hm. Not too sure about this one. This was a copy of the original avatica 
docs that I moved into another file. Ping @joshelser @julianhyde 


> 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
>
> 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] [Commented] (CALCITE-1937) Web site for Avatica Go

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184259611
  
--- Diff: site/downloads/avatica-go.md ---
@@ -0,0 +1,82 @@
+---
+layout: page
+title: Avatica Go Client Downloads
+permalink: downloads/avatica-go.html
--- End diff --

Permalink doesn't start with `/`? Other permalinks from this PR do.


> 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
>
> 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] [Commented] (CALCITE-1937) Web site for Avatica Go

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184259121
  
--- Diff: site/develop/avatica.md ---
@@ -0,0 +1,138 @@
+---
+layout: page
+title: Developing Avatica
+permalink: develop/avatica.html
+---
+
+
+Want to help add a feature or fix a bug?
+
+* TOC
+{:toc}
+
+## Source code
+
+You can get the source code by
+[downloading a release]({{ site.baseurl }}/downloads)
+or from source control.
+
+Calcite uses git for version control.  The canonical source is in
+[Apache](https://git-wip-us.apache.org/repos/asf/calcite.git),
+but most people find the
+[Github mirror](https://github.com/apache/calcite-avatica) more
+user-friendly.
+
+## Download source, build, and run tests
+
+Prerequisites are git, maven (3.2.1 or later) and Java (JDK 1.7 or
--- End diff --

JDK 1.8 is required now I'm 99% sure. Don't think this was introduced here 
but can fix.


> 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
>
> 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] [Commented] (CALCITE-1937) Web site for Avatica Go

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184259954
  
--- Diff: site/README.md ---
@@ -24,33 +24,62 @@ This directory contains the code for the
 a sub-directory of the
 [Apache Calcite web site](https://calcite.apache.org).
 
-## Setup
+You can build the site manually using your environment or use the docker 
compose file.
+
+## Manually
+
+### Setup your environment
 
 Similar to the instructions to
-[set up the Calcite web site](../site/README.md).
+[set up the Calcite web 
site](https://github.com/apache/calcite-avatica/blob/master/site/README.md).
 
-Site generation currently works best with ruby-2.4.1.
+Site generation currently works best with ruby-2.5.1.
 
 1. `cd site`
 2. `svn co https://svn.apache.org/repos/asf/calcite/site/avatica 
target/avatica`
-3. `sudo apt-get install rubygems ruby2.1-dev zlib1g-dev` (linux)
-4. `sudo gem install bundler github-pages jekyll jekyll-oembed`
--- End diff --

Did removing this line happen on purpose? I think at least `bundler` needs 
to be there before `bundle install`


> 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
>
> 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] [Commented] (CALCITE-1937) Web site for Avatica Go

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184259718
  
--- Diff: site/develop/index.md ---
@@ -23,115 +23,9 @@ limitations under the License.
 
 Want to help add a feature or fix a bug?
 
-* TOC
-{:toc}
+Please find the development guides for Avatica's components here:
 
-## Source code
-
-You can get the source code by
-[downloading a release]({{ site.baseurl }}/downloads)
-or from source control.
-
-Calcite uses git for version control.  The canonical source is in
-[Apache](https://git-wip-us.apache.org/repos/asf/calcite.git),
-but most people find the
-[Github mirror](https://github.com/apache/calcite-avatica) more
-user-friendly.
-
-## Download source, build, and run tests
-
-Prerequisites are git, maven (3.2.1 or later) and Java (JDK 1.7 or
-later, 1.8 preferred) on your path.
-
-Create a local copy of the git repository, `cd` to its root directory,
-then build using maven:
-
-{% highlight bash %}
-$ git clone git://github.com/apache/calcite-avatica.git avatica
-$ cd avatica
-$ mvn install
-{% endhighlight %}
-
-The HOWTO describes how to
-[build from a source distribution]({{ site.baseurl 
}}/docs/howto.html#building-from-a-source-distribution),
-[run more or fewer tests]({{ site.baseurl 
}}/docs/howto.html#running-tests) and
-[run integration tests]({{ site.baseurl 
}}/docs/howto.html#running-integration-tests).
-
-### Disabling protobuf generation
-
-On older operating systems, developers trying to build Avatica may 
experience
-issues with the Xolstice maven-protobuf-plugin, similar to the following:
-
-```
-[INFO] Compiling 3 proto file(s) to /avatica/core/src/main/java
-[ERROR] PROTOC FAILED: 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: 
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-[ERROR] /avatica/core/src/main/protobuf/common.proto [0:0]: 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: 
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-[ERROR] /avatica/core/src/main/protobuf/responses.proto [0:0]: 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: 
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-[ERROR] /avatica/core/src/main/protobuf/requests.proto [0:0]: 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: 
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by 
/avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-```
-
-In most cases, it is unnecessary to re-generate the Protobuf messages into 
Java code. Developers
-can side-step this issue by disabling the `compile-protobuf` profile in 
their Maven execution.
-
-{% highlight bash %}
-$ mvn package -P!compile-protobuf
-{% endhighlight %}
-
-
-## Contributing
-
-We welcome contributions.
-
-If you are planning to make a large contribution, talk to us first! It
-helps to agree on the general approach. Log a
-[JIRA case](https://issues.apache.org/jira/browse/CALCITE) for your
-proposed feature or start a discussion on the dev list.
-
-Fork the github repository, and create a branch for your feature.
-
-Develop your feature and test cases, and make sure that
-`mvn install` succeeds. (Run extra tests if your change warrants it.)
-
-Commit your change to your branch, and use a comment that starts with
-the JIRA case number, like this:
-
-{% highlight text %}
-[CALCITE-345] AssertionError in RexToLixTranslator comparing to date 
literal
-{% endhighlight %}
-
-If your change had multiple commits, use `git rebase -i master` to
-squash them into a single commit, and to bring your code up to date
-with the latest on the main line.
-
-Then push your commit(s) to github, and create a pull request from
-your branch to the calcite master branch. Update the JIRA case
-to reference your pull request, and a committer will review your
-changes.
-
-## Continuous Integration Testing
-
-Calcite has a collection of Jenkins jobs on ASF-hosted infrastructure.
-They are all organized in a single view and available at


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

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184259467
  
--- Diff: site/news/avatica-go-releases/index.html ---
@@ -0,0 +1,28 @@
+---
+layout: news
+title: Avatica Go Releases
+permalink: /news/avatica-go-releases/
+author: all
+---
+{% comment %}
--- End diff --

Missing `` before and after the license comment? Saw this on 
the other files in this PR.


> 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
>
> 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] [Commented] (CALCITE-1937) Web site for Avatica Go

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184259769
  
--- Diff: site/develop/avatica.md ---
@@ -0,0 +1,138 @@
+---
+layout: page
+title: Developing Avatica
+permalink: develop/avatica.html
--- End diff --

Permalink doesn't start with /? Other permalinks from this PR do.


> 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
>
> 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] [Commented] (CALCITE-1937) Web site for Avatica Go

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184259602
  
--- Diff: site/downloads/avatica.md ---
@@ -0,0 +1,124 @@
+---
+layout: page
+title: Avatica Downloads
+permalink: downloads/avatica.html
--- End diff --

Permalink doesn't start with `/`? Other permalinks from this PR do.


> 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
>
> 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] [Commented] (CALCITE-1937) Web site for Avatica Go

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184259487
  
--- Diff: site/news/avatica-go-releases/index.html ---
@@ -0,0 +1,28 @@
+---
+layout: news
+title: Avatica Go Releases
+permalink: /news/avatica-go-releases/
+author: all
--- End diff --

Is `author` needed here?


> 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
>
> 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] [Commented] (CALCITE-1937) Web site for Avatica Go

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica/pull/43#discussion_r184259286
  
--- Diff: site/downloads/index.md ---
@@ -22,102 +22,9 @@ limitations under the License.
 {% endcomment %}
 -->
 
-Avatica is released as a source artifact, and also through Maven and 
Docker Hub.
+The following downloads are available from the Avatica project:
 
-# Source releases
-
-Release  | Date   | Commit   | Download
-:--- | :- | :--- | :---
-{% for post in site.categories.release %}{% comment %}
-{% endcomment %}{% if post.fullVersion %}{% comment %}
-{% endcomment %}{% assign v = post.fullVersion %}{% comment %}
-{% endcomment %}{% else %}{% comment %}
-{% endcomment %}{% capture v %}apache-calcite-avatica-{{ post.version }}{% 
endcapture %}{% comment %}
-{% endcomment %}{% endif %}{% comment %}
-{% endcomment %}{% if forloop.index0 < 1 %}{% comment %}
-{% endcomment %}{% capture p 
%}http://www.apache.org/dyn/closer.lua?filename=calcite/{{ v }}{% endcapture 
%}{% comment %}
-{% endcomment %}{% assign q = "=download" %}{% comment %}
-{% endcomment %}{% assign d = "https://www.apache.org/dist; %}{% comment %}
-{% endcomment %}{% else %}{% comment %}
-{% endcomment %}{% capture p %}http://archive.apache.org/dist/calcite/{{ v 
}}{% endcapture %}{% comment %}
-{% endcomment %}{% assign q = "" %}{% comment %}
-{% endcomment %}{% assign d = "https://archive.apache.org/dist; %}{% 
comment %}
-{% endcomment %}{% endif %}{% comment %}
-{% endcomment %}{% capture d1 %}{{ post.date | date: "%F"}}{% endcapture 
%}{% comment %}
-{% endcomment %}{% capture d2 %}2017-05-01{% endcapture %}{% comment %}
-{% endcomment %}{% capture d3 %}2018-03-01{% endcapture %}{% comment %}
-{% endcomment %}{% if d1 > d3 %}{% comment %}
-{% endcomment %}{% assign digest = "sha256" %}{% comment %}
-{% endcomment %}{% elsif d1 > d2 %}{% comment %}
-{% endcomment %}{% assign digest = "mds" %}{% comment %}
-{% endcomment %}{% else %}{% comment %}
-{% endcomment %}{% assign digest = "md5" %}{% comment %}
-{% endcomment %}{% endif %}{% comment %}
-{% endcomment %}{{ post.version }}{% comment %}
-{% endcomment %} | {{ post.date | date_to_string }}{% comment %}
-{% endcomment %} | https://github.com/apache/calcite-avatica/commit/{{ post.sha }}">{{ 
post.sha }}{% comment %}
-{% endcomment %} | tar{% 
comment %}
-{% endcomment %} ({{ digest }}{% comment %}
-{% endcomment %} pgp){% comment %}
-{% endcomment %} {% raw %}{% endraw %}{% comment %}
-{% endcomment %} zip{% 
comment %}
-{% endcomment %} ({{ digest }}{% comment %}
-{% endcomment %} pgp){% comment %}
-{% endcomment %}
-{% endfor %}
-
-Choose a source distribution in either *tar* or *zip* format,
-and [verify](http://www.apache.org/dyn/closer.cgi#verify)
-using the corresponding *pgp* signature (using the committer file in
-[KEYS](http://www.apache.org/dist/calcite/KEYS)).
-If you cannot do that, use the *sha256* hash file (*md5* in older
-releases) to check that the download has completed OK.
-
-For fast downloads, current source distributions are hosted on mirror 
servers;
-older source distributions are in the
-[archive](http://archive.apache.org/dist/calcite/).
-If a download from a mirror fails, retry, and the second download will 
likely
-succeed.
-
-For security, hash and signature files are always hosted at
-[Apache](https://www.apache.org/dist).
-
-# Maven artifacts
-
-Add the following to the dependencies section of your `pom.xml` file:
-
-{% for post in site.categories.release limit:1 %}
-{% assign current_release = post %}
-{% endfor %}
-
-{% highlight xml %}
-
-  
-org.apache.calcite.avatica
-avatica
-{{ current_release.version }}
-  
-  
-org.apache.calcite.avatica
-avatica-server
-{{ current_release.version }}
-  
-
-{% endhighlight %}
-
-As of Apache Calcite Avatica 1.9.0, the following un-shaded client 
artifact is also available:
-
-{% highlight xml %}
-
-  
-org.apache.calcite.avatica
-avatica-core
-{{ current_release.version }}
-  
-
-{% endhighlight %}
-
-# Docker images
-
-From release 1.10.0 onwards, Docker images for Avatica Server are 
available at
-[Docker Hub](https://hub.docker.com/r/apache/calcite-avatica).
+Component | Download
+: | 

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

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CALCITE-1937:
-

Github user risdenk commented on the issue:

https://github.com/apache/calcite-avatica/pull/43
  
I think this might break existing urls? I'd have to dig into this a bit 
more. The moving of permalinks could cause some annoyance. Maybe redirect from 
old to new?


> 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
>
> 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] [Commented] (CALCITE-2255) Test against JDK 11

2018-04-25 Thread Kevin Risden (JIRA)

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

Kevin Risden commented on CALCITE-2255:
---

Hmmm ok I can play with this a bit more. I think we have some time before JDK 
11 is required for javadocs right? Currently JDK 8 is required for an 
"official" build?

> Test against JDK 11
> ---
>
> Key: CALCITE-2255
> URL: https://issues.apache.org/jira/browse/CALCITE-2255
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Kevin Risden
>Assignee: Kevin Risden
>Priority: Major
> Fix For: 1.17.0
>
>
> JDK 11 ([http://jdk.java.net/11/)] is in early release and we can start 
> testing against it. With the improvements from CALCITE-2063, we should be 
> able to test against JDK 11 without much effort.
> I opened [https://github.com/docker-library/openjdk/pull/186] and 
> [https://github.com/carlossg/docker-maven/issues/79] to try to get JDK 11 
> support for the docker images we are trying to use. 
> I am working on testing locally as well to see if there is anything broken.



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


[jira] [Created] (CALCITE-2282) Allow OperatorTable to be pluggable in the parser

2018-04-25 Thread Sudheesh Katkam (JIRA)
Sudheesh Katkam created CALCITE-2282:


 Summary: Allow OperatorTable to be pluggable in the parser
 Key: CALCITE-2282
 URL: https://issues.apache.org/jira/browse/CALCITE-2282
 Project: Calcite
  Issue Type: Bug
  Components: core
Reporter: Sudheesh Katkam
Assignee: Julian Hyde


SqlAbstractParserImpl [hardcodes OperatorTable to 
SqlStdOperatorTable|https://github.com/apache/calcite/blob/8327e674e7f0a768d124fa37fd75cda4b8a35bb6/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java#L334|https://github.com/apache/calcite/blob/8327e674e7f0a768d124fa37fd75cda4b8a35bb6/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java#L334].
 Make this pluggable via a protected method.



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


[jira] [Updated] (CALCITE-2281) TIMESTAMPADD(MICROSECOND, ...) returns incorrect results

2018-04-25 Thread Sudheesh Katkam (JIRA)

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

Sudheesh Katkam updated CALCITE-2281:
-
Attachment: CALCITE-2281.patch.txt

> TIMESTAMPADD(MICROSECOND, ...) returns incorrect results
> 
>
> Key: CALCITE-2281
> URL: https://issues.apache.org/jira/browse/CALCITE-2281
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Sudheesh Katkam
>Assignee: Julian Hyde
>Priority: Major
> Attachments: CALCITE-2281.patch.txt
>
>
> Add this test to {{SqlOperatorBaseTest#testTimestampAdd}} :
> {code:java}
> tester.checkScalar(
> "timestampadd(MICROSECOND, 2, timestamp '2016-02-24 12:42:25.00')",
> "2016-02-24 12:42:25.02",
> "TIMESTAMP(6) NOT NULL");{code}
> {{[SqlTimestampAddFunction|https://github.com/apache/calcite/blob/8327e674e7f0a768d124fa37fd75cda4b8a35bb6/core/src/main/java/org/apache/calcite/sql/fun/SqlTimestampAddFunction.java#L68]}}
>  has incorrect precision for MILLISECOND and MICROSECOND. Note that the 
> parser does not allow for MILLISECOND as a time unit.



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


[jira] [Created] (CALCITE-2281) TIMESTAMPADD(MICROSECOND, ...) returns incorrect results

2018-04-25 Thread Sudheesh Katkam (JIRA)
Sudheesh Katkam created CALCITE-2281:


 Summary: TIMESTAMPADD(MICROSECOND, ...) returns incorrect results
 Key: CALCITE-2281
 URL: https://issues.apache.org/jira/browse/CALCITE-2281
 Project: Calcite
  Issue Type: Bug
  Components: core
Reporter: Sudheesh Katkam
Assignee: Julian Hyde


Add this test to {{SqlOperatorBaseTest#testTimestampAdd}} :
{code:java}
tester.checkScalar(
"timestampadd(MICROSECOND, 2, timestamp '2016-02-24 12:42:25.00')",
"2016-02-24 12:42:25.02",
"TIMESTAMP(6) NOT NULL");{code}
{{[SqlTimestampAddFunction|https://github.com/apache/calcite/blob/8327e674e7f0a768d124fa37fd75cda4b8a35bb6/core/src/main/java/org/apache/calcite/sql/fun/SqlTimestampAddFunction.java#L68]}}
 has incorrect precision for MILLISECOND and MICROSECOND. Note that the parser 
does not allow for MILLISECOND as a time unit.



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


[jira] [Created] (CALCITE-2280) "Super-liberal" parser that accepts all SQL dialects

2018-04-25 Thread Julian Hyde (JIRA)
Julian Hyde created CALCITE-2280:


 Summary: "Super-liberal" parser that accepts all SQL dialects
 Key: CALCITE-2280
 URL: https://issues.apache.org/jira/browse/CALCITE-2280
 Project: Calcite
  Issue Type: Bug
Reporter: Julian Hyde
Assignee: Julian Hyde


Create a parser that accepts all SQL dialects.

It would accept common dialects such as Oracle, MySQL, PostgreSQL, BigQuery. If 
you have preferred dialects, please let us know in the comments section. (If 
you're willing to work on a particular dialect, even better!)

We would do this in a new module, inheriting and extending the parser in the 
same way that the DDL parser in the "server" module does.

This would be a messy and difficult project, because we would have to comply 
with the rules of each parser (and its set of built-in functions) rather than 
writing the rules as we would like them to be. That's why I would keep it out 
of the core parser. But it would also have large benefits.

This would be new territory Calcite: as a tool for manipulating/understanding 
SQL, not (necessarily) for relational algebra or execution.

Some possible uses:
* analyze query lineage (what tables and columns are used in a query);
* translate from one SQL dialect to another (using the JDBC adapter to generate 
SQL in the target dialect);
* a "deep" compatibility mode (much more comprehensive than the current 
compatibility mode) where Calcite could pretend to be, say, Oracle;
* SQL parser as a service: a REST call gives a SQL query, and returns a JSON or 
XML document with the parse tree.

If you can think of interesting uses, please discuss in the comments.

There are similarities with Uber's 
[QueryParser|https://eng.uber.com/queryparser/] tool. Maybe we can collaborate, 
or make use of their test cases.

We will need a lot of sample queries. If you are able to contribute sample 
queries for particular dialects, please discuss in the comments section. It 
would be good if the sample queries are based on a familiar schema (e.g. scott 
or foodmart) but we can be flexible about this.



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


[jira] [Commented] (CALCITE-2275) Using logical NOT operator in Join condition leads to mistakenly push down this condition.

2018-04-25 Thread Julian Hyde (JIRA)

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

Julian Hyde commented on CALCITE-2275:
--

We don't have a 'reviewable' status. I am reviewing now. Looking good, and I 
will commit when tests have passed.

> Using logical NOT operator in Join condition leads to mistakenly push down 
> this condition.
> --
>
> Key: CALCITE-2275
> URL: https://issues.apache.org/jira/browse/CALCITE-2275
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.16.0
>Reporter: Vitalii Diravka
>Assignee: Vitalii Diravka
>Priority: Major
> Fix For: 1.17.0
>
>
> Using logical NOT operator in Join condition leads to mistakenly push down 
> this condition. Then LogicalProject is created with RexCall expression. It 
> prevents for further inferring predicates (by using 
> JoinPushTransitivePredicatesRule, for instance).
> Query example:
> {code:sql}
> select * from sales.emp d join sales.emp e on e.deptno = d.deptno and 
> d.deptno not in (4, 6)
> {code}



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


[jira] [Commented] (CALCITE-2264) User defined function in json schema pushed to jdbc subschema.

2018-04-25 Thread Julian Hyde (JIRA)

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

Julian Hyde commented on CALCITE-2264:
--

Reviewing now - looks good - will commit when tests pass.

> User defined function in json schema pushed to jdbc subschema.
> --
>
> Key: CALCITE-2264
> URL: https://issues.apache.org/jira/browse/CALCITE-2264
> Project: Calcite
>  Issue Type: Bug
>Reporter: Piotr Bojko
>Assignee: Julian Hyde
>Priority: Major
>
> Considering chinook tests, having following schema:
> {code:json}
>  {
>   "version": "1.0",
>   "defaultSchema": "ENHANCED",
>   "schemas": [
> {
>   "name": "CHINOOK",
>   "type": "jdbc",
>   "jdbcDriver": "org.hsqldb.jdbc.JDBCDriver",
>   "jdbcUrl": "jdbc:hsqldb:res:chinook",
>   "jdbcUser": "sa",
>   "jdbcPassword": ""
> },
> {
>   "name": "ENHANCED",
>   "type": "custom",
>   "factory": "org.apache.calcite.schema.impl.AbstractSchema$Factory",
>   "operand": {},
>   "tables": [
>   ...
> {
>   "name" : "SIMPLE_CUSTOMER",
>   "type" : "view",
>   "sql" : [
> "SELECT c.firstname, c.lastname, c.email ",
> "FROM chinook.customer AS c"
>   ]
> ...
>   ],
>   "functions": [
> {
>   "name": "ASCONCATOFPARAMS",
>   "className": "org.apache.calcite.chinook.StringConcatFunction"
> }
>   ]
> }
>   ]
> {code}
> Following query produces error:
> {code:sql}
> SELECT email, ASCONCATOFPARAMS(firstname, lastname) AS joined FROM 
> SIMPLE_CUSTOMER limit 3
> {code}
> Exception:
> {code}
> > Caused by: java.lang.RuntimeException: while executing SQL [SELECT "EMAIL" 
> > AS "email", "ASCONCATOFPARAMS"("FIRSTNAME", "LASTNAME") AS "joined"
> > FROM (SELECT *
> > FROM "CUSTOMER"
> > LIMIT 3) AS "t"]
> > at 
> > org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:153)
> > at 
> > org.apache.calcite.linq4j.AbstractEnumerable.iterator(AbstractEnumerable.java:33)
> > at org.apache.calcite.avatica.MetaImpl.createCursor(MetaImpl.java:90)
> > at 
> > org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:174)
> > at 
> > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:67)
> > at 
> > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:44)
> > at 
> > org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:630)
> > at 
> > org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:619)
> > at 
> > org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638)
> > at 
> > org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149)
> > ... 24 more
> > Caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object 
> > not found: ASCONCATOFPARAMS
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
> > at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source)
> > at 
> > org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> > at 
> > org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> > at 
> > org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:143)
> > ... 33 more
> > Caused by: org.hsqldb.HsqlException: user lacks privilege or object not 
> > found: ASCONCATOFPARAMS
> > at org.hsqldb.error.Error.error(Unknown Source)
> > at org.hsqldb.error.Error.error(Unknown Source)
> > at org.hsqldb.Routine.getMethods(Unknown Source)
> > at org.hsqldb.Routine.createRoutines(Unknown Source)
> > at org.hsqldb.ParserDQL.readColumnOrFunctionExpression(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSimpleValueExpressionPrimary(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesValueExpressionPrimary(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesPrimary(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesFactor(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesTerm(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesCommonValueExpression(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadValueExpression(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSelect(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadQuerySpecification(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSimpleTable(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadQueryPrimary(Unknown Source)
> > at 

[jira] [Commented] (CALCITE-2279) Druid adapter duplicate binary expression

2018-04-25 Thread Nishant Bangarwa (JIRA)

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

Nishant Bangarwa commented on CALCITE-2279:
---

PR for the fix - https://github.com/apache/calcite/pull/678

> Druid adapter duplicate binary expression
> -
>
> Key: CALCITE-2279
> URL: https://issues.apache.org/jira/browse/CALCITE-2279
> Project: Calcite
>  Issue Type: Bug
>  Components: druid
>Reporter: Kevin Risden
>Assignee: Nishant Bangarwa
>Priority: Major
> Fix For: 1.17.0
>
>
> I was looking into Error Prone [1] checking for Calcite and it found what 
> looks like a bug in Druid Adapter. The output is as follows
>  
> {quote}DruidJsonFilter.java:[324,9] [IdentityBinaryExpression] A binary 
> expression where both operands are the same is usually incorrect; the value 
> of this expression is equivalent to `lhs.getType().getFamily() == 
> SqlTypeFamily.NUMERIC`.
> [ERROR]     (see 
> [http://errorprone.info/bugpattern/IdentityBinaryExpression]){quote}
>  
> The DruidJsonFilter [2] has left and right hand the exact same.
>  
> [1] [http://errorprone.info/]
> [2] 
> [https://github.com/apache/calcite/blob/master/druid/src/main/java/org/apache/calcite/adapter/druid/DruidJsonFilter.java#L323]



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


[jira] [Commented] (CALCITE-2279) Druid adapter duplicate binary expression

2018-04-25 Thread Nishant Bangarwa (JIRA)

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

Nishant Bangarwa commented on CALCITE-2279:
---

Thanks [~risdenk] for reporting this, Will send a patch shortly for the fix. 

> Druid adapter duplicate binary expression
> -
>
> Key: CALCITE-2279
> URL: https://issues.apache.org/jira/browse/CALCITE-2279
> Project: Calcite
>  Issue Type: Bug
>  Components: druid
>Reporter: Kevin Risden
>Assignee: Nishant Bangarwa
>Priority: Major
> Fix For: 1.17.0
>
>
> I was looking into Error Prone [1] checking for Calcite and it found what 
> looks like a bug in Druid Adapter. The output is as follows
>  
> {quote}DruidJsonFilter.java:[324,9] [IdentityBinaryExpression] A binary 
> expression where both operands are the same is usually incorrect; the value 
> of this expression is equivalent to `lhs.getType().getFamily() == 
> SqlTypeFamily.NUMERIC`.
> [ERROR]     (see 
> [http://errorprone.info/bugpattern/IdentityBinaryExpression]){quote}
>  
> The DruidJsonFilter [2] has left and right hand the exact same.
>  
> [1] [http://errorprone.info/]
> [2] 
> [https://github.com/apache/calcite/blob/master/druid/src/main/java/org/apache/calcite/adapter/druid/DruidJsonFilter.java#L323]



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


[jira] [Assigned] (CALCITE-2279) Druid adapter duplicate binary expression

2018-04-25 Thread Nishant Bangarwa (JIRA)

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

Nishant Bangarwa reassigned CALCITE-2279:
-

Assignee: Nishant Bangarwa

> Druid adapter duplicate binary expression
> -
>
> Key: CALCITE-2279
> URL: https://issues.apache.org/jira/browse/CALCITE-2279
> Project: Calcite
>  Issue Type: Bug
>  Components: druid
>Reporter: Kevin Risden
>Assignee: Nishant Bangarwa
>Priority: Major
> Fix For: 1.17.0
>
>
> I was looking into Error Prone [1] checking for Calcite and it found what 
> looks like a bug in Druid Adapter. The output is as follows
>  
> {quote}DruidJsonFilter.java:[324,9] [IdentityBinaryExpression] A binary 
> expression where both operands are the same is usually incorrect; the value 
> of this expression is equivalent to `lhs.getType().getFamily() == 
> SqlTypeFamily.NUMERIC`.
> [ERROR]     (see 
> [http://errorprone.info/bugpattern/IdentityBinaryExpression]){quote}
>  
> The DruidJsonFilter [2] has left and right hand the exact same.
>  
> [1] [http://errorprone.info/]
> [2] 
> [https://github.com/apache/calcite/blob/master/druid/src/main/java/org/apache/calcite/adapter/druid/DruidJsonFilter.java#L323]



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


[jira] [Commented] (CALCITE-2264) User defined function in json schema pushed to jdbc subschema.

2018-04-25 Thread Piotr Bojko (JIRA)

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

Piotr Bojko commented on CALCITE-2264:
--

[~julianhyde] could you review the patch? :)

> User defined function in json schema pushed to jdbc subschema.
> --
>
> Key: CALCITE-2264
> URL: https://issues.apache.org/jira/browse/CALCITE-2264
> Project: Calcite
>  Issue Type: Bug
>Reporter: Piotr Bojko
>Assignee: Julian Hyde
>Priority: Major
>
> Considering chinook tests, having following schema:
> {code:json}
>  {
>   "version": "1.0",
>   "defaultSchema": "ENHANCED",
>   "schemas": [
> {
>   "name": "CHINOOK",
>   "type": "jdbc",
>   "jdbcDriver": "org.hsqldb.jdbc.JDBCDriver",
>   "jdbcUrl": "jdbc:hsqldb:res:chinook",
>   "jdbcUser": "sa",
>   "jdbcPassword": ""
> },
> {
>   "name": "ENHANCED",
>   "type": "custom",
>   "factory": "org.apache.calcite.schema.impl.AbstractSchema$Factory",
>   "operand": {},
>   "tables": [
>   ...
> {
>   "name" : "SIMPLE_CUSTOMER",
>   "type" : "view",
>   "sql" : [
> "SELECT c.firstname, c.lastname, c.email ",
> "FROM chinook.customer AS c"
>   ]
> ...
>   ],
>   "functions": [
> {
>   "name": "ASCONCATOFPARAMS",
>   "className": "org.apache.calcite.chinook.StringConcatFunction"
> }
>   ]
> }
>   ]
> {code}
> Following query produces error:
> {code:sql}
> SELECT email, ASCONCATOFPARAMS(firstname, lastname) AS joined FROM 
> SIMPLE_CUSTOMER limit 3
> {code}
> Exception:
> {code}
> > Caused by: java.lang.RuntimeException: while executing SQL [SELECT "EMAIL" 
> > AS "email", "ASCONCATOFPARAMS"("FIRSTNAME", "LASTNAME") AS "joined"
> > FROM (SELECT *
> > FROM "CUSTOMER"
> > LIMIT 3) AS "t"]
> > at 
> > org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:153)
> > at 
> > org.apache.calcite.linq4j.AbstractEnumerable.iterator(AbstractEnumerable.java:33)
> > at org.apache.calcite.avatica.MetaImpl.createCursor(MetaImpl.java:90)
> > at 
> > org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:174)
> > at 
> > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:67)
> > at 
> > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:44)
> > at 
> > org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:630)
> > at 
> > org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:619)
> > at 
> > org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638)
> > at 
> > org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149)
> > ... 24 more
> > Caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object 
> > not found: ASCONCATOFPARAMS
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
> > at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source)
> > at 
> > org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> > at 
> > org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> > at 
> > org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:143)
> > ... 33 more
> > Caused by: org.hsqldb.HsqlException: user lacks privilege or object not 
> > found: ASCONCATOFPARAMS
> > at org.hsqldb.error.Error.error(Unknown Source)
> > at org.hsqldb.error.Error.error(Unknown Source)
> > at org.hsqldb.Routine.getMethods(Unknown Source)
> > at org.hsqldb.Routine.createRoutines(Unknown Source)
> > at org.hsqldb.ParserDQL.readColumnOrFunctionExpression(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSimpleValueExpressionPrimary(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesValueExpressionPrimary(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesPrimary(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesFactor(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesTerm(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadAllTypesCommonValueExpression(Unknown 
> > Source)
> > at org.hsqldb.ParserDQL.XreadValueExpression(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSelect(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadQuerySpecification(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadSimpleTable(Unknown Source)
> > at org.hsqldb.ParserDQL.XreadQueryPrimary(Unknown Source)
> > at 

[jira] [Commented] (CALCITE-2276) Calcite unable to parse ROW value constructor in certain scenario

2018-04-25 Thread Shuyi Chen (JIRA)

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

Shuyi Chen commented on CALCITE-2276:
-

awesome, thanks for contributing, [~danny0405], Let us know if you need help.

> Calcite unable to parse ROW value constructor in certain scenario
> -
>
> Key: CALCITE-2276
> URL: https://issues.apache.org/jira/browse/CALCITE-2276
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Shuyi Chen
>Assignee: Julian Hyde
>Priority: Major
>
> h2. Original dev mailing list question:
> Now for our production, we can parse a query successfully like this :
> {code}
> -- correlated IN subquery
> -- TC 01.01
> SELECT t1a,
>t1b,
>t1h
> FROM   t1
> WHERE  ( t1a, t1h ) NOT IN (SELECT t2a,
>t2h
> FROM   t2
> WHERE  t2a = t1a
> ORDER  BY t2a)
> AND t1a = 'val1a'
> {code}
> but if we add in `Row`:
> {code}
> -- correlated IN subquery
> -- TC 01.01
> SELECT t1a,
>t1b,
>t1h
> FROM   t1
> WHERE  ROW( t1a, t1h ) NOT IN (SELECT t2a,
>t2h
> FROM   t2
> WHERE  t2a = t1a
> ORDER  BY t2a)
> AND t1a = 'val1a'
> {code}
>  it will throw exception:
> {noformat}
> Caused by: org.apache.calcite.sql.parser.SqlParseException: ROW expression
> encountered in illegal context
>   at 
> org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:351)
>   at 
> org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:133)
>   at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:138)
>   at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:163)
>   at 
> org.apache.flink.table.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:81)
> ... 8 more
> {noformat}
> For the success query, if we exec parsed AST tree rootNode.toString(), it
> will return a query like:
> {code}
> SELECT `t1a`,
>`t1b`,
>`t1h`
> FROM `t1`
> WHERE ROW(`t1a`, `t1h`) NOT IN (SELECT `t2a`, `t2h`
> FROM `t2`
> WHERE `t2a` = `t1a`
> ORDER BY `t2a`)
> AND `t1a` = 'val1a'
> {code}
> This is inconsistent  by Calcite itself semantic.



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


[jira] [Commented] (CALCITE-2276) Calcite unable to parse ROW value constructor in certain scenario

2018-04-25 Thread Yuzhao Chen (JIRA)

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

Yuzhao Chen commented on CALCITE-2276:
--

[~suez1224] [~michaelmior] [~julianhyde]
Yeah, in sql-1999 ROW(...) and (...) is equivalent, and i'm working on fix this.

> Calcite unable to parse ROW value constructor in certain scenario
> -
>
> Key: CALCITE-2276
> URL: https://issues.apache.org/jira/browse/CALCITE-2276
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Shuyi Chen
>Assignee: Julian Hyde
>Priority: Major
>
> h2. Original dev mailing list question:
> Now for our production, we can parse a query successfully like this :
> {code}
> -- correlated IN subquery
> -- TC 01.01
> SELECT t1a,
>t1b,
>t1h
> FROM   t1
> WHERE  ( t1a, t1h ) NOT IN (SELECT t2a,
>t2h
> FROM   t2
> WHERE  t2a = t1a
> ORDER  BY t2a)
> AND t1a = 'val1a'
> {code}
> but if we add in `Row`:
> {code}
> -- correlated IN subquery
> -- TC 01.01
> SELECT t1a,
>t1b,
>t1h
> FROM   t1
> WHERE  ROW( t1a, t1h ) NOT IN (SELECT t2a,
>t2h
> FROM   t2
> WHERE  t2a = t1a
> ORDER  BY t2a)
> AND t1a = 'val1a'
> {code}
>  it will throw exception:
> {noformat}
> Caused by: org.apache.calcite.sql.parser.SqlParseException: ROW expression
> encountered in illegal context
>   at 
> org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:351)
>   at 
> org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:133)
>   at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:138)
>   at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:163)
>   at 
> org.apache.flink.table.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:81)
> ... 8 more
> {noformat}
> For the success query, if we exec parsed AST tree rootNode.toString(), it
> will return a query like:
> {code}
> SELECT `t1a`,
>`t1b`,
>`t1h`
> FROM `t1`
> WHERE ROW(`t1a`, `t1h`) NOT IN (SELECT `t2a`, `t2h`
> FROM `t2`
> WHERE `t2a` = `t1a`
> ORDER BY `t2a`)
> AND `t1a` = 'val1a'
> {code}
> This is inconsistent  by Calcite itself semantic.



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