Re: [VOTE] Release apache-calcite-1.9.0 (release candidate 0)

2016-09-16 Thread Julian Hyde
-1 (binding)

Downloaded, checked hashes, LICENSE, NOTICE; built on OS X using JDK 1.8. OK so 
far.

I ran the tests and had one test failure:

Tests run: 267, Failures: 1, Errors: 0, Skipped: 20, Time elapsed: 57.83 sec 
<<< FAILURE! - in org.apache.calcite.test.JdbcTest
testVersion(org.apache.calcite.test.JdbcTest)  Time elapsed: 0.003 sec  <<< 
FAILURE!
java.lang.AssertionError: null
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.assertTrue(Assert.java:41)
at org.junit.Assert.assertTrue(Assert.java:52)
at org.apache.calcite.test.JdbcTest.testVersion(JdbcTest.java:1054)

Other problems:
* README says “1.8.0”, should say “1.9.0”
* Ditto howto.md
* In pom.xml, version.minor is 8.

The last of these cause the JDBC driver to return the wrong version, and 
explains the failure of JdbcTest.testVersion, and is a show-stopper.

Julian


> On Sep 16, 2016, at 2:21 PM, Jesus Camachorodriguez  
> wrote:
> 
> Hi all,
> 
> I have created a build for Apache Calcite 1.9.0, release candidate 0.
> 
> Thanks to everyone who has contributed to this release.
> You can read the release notes here:
> https://github.com/apache/calcite/blob/calcite-1.9.0/site/_docs/history.md
> 
> The commit to be voted upon:
> http://git-wip-us.apache.org/repos/asf/calcite/commit/e371a39
> 
> Its hash is e371a3950094cbf3d974b12f7df87dff4caf47a7.
> 
> The artifacts to be voted on are located here:
> https://dist.apache.org/repos/dist/dev/calcite/apache-calcite-1.9.0-rc0/
> 
> The hashes of the artifacts are as follows:
> src.tar.gz.md5 7f2b61663072de86134ce6fa07ce322a
> src.tar.gz.sha1 0c5fe8f91cc1350142a08673e501e45970162411
> src.zip.md5 b2ab48c904bf2f2df2f3485e72ef6e32
> src.zip.sha1 72af6dfd8f191a3e513f87b7511808744cd4998b
> 
> A staged Maven repository is available for review at:
> https://repository.apache.org/content/repositories/orgapachecalcite-1023
> 
> Release artifacts are signed with the following key:
> https://people.apache.org/keys/committer/jcamacho.asc
> 
> Please vote on releasing this package as Apache Calcite 1.9.0.
> 
> The vote is open for the next 96 hours and passes if a majority of
> at least three +1 PMC votes are cast.
> 
> [ ] +1 Release this package as Apache Calcite 1.9.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 (binding)
> 
> Jesús
> 
> 
> 



[VOTE] Release apache-calcite-1.9.0 (release candidate 0)

2016-09-16 Thread Jesus Camachorodriguez
Hi all,

I have created a build for Apache Calcite 1.9.0, release candidate 0.

Thanks to everyone who has contributed to this release.
You can read the release notes here:
https://github.com/apache/calcite/blob/calcite-1.9.0/site/_docs/history.md

The commit to be voted upon:
http://git-wip-us.apache.org/repos/asf/calcite/commit/e371a39

Its hash is e371a3950094cbf3d974b12f7df87dff4caf47a7.

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

The hashes of the artifacts are as follows:
src.tar.gz.md5 7f2b61663072de86134ce6fa07ce322a
src.tar.gz.sha1 0c5fe8f91cc1350142a08673e501e45970162411
src.zip.md5 b2ab48c904bf2f2df2f3485e72ef6e32
src.zip.sha1 72af6dfd8f191a3e513f87b7511808744cd4998b

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

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

Please vote on releasing this package as Apache Calcite 1.9.0.

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

[ ] +1 Release this package as Apache Calcite 1.9.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 (binding)

Jesús





Error instantiating JsonCustomSchema(name=SALES)

2016-09-16 Thread Indrajith, Katkar Ravi
Hi Team,
Iam exploring the csv examples , when I am trying to connect using jdbc with 
below details I got below error.

JDBC drivers : org.apache.calcite.jdbc.Driver
url : jdbc:calcite:model=c:/csv/target/test-classes/model.json



java.lang.RuntimeException: Error instantiating JsonCustomSchema(name=SALES) at 
org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:220) at 
org.apache.calcite.model.JsonCustomSchema.accept(JsonCustomSchema.java:45) at 
org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:143) at 
org.apache.calcite.model.ModelHandler.(ModelHandler.java:85) at 
org.apache.calcite.jdbc.Driver$1.onConnectionInit(Driver.java:104) at 
org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:145)
 at java.sql.DriverManager.getConnection(Unknown Source) at 
