Re: [VOTE] Release calcite-avatica-go-3.0.0 (release candidate 0)

2018-04-18 Thread Francis Chuang

Hey Julian,

I was looking at integrating the script to exclude files without the 
license header from the release artifacts. I don't think we will need to 
exclude anything other than the files in the dist/ .git/ folders (which 
are already ignored using tar --exclude), because all the files in the 
repo are required to build the library and run its tests.


Regarding the gopher.png file, if the license is not acceptable, perhaps 
we can use the logo of the Calcite project or the Apache Foundation. If 
that is also not acceptable, I can update the code to generate some 
random bytes during testing.


Francis

On 19/04/2018 11:47 AM, Julian Hyde wrote:

Thanks for starting the vote. A few questions/comments before I cast my vote. 
Not all of them are release blockers, by any means.

I see there are tabs in the source code. Is this usual for go?

What is the purpose of gopher.png? Where did it come from? What is its license?

Do you know what is the license of the files generated by protobuf?

Other than gopher.png, are there any other files in this release that have been 
copied from elsewhere?

Would it be possible to add headers to all text files (even little files like 
.gitignore)?

The tar command should probably drive from `git ls-files` so we don’t 
accidentally include files that are lying around in the sandbox.

Let’s add the following to make-release-artifacts.sh:

for i in $(git ls-files); do
   case "$i” in
   (LICENSE|NOTICE);; # add exceptions here
   (*) grep -q "Licensed to the Apache Software Foundation" $i || echo "$i has 
no header”;;
   esac
done

Julian



On Apr 18, 2018, at 3:37 PM, Francis Chuang  wrote:

Thanks, Michael!

I opened a PR [1] to fix issues identified with the documentation and site 
during the voting process.

Francis

[1] https://github.com/apache/calcite-avatica-go/pull/20

On 19/04/2018 12:22 AM, Michael Mior wrote:

+1 (binding) Thanks Frnacis!

