Re: How to parse multiple sql statements with Calcite

2019-07-22 Thread Danny Chan
Hi,
You can just use the method #parseStmtlist[1] which is aimed for multiple sql 
statements.

[1] 
https://github.com/apache/calcite/blob/59c7acd802a885dec1db576974bea6e205d3d955/core/src/main/java/org/apache/calcite/sql/parser/SqlParser.java#L198

Best,
Danny Chan
在 2019年7月22日 +0800 PM11:07,赵帅兵 <1191850...@qq.com>,写道:
> Hello there,
>
>
> I want to know how to parse multiple statements in one string.
> sqlparser.parseStmt() can only parse one statement.
>
> For example, I have one string: "Create table tbl1(id bigint); Select * from 
> tbl1;"
>
> How to split the string to two SQL statements.
>
> I expect to get a list of SqlNode.
>
>
>
>
> Thanks.


[VOTE] Apache Calcite Avatica: Gradle-based release artifacts ready for review

2019-07-22 Thread Vladimir Sitnikov
NOTE: This is NOT a vote for releasing Apache Calcite Avatica.

The purpose is mail is to let you know the state of Gradle-based build.
If would be nice if you could review Apache Calcite Avatica 1.16.0-rc1
artifacts.

Note: I have not removed Maven-related files from Git, however the
intention is to completely remove Maven-based build.


Here's an asciinema of the build&release process:
https://asciinema.org/a/258594

Here are my notes:
* Release script does not create Git tag. It should probably create and
push tag before staging the artifacts.
Should it?
Note: Gradle-based script does not need to commit "-SNAPSHOT" vs
"non-snapshot" version changes.

* Release promotion should somehow identify the rc to promote. Any
suggestions?
Should it just search for the latest rc tag? Should it assume for a command
line parameter?

* "committer login" should probably be configurable (currently the script
just prints TBD)

* "preview site" should probably be created (then the script could publish
javadoc/rat preview)
Alternative option is to drop "preview site"-related info from the "draft
vote template".

* We might want to have release-related tasks to "delete stale artifacts
from dist.apache.org"

Below notes are taken from build script output.

--

I have created a build for Apache Calcite Avatica 1.16.0-rc1, release
candidate 1.

The commit to be voted upon:
https://github.com/vlsi/calcite-avatica/commit/5fadc4a2bb49f91778d047a3a20c1d7e6d1fcbc3

Its hash is 5fadc4a2bb49f91778d047a3a20c1d7e6d1fcbc3

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

The hashes of the artifacts are as follows:
*apache-calcite-avatica-1.16.0-rc1-src.tar.gz
794e8674539bf0b6eb40111f97b2f6b627be156a992a8b8cd423d55af10e907e86072077697f7cff95af55436dddead9219e6b900e8b4be11c8b9c4ee562f37c
*apache-calcite-avatica-1.16.0-rc1-src.zip
ebf2033261ed79a3a67695d512f48d4b2c19b4c0de53e387c9ca902f74562e0c0c63271875d19620cc005e04730a1d6da6df02cf4548d9088f8d2a01f591daee

A staged Maven repository is available for review at:
https://repository.apache.org/content/repositories/orgapachecalcite-1065/org/apache/calcite/

Release artifacts are signed with the following key:
https://people.apache.org/keys/committer/vladimirsitnikov.asc
https://www.apache.org/dist/calcite/KEYS

N.B.
To create the jars and test Calcite Avatica: "./gradlew build".

NOTE: This is NOT a vote for releasing Apache Calcite Avatica.

Vladimir


How to parse multiple sql statements with Calcite

2019-07-22 Thread ??????
Hello there,


I want to know how to parse multiple statements in one string.
sqlparser.parseStmt() can only parse one statement.

For example, I have one string: "Create table tbl1(id bigint); Select * from 
tbl1;"

How to split the string to two SQL statements.

I expect to get a list of SqlNode.




Thanks.

[jira] [Created] (CALCITE-3207) Bug of 'JoinRelNode Convert SqlStatement'

2019-07-22 Thread Xurenhe (JIRA)
Xurenhe created CALCITE-3207:


 Summary: Bug of 'JoinRelNode Convert SqlStatement'
 Key: CALCITE-3207
 URL: https://issues.apache.org/jira/browse/CALCITE-3207
 Project: Calcite
  Issue Type: Bug
  Components: core
Reporter: Xurenhe


Hi all
I have a problem when using calcite, which is 'relnode convert sql statement'

example:
```
Input relNode: 
LogicalProject(name=[$1], score=[$4])
 LogicalJoin(condition=[AND(=($0, $3), LIKE($0, 'lucy'))], joinType=[left])
 LogicalTableScan(table=[[db0, user_table]])
 LogicalTableScan(table=[[db0, score_table]])


Expect output sql statement: 
select name, score
from user_table
left join on score_table
and name like 'lucy'

```
this relNode cannot convert sql statement.

I try to debug it, 
`org.apache.calcite.rel.rel2sql.SqlImplementor#convertConditionToSqlNode` may 
forgot to handle this case, which sqlKind is SqlKind.LIKE.

If it is a bug, I am willing to fix it.

Thanks.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Created] (CALCITE-3206) Better error message when param type incompatibility

2019-07-22 Thread jin xing (JIRA)
jin xing created CALCITE-3206:
-

 Summary: Better error message when param type incompatibility
 Key: CALCITE-3206
 URL: https://issues.apache.org/jira/browse/CALCITE-3206
 Project: Calcite
  Issue Type: Improvement
  Components: core
Reporter: jin xing






--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


Re: [DISCUSS] Towards Calcite 1.21.0

2019-07-22 Thread Chunwei Lei
+1 for release at end of August.

> Apart from very important issues it makes sense to treat PRs in FIFO
order.
Contributors who submit a PR early will certainly get discouraged to
contribute again if we never merge these PRs in time.

+1 since it is very important for encouraging contributors.



Best,
Chunwei


On Mon, Jul 22, 2019 at 9:19 AM Danny Chan  wrote:

> >Apart from very important issues it makes sense to treat PRs in FIFO
> order.
> Contributors who submit a PR early will certainly get discouraged to
> contribute again if we never merge these PRs in time.
>
> There are 110+ PRs on the GitHub page, what should we do ?
>
> Best,
> Danny Chan
> 在 2019年7月22日 +0800 AM6:19,dev@calcite.apache.org,写道:
> >
> > Apart from very important issues it makes sense to treat PRs in FIFO
> order.
> > Contributors who submit a PR early will certainly get discouraged to
> > contribute again if we never merge these PRs in time.
>