java.sql.DriverManager.getConnection(Unknown Source) at


thanks,
Ravi K


Re: [2/2] calcite git commit: Release notes

2016-09-16 Thread Julian Hyde
I've pushed a new web site based on this change so people can review
Jesus' draft release notes:
http://calcite.apache.org/docs/history.html

You can also see the operator precedence table I added to the SQL
reference as part of CALCITE-1095:
http://calcite.apache.org/docs/reference.html#operator-precedence

Julian

On Fri, Sep 16, 2016 at 2:52 AM,   wrote:
> Release notes
>
>
> Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
> Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/5339996e
> Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/5339996e
> Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/5339996e
>
> Branch: refs/heads/branch-1.9
> Commit: 5339996e00655166da7730bb3816529134418ee6
> Parents: 2be3421
> Author: Jesus Camacho Rodriguez 
> Authored: Fri Sep 16 11:52:07 2016 +0200
> Committer: Jesus Camacho Rodriguez 
> Committed: Fri Sep 16 11:52:07 2016 +0200
>
> --
>  site/_docs/history.md | 148 +
>  1 file changed, 148 insertions(+)
> --
>
>
> http://git-wip-us.apache.org/repos/asf/calcite/blob/5339996e/site/_docs/history.md
> --
> diff --git a/site/_docs/history.md b/site/_docs/history.md
> index b358d85..5517757 100644
> --- a/site/_docs/history.md
> +++ b/site/_docs/history.md
> @@ -28,6 +28,154 @@ For a full list of releases, see
>  Downloads are available on the
>  [downloads page]({{ site.baseurl }}/downloads/).
>
> +##  href="https://github.com/apache/calcite/releases/tag/calcite-1.9.0;>1.9.0 
> / 2016-09-16
> +{: #v1-9-0}
> +
> +This release includes extensions and fixes for the Druid adapter. New 
> features were
> +added, such as the capability to
> +https://issues.apache.org/jira/browse/CALCITE-1357;>recognize and 
> translate Timeseries and TopN Druid queries.
> +Moreover, this release contains multiple bug fixes over the initial 
> implementation of the
> +adapter. It is worth mentioning that most of these fixes were contributed by 
> Druid developers,
> +which demonstrates the good reception of the adapter by that community.
> +
> +We have added new SQL features too, e.g.,
> +https://issues.apache.org/jira/browse/CALCITE-1309;>support for 
> LATERAL TABLE.
> +There are multiple interesting extensions to the planner rules that should 
> contribute to
> +obtain better plans, such as
> +https://issues.apache.org/jira/browse/CALCITE-1288;>avoiding doing 
> the same join twice
> +in the presence of `COUNT DISTINCT`, or being able to
> +https://issues.apache.org/jira/browse/CALCITE-1220;>simplify the 
> expressions
> +in the plan further. In addition, we implemented a rule to
> +https://issues.apache.org/jira/browse/CALCITE-1334;>convert 
> predicates on `EXTRACT` function calls into date ranges.
> +The rule is not specific to Druid; however, in principle, it will be useful 
> to identify
> +filter conditions on the time dimension of Druid data sources.
> +
> +Finally, the release includes more than thirty bug-fixes, minor enhancements 
> and internal
> +changes to planner rules and APIs.
> +
> +Compatibility: This release is tested
> +on Linux, Mac OS X, Microsoft Windows;
> +using Oracle JDK 1.7, 1.8;
> +Guava versions 14.0 to 19.0;
> +other software versions as specified in `pom.xml`.
> +
> +New Feature
> +
> +* [ href="https://issues.apache.org/jira/browse/CALCITE-1208;>CALCITE-1208]
> +  Improve two-level column structure handling
> +* [ href="https://issues.apache.org/jira/browse/CALCITE-1227;>CALCITE-1227]
> +  Add streaming CSV table (Zhen Wang)
> +* [ href="https://issues.apache.org/jira/browse/CALCITE-1309;>CALCITE-1309]
> +  Support `LATERAL TABLE` (Jark Wu)
> +
> +Druid adapter
> +
> +* [ href="https://issues.apache.org/jira/browse/CALCITE-1292;>CALCITE-1292]
> +  Druid metadata query is very slow (Michael Spector)
> +* [ href="https://issues.apache.org/jira/browse/CALCITE-1324;>CALCITE-1324]
> +  Druid metadata query throws exception if there are non-standard 
> aggregators (Martin Karlsch)
> +* [ href="https://issues.apache.org/jira/browse/CALCITE-1343;>CALCITE-1343]
> +  Broken Druid query
> +* [ href="https://issues.apache.org/jira/browse/CALCITE-1348;>CALCITE-1348]
> +  In Druid adapter, adjust how `SegmentMetadataQuery` is used to detect 
> types (Gian Merlino)
> +* [ href="https://issues.apache.org/jira/browse/CALCITE-1357;>CALCITE-1357]
> +  Recognize Druid `Timeseries` and `TopN` queries in `DruidQuery`
> +* [ href="https://issues.apache.org/jira/browse/CALCITE-1358;>CALCITE-1358]
> +  Push filters on time dimension to Druid
> +
> +Planner rules
> +
> +* [ href="https://issues.apache.org/jira/browse/CALCITE-1220;>CALCITE-1220]
> +  Further extend simplify for reducing expressions
> +* [ 

[jira] [Created] (CALCITE-1377) JdbcTest.testUnicode failure

2016-09-16 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-1377:


 Summary: JdbcTest.testUnicode failure
 Key: CALCITE-1377
 URL: https://issues.apache.org/jira/browse/CALCITE-1377
 Project: Calcite
  Issue Type: Test
Affects Versions: 1.9.0
Reporter: Jesus Camacho Rodriguez
Assignee: Julian Hyde


Test suite fails when running:

{{mvn clean && mvn -Pit install}}

{code}
Results :

Failed tests:
  testUnicode(org.apache.calcite.test.JdbcTest): java.sql.SQLException: Error 
while executing SQL "select * from "employee" where "full_name" = '英国'": From 
line 1, column 15 to line 1, column 24: Table 'employee' not found
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:147)
at 
org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:208)
at 
org.apache.calcite.test.CalciteAssert.assertQuery(CalciteAssert.java:481)
at 
org.apache.calcite.test.CalciteAssert$AssertQuery.throws_(CalciteAssert.java:1242)
at org.apache.calcite.test.JdbcTest.testUnicode(JdbcTest.java:5764)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at 
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at com.sun.proxy.$Proxy0.invoke(Unknown Source)
at 
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
at 
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, 
column 15 to line 1, column 24: Table 'employee' not found
at sun.reflect.GeneratedConstructorAccessor14.newInstance(Unknown 
Source)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at 
org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:405)
at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:799)
at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:784)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:4044)
at 
org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:106)
at 
org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:86)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:865)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:846)
   

Re: overwrite insert syntax

2016-09-16 Thread Arina Yelchiyeva
I used extension to the parser through freemarker template.
I have added parsing SqlInsertWithPartition() for new sql construct (insert
into t2 (c1, c2) partition by (c1) select c1, c2 from t1)
By I keep getting the following error:
PARSE ERROR: Encountered "partition" at line 1, column 30.
Though when I re-write my parsing to use other keyword then insert, for
example, my_insert, everything works fine.
My guess is that default insert parsing in Calcite [1] is done before
custom.
stmt = SqlExplain()
|
  *  stmt = SqlInsert()*
|
stmt = SqlDelete()
|
stmt = SqlUpdate()
|
stmt = SqlMerge()
|
stmt = SqlProcedureCall()

|
   * stmt = SqlInsertWithPartition()*

[1]
https://github.com/apache/calcite/blob/master/core/src/main/codegen/templates/Parser.jj#L1259

Am I doing something wrong?

On Fri, Sep 16, 2016 at 3:33 AM Julian Hyde  wrote:

> Hopefully you know how to make extensions to the parser; see
> https://issues.apache.org/jira/browse/PHOENIX-1706 for instance. You
> can add an extension to INSERT syntax that is an empty string in
> Calcite's version of the parser, something else in your version of the
> parser. You might need to add a new template variable;
> https://issues.apache.org/jira/browse/CALCITE-1241 is an example of a
> change that did that.
>
> On Thu, Sep 15, 2016 at 6:54 AM, Arina Yelchiyeva
>  wrote:
> > Hi all!
> >
> > Calcite supports standard insert syntax. But I need to add partition by
> > clause in it.
> > I've been trying to overwrite it in parser using additional parser
> > statements calls but such calls go after insert in parsing hierarchy. So
> I
> > have been wondering is there a way to overwrite insert syntax?
> >
> > Kind regards
> > Arina
>


[jira] [Created] (CALCITE-1376) Add test that sorts all operators based on precedence and checks their order

2016-09-16 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-1376:


 Summary: Add test that sorts all operators based on precedence and 
checks their order
 Key: CALCITE-1376
 URL: https://issues.apache.org/jira/browse/CALCITE-1376
 Project: Calcite
  Issue Type: Test
  Components: core
Reporter: Jesus Camacho Rodriguez
Assignee: Julian Hyde
Priority: Minor


Per discussion in CALCITE-1095, [~julianhyde] wrote:

{quote}
I think we should have a test that sorts all operators based on precedence and 
checks that they come out in the order that we expect, per 
https://github.com/julianhyde/calcite/blob/1095-not-precedence/site/_docs/reference.md#operator-precedence.
{quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)