One minor note: the manual instructions for testing say "go test-v"
(there's a space missing).

--
Michael Mior
mm...@uwaterloo.ca

2018-04-18 4:43 GMT-04:00 Francis Chuang :


Hi all,

I have created a release for Apache Calcite Avatica Go, release candidate
0.

The release notes are available here: https://github.com/apache/calc
ite-avatica-go/blob/master/site/go_history.md

The commit to be voted on: http://git-wip-us.apache.org/r
epos/asf/calcite-avatica-go/commit/cb2d4cb4596d5850bd0eb10c9
c7697b679aabc2d

The hash is cb2d4cb4596d5850bd0eb10c9c7697b679aabc2d

The artifacts to be voted on are located here:
https://dist.apache.org/repos/dist/dev/calcite/apache-calcit
e-avatica-go-3.0.0-rc0/

The hashes of the artifacts are as follows:

src.tar.gz.md5 8B 76 54 78 3F 62 3C CF  56 BB CA F7 8F F3 F4 E6
src.tar.gz.sha256 476EAA2B 90E73BF7 98764F5B 48694E58 FC80FD8D 5EFC74B6
004DE7CB B1D4C0DE

Release artifacts are signed with the following key:
https://people.apache.org/keys/committer/jhyde.asc

Instructions for running the test suite is located here:
https://github.com/apache/calcite-avatica-go/blob/master/
site/go_development.md#testing

Please vote on releasing this package as Apache Calcite Avatica Go 3.0.0.


The vote is open for the next 72 hours and passes if a majority of
at least three +1 PMC votes are cast.

[ ] +1 Release this package as Apache Calcite Avatica Go 3.0.0
[ ]  0 I don't feel strongly about it, but I'm okay with the release
[ ] -1 Do not release this package because...


Here is my vote:

+1 (non-binding)

Francis






Re: [VOTE] Release calcite-avatica-go-3.0.0 (release candidate 0)

2018-04-18 Thread Francis Chuang

Hey Julian,

Please see responses inline.

On 19/04/2018 11:47 AM, Julian Hyde wrote:

Thanks for starting the vote. A few questions/comments before I cast my vote. 
Not all of them are release blockers, by any means.

I see there are tabs in the source code. Is this usual for go?
For Go, code is automatically formatted using the gofmt command. In Go, 
the standard is to use tabs (so gofmt formats using tabs).

What is the purpose of gopher.png? Where did it come from? What is its license?
The gopher.png file is used to test writing and reading binary data from 
the database. The file is from 
https://github.com/golang-samples/gopher-vector The license is Creative 
Commons 3.0 Attributions license.

Do you know what is the license of the files generated by protobuf?
The protobuf definitions are from the avatica project (Apache 2). The Go 
protobuf library uses this license: 
https://github.com/golang/protobuf/blob/master/LICENSE From my 
understanding, the generated code belongs to the project generating the 
code.

Other than gopher.png, are there any other files in this release that have been 
copied from elsewhere?

There are no files copied from elsewhere.

Would it be possible to add headers to all text files (even little files like 
.gitignore)?

I will push a commit to update the gitignore file.

The tar command should probably drive from `git ls-files` so we don’t 
accidentally include files that are lying around in the sandbox.

Let’s add the following to make-release-artifacts.sh:

for i in $(git ls-files); do
   case "$i” in
   (LICENSE|NOTICE);; # add exceptions here
   (*) grep -q "Licensed to the Apache Software Foundation" $i || echo "$i has 
no header”;;
   esac
done

Will add a commit for this.


Julian



On Apr 18, 2018, at 3:37 PM, Francis Chuang  wrote:

Thanks, Michael!

I opened a PR [1] to fix issues identified with the documentation and site 
during the voting process.

Francis

[1] https://github.com/apache/calcite-avatica-go/pull/20

On 19/04/2018 12:22 AM, Michael Mior wrote:

+1 (binding) Thanks Frnacis!

One minor note: the manual instructions for testing say "go test-v"
(there's a space missing).

--
Michael Mior
mm...@uwaterloo.ca

2018-04-18 4:43 GMT-04:00 Francis Chuang :


Hi all,

I have created a release for Apache Calcite Avatica Go, release candidate
0.

The release notes are available here: https://github.com/apache/calc
ite-avatica-go/blob/master/site/go_history.md

The commit to be voted on: http://git-wip-us.apache.org/r
epos/asf/calcite-avatica-go/commit/cb2d4cb4596d5850bd0eb10c9
c7697b679aabc2d

The hash is cb2d4cb4596d5850bd0eb10c9c7697b679aabc2d

The artifacts to be voted on are located here:
https://dist.apache.org/repos/dist/dev/calcite/apache-calcit
e-avatica-go-3.0.0-rc0/

The hashes of the artifacts are as follows:

src.tar.gz.md5 8B 76 54 78 3F 62 3C CF  56 BB CA F7 8F F3 F4 E6
src.tar.gz.sha256 476EAA2B 90E73BF7 98764F5B 48694E58 FC80FD8D 5EFC74B6
004DE7CB B1D4C0DE

Release artifacts are signed with the following key:
https://people.apache.org/keys/committer/jhyde.asc

Instructions for running the test suite is located here:
https://github.com/apache/calcite-avatica-go/blob/master/
site/go_development.md#testing

Please vote on releasing this package as Apache Calcite Avatica Go 3.0.0.


The vote is open for the next 72 hours and passes if a majority of
at least three +1 PMC votes are cast.

[ ] +1 Release this package as Apache Calcite Avatica Go 3.0.0
[ ]  0 I don't feel strongly about it, but I'm okay with the release
[ ] -1 Do not release this package because...


Here is my vote:

+1 (non-binding)

Francis






Re: [VOTE] Release calcite-avatica-go-3.0.0 (release candidate 0)

2018-04-18 Thread Julian Hyde
Thanks for starting the vote. A few questions/comments before I cast my vote. 
Not all of them are release blockers, by any means.

I see there are tabs in the source code. Is this usual for go?

What is the purpose of gopher.png? Where did it come from? What is its license?

Do you know what is the license of the files generated by protobuf?

Other than gopher.png, are there any other files in this release that have been 
copied from elsewhere?

Would it be possible to add headers to all text files (even little files like 
.gitignore)?

The tar command should probably drive from `git ls-files` so we don’t 
accidentally include files that are lying around in the sandbox.

Let’s add the following to make-release-artifacts.sh:

for i in $(git ls-files); do
  case "$i” in
  (LICENSE|NOTICE);; # add exceptions here
  (*) grep -q "Licensed to the Apache Software Foundation" $i || echo "$i has 
no header”;;
  esac
done 

Julian


> On Apr 18, 2018, at 3:37 PM, Francis Chuang  wrote:
> 
> Thanks, Michael!
> 
> I opened a PR [1] to fix issues identified with the documentation and site 
> during the voting process.
> 
> Francis
> 
> [1] https://github.com/apache/calcite-avatica-go/pull/20
> 
> On 19/04/2018 12:22 AM, Michael Mior wrote:
>> +1 (binding) Thanks Frnacis!
>> 
>> One minor note: the manual instructions for testing say "go test-v"
>> (there's a space missing).
>> 
>> --
>> Michael Mior
>> mm...@uwaterloo.ca
>> 
>> 2018-04-18 4:43 GMT-04:00 Francis Chuang :
>> 
>>> Hi all,
>>> 
>>> I have created a release for Apache Calcite Avatica Go, release candidate
>>> 0.
>>> 
>>> The release notes are available here: https://github.com/apache/calc
>>> ite-avatica-go/blob/master/site/go_history.md
>>> 
>>> The commit to be voted on: http://git-wip-us.apache.org/r
>>> epos/asf/calcite-avatica-go/commit/cb2d4cb4596d5850bd0eb10c9
>>> c7697b679aabc2d
>>> 
>>> The hash is cb2d4cb4596d5850bd0eb10c9c7697b679aabc2d
>>> 
>>> The artifacts to be voted on are located here:
>>> https://dist.apache.org/repos/dist/dev/calcite/apache-calcit
>>> e-avatica-go-3.0.0-rc0/
>>> 
>>> The hashes of the artifacts are as follows:
>>> 
>>> src.tar.gz.md5 8B 76 54 78 3F 62 3C CF  56 BB CA F7 8F F3 F4 E6
>>> src.tar.gz.sha256 476EAA2B 90E73BF7 98764F5B 48694E58 FC80FD8D 5EFC74B6
>>> 004DE7CB B1D4C0DE
>>> 
>>> Release artifacts are signed with the following key:
>>> https://people.apache.org/keys/committer/jhyde.asc
>>> 
>>> Instructions for running the test suite is located here:
>>> https://github.com/apache/calcite-avatica-go/blob/master/
>>> site/go_development.md#testing
>>> 
>>> Please vote on releasing this package as Apache Calcite Avatica Go 3.0.0.
>>> 
>>> 
>>> The vote is open for the next 72 hours and passes if a majority of
>>> at least three +1 PMC votes are cast.
>>> 
>>> [ ] +1 Release this package as Apache Calcite Avatica Go 3.0.0
>>> [ ]  0 I don't feel strongly about it, but I'm okay with the release
>>> [ ] -1 Do not release this package because...
>>> 
>>> 
>>> Here is my vote:
>>> 
>>> +1 (non-binding)
>>> 
>>> Francis
>>> 
>>> 
> 



Re: SQL:2016

2018-04-18 Thread Julian Hyde
A couple of minor things. Your isJson function should return boolean not 
Boolean, because the ISJSON function is strict - i.e. returns unknown if and 
only if its input is null. If the input is null the code generator will not 
call it.

I think SqlIsJsonFunction is probably not necessary. I think everything about 
the function can be deduced by reflection. (That’s how the Geo functions work, 
also.)

I’d add tests for JSON functions to SqlOperatorBaseTest rather than creating 
CalciteJsonOperatorTest and JsonOperatorBaseTest. JSON functions are not that 
different from the built-in function set. (The Geo functions are not in the SQL 
standard; that’s why I separated them a bit.)

Julian


> On Apr 18, 2018, at 5:59 PM, Michael Mior  wrote:
> 
> Thanks Julian! I opened CALCITE-2266 to track implementing some of the new
> JSON functions. I took a stab at implementing ISJSON in the following
> commit:
> 
> https://github.com/michaelmior/calcite/commit/d6930fcd04ed83d37f56a7795ee794
> 1b521fb99c
> 
> These are touching parts of the code base I'm unfamiliar with so I mostly
> don't know what I'm doing :) I added a new operator table which I'm
> guessing we probably don't want to do but it made it easier for me when
> testing to isolate the new code.
> 
> --
> Michael Mior
> mm...@uwaterloo.ca
> 
> 2018-04-18 17:00 GMT-04:00 Julian Hyde :
> 
>> Somehow I missed it, but a new version of the SQL standard was released in
>> December 2016. Here is wikipedia’s description of the new features:
>> 
>>> SQL:2016 introduced 44 new optional features. 22 of them belong
>>> to the JSON functionality, ten more are related to polymorphic table
>>> functions. The additions to the standard include:
>>> 
>>> * JSON: Functions to create JSON documents, to access parts of
>>>   JSON documents and to check whether a string contains valid
>>>  JSON data
>>> * Row Pattern Recognition: Matching a sequence of rows against
>>>  a regular expression pattern
>>> * Date and time formatting and parsing
>>> * LISTAGG: A function to transform values from a group of rows into a
>>>  delimited string
>>> * Polymorphic table functions: table functions without predefined return
>> type
>>> * New data type DECFLOAT
>> 
>> Nothing earth-shattering, but some good stuff there. DECFLOAT makes a lot
>> of sense — businesses hate the kind of rounding errors that binary floating
>> point introduces, and DECFLOAT would seem to map directly to java’s
>> BigDecimal.
>> 
>> And MATCH_RECOGNIZE, which we have already started work on.
>> 
>> Julian
>> 
>> 



Re: SQL:2016

2018-04-18 Thread Michael Mior
Thanks Julian! I opened CALCITE-2266 to track implementing some of the new
JSON functions. I took a stab at implementing ISJSON in the following
commit:

https://github.com/michaelmior/calcite/commit/d6930fcd04ed83d37f56a7795ee794
1b521fb99c

These are touching parts of the code base I'm unfamiliar with so I mostly
don't know what I'm doing :) I added a new operator table which I'm
guessing we probably don't want to do but it made it easier for me when
testing to isolate the new code.

--
Michael Mior
mm...@uwaterloo.ca

2018-04-18 17:00 GMT-04:00 Julian Hyde :

> Somehow I missed it, but a new version of the SQL standard was released in
> December 2016. Here is wikipedia’s description of the new features:
>
> > SQL:2016 introduced 44 new optional features. 22 of them belong
> > to the JSON functionality, ten more are related to polymorphic table
> > functions. The additions to the standard include:
> >
> > * JSON: Functions to create JSON documents, to access parts of
> >JSON documents and to check whether a string contains valid
> >   JSON data
> > * Row Pattern Recognition: Matching a sequence of rows against
> >   a regular expression pattern
> > * Date and time formatting and parsing
> > * LISTAGG: A function to transform values from a group of rows into a
> >   delimited string
> > * Polymorphic table functions: table functions without predefined return
> type
> > * New data type DECFLOAT
>
> Nothing earth-shattering, but some good stuff there. DECFLOAT makes a lot
> of sense — businesses hate the kind of rounding errors that binary floating
> point introduces, and DECFLOAT would seem to map directly to java’s
> BigDecimal.
>
> And MATCH_RECOGNIZE, which we have already started work on.
>
> Julian
>
>


[jira] [Created] (CALCITE-2266) Implement SQL 2016 JSON functions

2018-04-18 Thread Michael Mior (JIRA)
Michael Mior created CALCITE-2266:
-

 Summary: Implement SQL 2016 JSON functions
 Key: CALCITE-2266
 URL: https://issues.apache.org/jira/browse/CALCITE-2266
 Project: Calcite
  Issue Type: Improvement
  Components: core
Reporter: Michael Mior
Assignee: Michael Mior






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


Re: [VOTE] Release calcite-avatica-go-3.0.0 (release candidate 0)

2018-04-18 Thread Francis Chuang

Thanks, Michael!

I opened a PR [1] to fix issues identified with the documentation and 
site during the voting process.


Francis

[1] https://github.com/apache/calcite-avatica-go/pull/20

On 19/04/2018 12:22 AM, Michael Mior wrote:

+1 (binding) Thanks Frnacis!

One minor note: the manual instructions for testing say "go test-v"
(there's a space missing).

--
Michael Mior
mm...@uwaterloo.ca

2018-04-18 4:43 GMT-04:00 Francis Chuang :


Hi all,

I have created a release for Apache Calcite Avatica Go, release candidate
0.

The release notes are available here: https://github.com/apache/calc
ite-avatica-go/blob/master/site/go_history.md

The commit to be voted on: http://git-wip-us.apache.org/r
epos/asf/calcite-avatica-go/commit/cb2d4cb4596d5850bd0eb10c9
c7697b679aabc2d

The hash is cb2d4cb4596d5850bd0eb10c9c7697b679aabc2d

The artifacts to be voted on are located here:
https://dist.apache.org/repos/dist/dev/calcite/apache-calcit
e-avatica-go-3.0.0-rc0/

The hashes of the artifacts are as follows:

src.tar.gz.md5 8B 76 54 78 3F 62 3C CF  56 BB CA F7 8F F3 F4 E6
src.tar.gz.sha256 476EAA2B 90E73BF7 98764F5B 48694E58 FC80FD8D 5EFC74B6
004DE7CB B1D4C0DE

Release artifacts are signed with the following key:
https://people.apache.org/keys/committer/jhyde.asc

Instructions for running the test suite is located here:
https://github.com/apache/calcite-avatica-go/blob/master/
site/go_development.md#testing

Please vote on releasing this package as Apache Calcite Avatica Go 3.0.0.


The vote is open for the next 72 hours and passes if a majority of
at least three +1 PMC votes are cast.

[ ] +1 Release this package as Apache Calcite Avatica Go 3.0.0
[ ]  0 I don't feel strongly about it, but I'm okay with the release
[ ] -1 Do not release this package because...


Here is my vote:

+1 (non-binding)

Francis






[GitHub] calcite-avatica-go pull request #20: Documentation fixes

2018-04-18 Thread F21
GitHub user F21 opened a pull request:

https://github.com/apache/calcite-avatica-go/pull/20

Documentation fixes

This PR contains fixes to the documentation and website of 
calcite-avatica-go as they are identified during the voting process.

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

$ git pull https://github.com/Boostport/calcite-avatica-go fix-documentation

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

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

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

This closes #20


commit 46820ab26e466e8271f2fe7782b40227f1f9c746
Author: Francis Chuang 
Date:   2018-04-18T22:34:57Z

Fix development documentation




---


SQL:2016

2018-04-18 Thread Julian Hyde
Somehow I missed it, but a new version of the SQL standard was released in 
December 2016. Here is wikipedia’s description of the new features:

> SQL:2016 introduced 44 new optional features. 22 of them belong
> to the JSON functionality, ten more are related to polymorphic table
> functions. The additions to the standard include:
>
> * JSON: Functions to create JSON documents, to access parts of
>JSON documents and to check whether a string contains valid
>   JSON data
> * Row Pattern Recognition: Matching a sequence of rows against
>   a regular expression pattern
> * Date and time formatting and parsing
> * LISTAGG: A function to transform values from a group of rows into a
>   delimited string
> * Polymorphic table functions: table functions without predefined return type
> * New data type DECFLOAT

Nothing earth-shattering, but some good stuff there. DECFLOAT makes a lot of 
sense — businesses hate the kind of rounding errors that binary floating point 
introduces, and DECFLOAT would seem to map directly to java’s BigDecimal.

And MATCH_RECOGNIZE, which we have already started work on.

Julian



[jira] [Created] (CALCITE-2265) Strange cast created for ROW comparison

2018-04-18 Thread Dylan Adams (JIRA)
Dylan Adams created CALCITE-2265:


 Summary: Strange cast created for ROW comparison
 Key: CALCITE-2265
 URL: https://issues.apache.org/jira/browse/CALCITE-2265
 Project: Calcite
  Issue Type: Bug
  Components: core
Affects Versions: 1.16.0
Reporter: Dylan Adams
Assignee: Julian Hyde


A comparison using ROWs results in queries that can't be executed by the 
database due to strange casts like 
{noformat}
CAST(ROW('Blake', 'Manager') AS ROW){noformat}
Direct query against HSQLDB:

 
{noformat}
sqlline>  !connect jdbc:hsqldb:res:scott SCOTT TIGER
...
0: jdbc:hsqldb:res:scott> SELECT empno FROM emp WHERE (ename, job) < ('Blake', 
'Manager');
++
| EMPNO  |
++
| 7499   |
| 7698   |
| 7876   |
++{noformat}
 

Query through calcite:

 
{noformat}
sqlline> !connect 
jdbc:calcite:schemaType=jdbc;schema.jdbcDriver=org.hsqldb.jdbcDriver;schema.jdbcUrl=jdbc:hsqldb:res:scott;schema.jdbcUser=SCOTT;schema.jdbcPassword=TIGER
 SCOTT TIGER
Connecting to 
jdbc:calcite:schemaType=jdbc;schema.jdbcDriver=org.hsqldb.jdbcDriver;schema.jdbcUrl=jdbc:hsqldb:res:scott;schema.jdbcUser=SCOTT;schema.jdbcPassword=TIGER
...
Connected to: Calcite (version 1.17.0-SNAPSHOT)
Driver: Calcite JDBC Driver (version 1.17.0-SNAPSHOT)
Autocommit status: true
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:calcite:schemaType=jdbc> SELECT empno FROM emp WHERE (ename, job) < 
('Blake', 'Manager');
Error: Error while executing SQL "SELECT empno FROM emp WHERE (ename, job) < 
('Blake', 'Manager')": while executing SQL [SELECT "EMPNO"
FROM "EMP"
WHERE ROW("ENAME", "JOB") < CAST(ROW('Blake', 'Manager') AS ROW)] 
(state=,code=0)
java.sql.SQLException: Error while executing SQL "SELECT empno FROM emp WHERE 
(ename, job) < ('Blake', 'Manager')": while executing SQL [SELECT "EMPNO"
FROM "EMP"
WHERE ROW("ENAME", "JOB") < CAST(ROW('Blake', 'Manager') AS ROW)]
at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
at 
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
at 
org.apache.calcite.avatica.AvaticaStatement.execute(AvaticaStatement.java:209)
at sqlline.Commands.execute(Commands.java:823)
at sqlline.Commands.sql(Commands.java:733)
at sqlline.SqlLine.dispatch(SqlLine.java:795)
at sqlline.SqlLine.begin(SqlLine.java:668)
at sqlline.SqlLine.start(SqlLine.java:373)
at sqlline.SqlLine.main(SqlLine.java:265)
Caused by: java.lang.RuntimeException: while executing SQL [SELECT "EMPNO"
FROM "EMP"
WHERE ROW("ENAME", "JOB") < CAST(ROW('Blake', 'Manager') AS ROW)]
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:82)
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)
... 7 more
Caused by: java.sql.SQLSyntaxErrorException: type not found or user lacks 
privilege: ROW
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)
... 16 more
Caused by: org.hsqldb.HsqlException: type not found or user lacks privilege: ROW
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.ParserDQL.readTypeDefinition(Unknown Source)
at org.hsqldb.ParserDQL.readCastExpressionOrNull(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.XreadRowOrCommonValueExpression(Unknown Source)
at 

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

2018-04-18 Thread Piotr Bojko (JIRA)
Piotr Bojko created CALCITE-2264:


 Summary: 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


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 org.hsqldb.ParserDQL.XreadQueryTerm(Unknown Source)
>   at org.hsqldb.ParserDQL.XreadQueryExpressionBody(Unknown Source)
>   at org.hsqldb.ParserDQL.XreadQueryExpression(Unknown Source)
>   at org.hsqldb.ParserDQL.compileCursorSpecification(Unknown Source)
>   at org.hsqldb.ParserCommand.compilePart(Unknown Source)
>   at org.hsqldb.ParserCommand.compileStatements(Unknown Source)
>   at 

Re: [VOTE] Release calcite-avatica-go-3.0.0 (release candidate 0)

2018-04-18 Thread Michael Mior
+1 (binding) Thanks Frnacis!

One minor note: the manual instructions for testing say "go test-v"
(there's a space missing).

--
Michael Mior
mm...@uwaterloo.ca

2018-04-18 4:43 GMT-04:00 Francis Chuang :

> Hi all,
>
> I have created a release for Apache Calcite Avatica Go, release candidate
> 0.
>
> The release notes are available here: https://github.com/apache/calc
> ite-avatica-go/blob/master/site/go_history.md
>
> The commit to be voted on: http://git-wip-us.apache.org/r
> epos/asf/calcite-avatica-go/commit/cb2d4cb4596d5850bd0eb10c9
> c7697b679aabc2d
>
> The hash is cb2d4cb4596d5850bd0eb10c9c7697b679aabc2d
>
> The artifacts to be voted on are located here:
> https://dist.apache.org/repos/dist/dev/calcite/apache-calcit
> e-avatica-go-3.0.0-rc0/
>
> The hashes of the artifacts are as follows:
>
> src.tar.gz.md5 8B 76 54 78 3F 62 3C CF  56 BB CA F7 8F F3 F4 E6
> src.tar.gz.sha256 476EAA2B 90E73BF7 98764F5B 48694E58 FC80FD8D 5EFC74B6
> 004DE7CB B1D4C0DE
>
> Release artifacts are signed with the following key:
> https://people.apache.org/keys/committer/jhyde.asc
>
> Instructions for running the test suite is located here:
> https://github.com/apache/calcite-avatica-go/blob/master/
> site/go_development.md#testing
>
> Please vote on releasing this package as Apache Calcite Avatica Go 3.0.0.
>
>
> The vote is open for the next 72 hours and passes if a majority of
> at least three +1 PMC votes are cast.
>
> [ ] +1 Release this package as Apache Calcite Avatica Go 3.0.0
> [ ]  0 I don't feel strongly about it, but I'm okay with the release
> [ ] -1 Do not release this package because...
>
>
> Here is my vote:
>
> +1 (non-binding)
>
> Francis
>
>


[jira] [Created] (CALCITE-2263) Wrong start Pos in SqlOrderBy

2018-04-18 Thread Wenlong Lyu (JIRA)
Wenlong Lyu created CALCITE-2263:


 Summary: Wrong start Pos in SqlOrderBy
 Key: CALCITE-2263
 URL: https://issues.apache.org/jira/browse/CALCITE-2263
 Project: Calcite
  Issue Type: Bug
Reporter: Wenlong Lyu
Assignee: Julian Hyde


{code:java}
// Parser.jj
if (orderBy != null || start != null || count != null) {
if (orderBy == null) {
orderBy = SqlNodeList.EMPTY;
}
e = new SqlOrderBy(getPos(), e, orderBy, start, count);

}
return e;{code}



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


[VOTE] Release calcite-avatica-go-3.0.0 (release candidate 0)

2018-04-18 Thread Francis Chuang

Hi all,

I have created a release for Apache Calcite Avatica Go, release candidate 0.

The release notes are available here: 
https://github.com/apache/calcite-avatica-go/blob/master/site/go_history.md


The commit to be voted on: 
http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/commit/cb2d4cb4596d5850bd0eb10c9c7697b679aabc2d


The hash is cb2d4cb4596d5850bd0eb10c9c7697b679aabc2d

The artifacts to be voted on are located here: 
https://dist.apache.org/repos/dist/dev/calcite/apache-calcite-avatica-go-3.0.0-rc0/


The hashes of the artifacts are as follows:

src.tar.gz.md5 8B 76 54 78 3F 62 3C CF  56 BB CA F7 8F F3 F4 E6
src.tar.gz.sha256 476EAA2B 90E73BF7 98764F5B 48694E58 FC80FD8D 5EFC74B6 
004DE7CB B1D4C0DE


Release artifacts are signed with the following key: 
https://people.apache.org/keys/committer/jhyde.asc


Instructions for running the test suite is located here: 
https://github.com/apache/calcite-avatica-go/blob/master/site/go_development.md#testing


Please vote on releasing this package as Apache Calcite Avatica Go 3.0.0.


The vote is open for the next 72 hours and passes if a majority of
at least three +1 PMC votes are cast.

[ ] +1 Release this package as Apache Calcite Avatica Go 3.0.0
[ ]  0 I don't feel strongly about it, but I'm okay with the release
[ ] -1 Do not release this package because...


Here is my vote:

+1 (non-binding)

Francis



Re: Towards Avatica-Go release ?.?

2018-04-18 Thread Francis Chuang

Thanks for signing and uploading the artifacts!

I will get the vote started ASAP.

Francis

On 18/04/2018 6:04 PM, Julian Hyde wrote:

I noticed the missing execute bit too. Thanks for the fix, Francis.

I added an 'apache-' prefix to the file names, and removed '-rc0' from
the file names (but not the directory name).

The files for review are here:
https://dist.apache.org/repos/dist/dev/calcite/apache-calcite-avatica-go-3.0.0-rc0/

sha256:
476EAA2B 90E73BF7 98764F5B 48694E58 FC80FD8D 5EFC74B6 004DE7CB B1D4C0DE

commit:
cb2d4cb4596d5850bd0eb10c9c7697b679aabc2d

Francis, if you are ready, can you please start a vote?

(To be clear, I have not yet thoroughly reviewed the files. Let's do
that during the vote.)

Julian

On Tue, Apr 17, 2018 at 3:57 PM, Francis Chuang
 wrote:

Thanks, Julian.

I just noticed that the script `make-release-artifacts.sh` was not committed
with the executable bit fixed. I have pushed a commit to fix that, but
you'll need to make it executable to sign the release for 3.0.0-rc0.

Francis

On 18/04/2018 3:55 AM, Julian Hyde wrote:

I’m at a conference today and having problems using gpg remotely. I’ll
sign and upload the files tonight.


On Apr 17, 2018, at 9:34 AM, Julian Hyde  wrote:

Yes, they need to be uploaded to dist/dev. I will generate them and sign
them (I can't sign them if I’m not sure they’re genuine!) and then upload
them. I’ll let you know.

Julian



On Apr 16, 2018, at 10:01 PM, Francis Chuang 
wrote:

Julian,

The release (3.0.0-rc0) is ready for voting. Do the artifacts need to be
uploaded before sending out the release email? If so, can you please sign
them? Instructions for making and signing release artifacts are here:
https://github.com/apache/calcite-avatica-go/blob/master/site/go_development.md#releasing

Francis

On 16/04/2018 4:44 PM, Julian Hyde wrote:

Yes, the script isn’t very complicated. We probably need half a dozen
lines of shell script to create the tar.gz file, sign it, and generate
.sha256 checksums. I don’t mind where you put those lines of shell script,
as long as the next RM can find them.

The site looks good. It doesn’t have to be perfect before the release
as we can easily update it after the release. I’d change the date in
history.md from 2017-08-xx to 2018-04-23. If all goes well the release could
be announced ~5 working days after the vote starts.

I’m not sure whether "go” will work. Jekyll markdown is a bit more
limited than GitHub markdown. We seem to have to use {% highlight sql %} for
code sections.

There are probably other issues in the site but we’ll only know when we
start running jekyll to build and deploy the avatica site.

Julian



On Apr 15, 2018, at 11:27 PM, F21  wrote:

Hey Julian,

The code is in a releasable state. A few questions:
- Building a binary of a library in Go is not useful/meaningful. For
the release, we just need to tar gz the git repo and sign it. Do you still
need a script for this? Otherwise we can write the instructions somewhere in
the site/ directory.

- Still need to write the release notes. Can you have a look at
https://github.com/apache/calcite-avatica-go/pull/2 to see if I have
structured the site/ directory correctly? The PR is a bit stale, but it
shouldn't be too much work to get it up to date.

Francis

On 10/04/2018 8:51 AM, Julian Hyde wrote:

Thanks, Francis.

The most important step is to come up with a release vote email with
the same items as [1]: release notes, git commit, artifacts to be voted on
in dist.apache.org/repos/dist/dev ,
md5 and sha256 hashes. (The staged maven repository does not apply.)

Per apache policy, the release needs to be signed by a PMC member.
I’ll be happy to do that. Or we could skip signing for the first couple of
RCs.

Maybe write a shell script that creates the files, and a “howto” that
the next RM can follow? I’ll be able to run the script when it’s time to
create signed artifacts.

Julian

[1]
https://lists.apache.org/thread.html/03b49fbed8617e860f71bc4f80abe411451d5f112beb5837cb9e5367@%3Cdev.calcite.apache.org%3E



On Apr 9, 2018, at 3:26 PM, F21  wrote:

I am wrapping up some things today and plan to test Avatica Go
against the latest version of Avatica.

I think we'll be able to make a release by the end of the week.

I am happy to be the release manager for this one.

The latest version of Avatica is 2.3.1 under Boostport/avatica, I
think we should make this release 2.4.0.

Francis

On 10/04/2018 3:49 AM, Julian Hyde wrote:

We have to make a release of Avatica Go soon (like, within the next
month).

As I’ve said previously, a tar-ball of the source (plus
checksums/signatures and release notes) is sufficient. But we are an Apache
project, and projects must make releases.


Re: Towards Avatica-Go release ?.?

2018-04-18 Thread Julian Hyde
I noticed the missing execute bit too. Thanks for the fix, Francis.

I added an 'apache-' prefix to the file names, and removed '-rc0' from
the file names (but not the directory name).

The files for review are here:
https://dist.apache.org/repos/dist/dev/calcite/apache-calcite-avatica-go-3.0.0-rc0/

sha256:
476EAA2B 90E73BF7 98764F5B 48694E58 FC80FD8D 5EFC74B6 004DE7CB B1D4C0DE

commit:
cb2d4cb4596d5850bd0eb10c9c7697b679aabc2d

Francis, if you are ready, can you please start a vote?

(To be clear, I have not yet thoroughly reviewed the files. Let's do
that during the vote.)

Julian

On Tue, Apr 17, 2018 at 3:57 PM, Francis Chuang
 wrote:
> Thanks, Julian.
>
> I just noticed that the script `make-release-artifacts.sh` was not committed
> with the executable bit fixed. I have pushed a commit to fix that, but
> you'll need to make it executable to sign the release for 3.0.0-rc0.
>
> Francis
>
> On 18/04/2018 3:55 AM, Julian Hyde wrote:
>>
>> I’m at a conference today and having problems using gpg remotely. I’ll
>> sign and upload the files tonight.
>>
>>> On Apr 17, 2018, at 9:34 AM, Julian Hyde  wrote:
>>>
>>> Yes, they need to be uploaded to dist/dev. I will generate them and sign
>>> them (I can't sign them if I’m not sure they’re genuine!) and then upload
>>> them. I’ll let you know.
>>>
>>> Julian
>>>
>>>
 On Apr 16, 2018, at 10:01 PM, Francis Chuang 
 wrote:

 Julian,

 The release (3.0.0-rc0) is ready for voting. Do the artifacts need to be
 uploaded before sending out the release email? If so, can you please sign
 them? Instructions for making and signing release artifacts are here:
 https://github.com/apache/calcite-avatica-go/blob/master/site/go_development.md#releasing

 Francis

 On 16/04/2018 4:44 PM, Julian Hyde wrote:
>
> Yes, the script isn’t very complicated. We probably need half a dozen
> lines of shell script to create the tar.gz file, sign it, and generate
> .sha256 checksums. I don’t mind where you put those lines of shell script,
> as long as the next RM can find them.
>
> The site looks good. It doesn’t have to be perfect before the release
> as we can easily update it after the release. I’d change the date in
> history.md from 2017-08-xx to 2018-04-23. If all goes well the release 
> could
> be announced ~5 working days after the vote starts.
>
> I’m not sure whether "go” will work. Jekyll markdown is a bit more
> limited than GitHub markdown. We seem to have to use {% highlight sql %} 
> for
> code sections.
>
> There are probably other issues in the site but we’ll only know when we
> start running jekyll to build and deploy the avatica site.
>
> Julian
>
>
>> On Apr 15, 2018, at 11:27 PM, F21  wrote:
>>
>> Hey Julian,
>>
>> The code is in a releasable state. A few questions:
>> - Building a binary of a library in Go is not useful/meaningful. For
>> the release, we just need to tar gz the git repo and sign it. Do you 
>> still
>> need a script for this? Otherwise we can write the instructions 
>> somewhere in
>> the site/ directory.
>>
>> - Still need to write the release notes. Can you have a look at
>> https://github.com/apache/calcite-avatica-go/pull/2 to see if I have
>> structured the site/ directory correctly? The PR is a bit stale, but it
>> shouldn't be too much work to get it up to date.
>>
>> Francis
>>
>> On 10/04/2018 8:51 AM, Julian Hyde wrote:
>>>
>>> Thanks, Francis.
>>>
>>> The most important step is to come up with a release vote email with
>>> the same items as [1]: release notes, git commit, artifacts to be voted 
>>> on
>>> in dist.apache.org/repos/dist/dev 
>>> ,
>>> md5 and sha256 hashes. (The staged maven repository does not apply.)
>>>
>>> Per apache policy, the release needs to be signed by a PMC member.
>>> I’ll be happy to do that. Or we could skip signing for the first couple 
>>> of
>>> RCs.
>>>
>>> Maybe write a shell script that creates the files, and a “howto” that
>>> the next RM can follow? I’ll be able to run the script when it’s time to
>>> create signed artifacts.
>>>
>>> Julian
>>>
>>> [1]
>>> https://lists.apache.org/thread.html/03b49fbed8617e860f71bc4f80abe411451d5f112beb5837cb9e5367@%3Cdev.calcite.apache.org%3E
>>> 
>>>
 On Apr 9, 2018, at 3:26 PM, F21  wrote:

 I am wrapping up some things today and plan to test Avatica Go
 against the latest version of Avatica.

 I think we'll be able to make a