[jira] [Commented] (CALCITE-604) Invoke metadata providers via MethodHandle rather than reflection

2016-01-19 Thread Julian Hyde (JIRA)

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

Julian Hyde commented on CALCITE-604:
-

While upgrading, if you get a stack like this:

{noformat}
java.lang.ExceptionInInitializerError
at 
org.apache.calcite.rel.metadata.DefaultRelMetadataProvider.(DefaultRelMetadataProvider.java:36)
at ... 
Caused by: java.lang.ClassCastException: 
org.apache.calcite.rel.metadata.RelMdSomething cannot be cast to 
org.apache.calcite.rel.metadata.MetadataHandler
at 
org.apache.calcite.rel.metadata.ReflectiveRelMetadataProvider.reflectiveSource(ReflectiveRelMetadataProvider.java:119)
at 
org.apache.calcite.rel.metadata.ReflectiveRelMetadataProvider.reflectiveSource(ReflectiveRelMetadataProvider.java:107)
at 
org.apache.calcite.rel.metadata.RelMdPopulationSize.(RelMdPopulationSize.java:41)
... 33 more
{noformat}

you need to add {{implements MetadataHandler}} to 
your provider (say {{RelMdPopulationSize}} needs to implement 
{{MetadataHandler}}.

> Invoke metadata providers via MethodHandle rather than reflection
> -
>
> Key: CALCITE-604
> URL: https://issues.apache.org/jira/browse/CALCITE-604
> Project: Calcite
>  Issue Type: Bug
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>
> JDK 1.7 introduced 
> http://docs.oracle.com/javase/7/docs/api/java/lang/invoke/MethodHandle.html, 
> a more efficient way to invoke methods. Access control etc. is done when the 
> handle is created, not each invocation.
> Currently calls to metadata providers are dispatched via reflection 
> (Method.invoke, see ReflectiveRelMetadataProvider, ChainedRelMetadataProvider 
> and CachingInvocationHandler), and I suspect that planning a complex query 
> (especially with tracing enabled) makes millions of calls. Moving to 
> MethodHandle would improve performance.



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


[jira] [Commented] (CALCITE-917) Add support for EXPLAIN PLAN AS JSON

2016-01-19 Thread Michael Mior (JIRA)

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

Michael Mior commented on CALCITE-917:
--

I thought this would be a fun one to try to tackle to start getting familiar 
with Calcite. So far I managed to extend the grammar to include "AS JSON" and 
I'm just working on actually dumping the JSON output. WIP at 
https://github.com/michaelmior/calcite/tree/917-explain-json

> Add support for EXPLAIN PLAN AS JSON
> 
>
> Key: CALCITE-917
> URL: https://issues.apache.org/jira/browse/CALCITE-917
> Project: Calcite
>  Issue Type: Improvement
>  Components: core
>Reporter: Jacques Nadeau
>  Labels: newbie
>
> Explain plan currently supports outputting text and xml. Let's add an option 
> to explain plan "AS JSON". Drill will definitely plug into this. Other 
> systems could as well.



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


[jira] [Created] (CALCITE-1061) RemoteMetaTest#testRemoteStatementInsert's use of hsqldb isn't guarded

2016-01-19 Thread Josh Elser (JIRA)
Josh Elser created CALCITE-1061:
---

 Summary: RemoteMetaTest#testRemoteStatementInsert's use of hsqldb 
isn't guarded
 Key: CALCITE-1061
 URL: https://issues.apache.org/jira/browse/CALCITE-1061
 Project: Calcite
  Issue Type: Bug
  Components: avatica
Affects Versions: 1.6.0, 1.5.0
Reporter: Josh Elser
Assignee: Josh Elser
Priority: Minor
 Fix For: 1.7.0


I noticed this while looking into some unit test failures.

RemoteMetaTest#testRemoteStatementInsert doesn't include the locking around the 
use of hsqldb. We've noticed that we get really weird errors out of hsqldb when 
multiple test runners are concurrently using it.

I don't think we've had any reports of this test failing on Apache lists, but 
it would be nice to fix.



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


[jira] [Commented] (CALCITE-669) Move from Commons Logging to SLF4J

2016-01-19 Thread Josh Elser (JIRA)

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

Josh Elser commented on CALCITE-669:


I have this mostly working, one thing I'm trying to track down are some 
spurious warnings while running the tests:

{noformat}
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further 
details.
{noformat}

My only guess at this point is that there is some issue with loading things 
with the parallel test runner. Right after the above, we can see the logging is 
set up and functional.

{noformat}
Running org.apache.calcite.avatica.jdbc.JdbcMetaTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec - in 
org.apache.calcite.avatica.jdbc.JdbcMetaTest
2016-01-19 18:25:42,802 [pool-1-thread-3] INFO  - jetty-9.2.7.v20150116
2016-01-19 18:25:42,803 [pool-1-thread-3] INFO  - Started 
ServerConnector@7639fabd{HTTP/1.1}{0.0.0.0:51067}
2016-01-19 18:25:42,803 [pool-1-thread-3] INFO  - Started @771ms
2016-01-19 18:25:42,804 [pool-1-thread-3] INFO  - Service listening on port 
51067.
2016-01-19 18:25:42,804 [pool-1-thread-3] INFO  - jetty-9.2.7.v20150116
2016-01-19 18:25:42,806 [pool-1-thread-3] INFO  - Started 
ServerConnector@7a8c4ce2{HTTP/1.1}{0.0.0.0:51068}
2016-01-19 18:25:42,806 [pool-1-thread-3] INFO  - Started @774ms
2016-01-19 18:25:42,806 [pool-1-thread-3] INFO  - Service listening on port 
51068.
{noformat}

I can say it's functional because this is the format I specified in the 
log4j.properties file. I need to see if there is some sort of work around to 
this -- the parallel tests cause such trouble :\

> Move from Commons Logging to SLF4J
> --
>
> Key: CALCITE-669
> URL: https://issues.apache.org/jira/browse/CALCITE-669
> Project: Calcite
>  Issue Type: Task
>  Components: avatica
>Reporter: Nick Dimiduk
>Assignee: Josh Elser
>Priority: Minor
> Fix For: 1.7.0
>
>
> As mentioned on CALCITE-641, it could be useful to adopt a logging 
> implementation that supports pluggable backends and has 
> [MDC|http://www.slf4j.org/manual.html#mdc] support.



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


[jira] [Commented] (CALCITE-669) Move from Commons Logging to SLF4J

2016-01-19 Thread Josh Elser (JIRA)

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

Josh Elser commented on CALCITE-669:


Argh: http://jira.qos.ch/browse/SLF4J-167 targeted to be fixed in 1.7.14. I'll 
have to see if there is a simple workaround -- it would be a pain to hit this 
when trying to debug a test.

> Move from Commons Logging to SLF4J
> --
>
> Key: CALCITE-669
> URL: https://issues.apache.org/jira/browse/CALCITE-669
> Project: Calcite
>  Issue Type: Task
>  Components: avatica
>Reporter: Nick Dimiduk
>Assignee: Josh Elser
>Priority: Minor
> Fix For: 1.7.0
>
>
> As mentioned on CALCITE-641, it could be useful to adopt a logging 
> implementation that supports pluggable backends and has 
> [MDC|http://www.slf4j.org/manual.html#mdc] support.



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