[GitHub] calcite-avatica-go pull request #14: Clean up readme and remove wercker

2018-04-15 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[GitHub] calcite-avatica-go pull request #14: Clean up readme and remove wercker

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

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

Clean up readme and remove wercker



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

$ git pull https://github.com/Boostport/calcite-avatica-go clean-up

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

https://github.com/apache/calcite-avatica-go/pull/14.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 #14


commit 6378c7f298bc47703eed070fb0eadb03a530d827
Author: Francis Chuang 
Date:   2018-04-16T05:11:02Z

Clean up readme and remove wercker




---


[GitHub] calcite-avatica-go pull request #13: Add HSQLDB support and move phoenix sup...

2018-04-15 Thread asfgit
Github user asfgit closed the pull request at:

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


---


Calcite-Master - Build # 253 - Still Failing

2018-04-15 Thread Apache Jenkins Server
The Apache Jenkins build system has built Calcite-Master (build #253)

Status: Still Failing

Check console output at https://builds.apache.org/job/Calcite-Master/253/ to 
view the results.

[GitHub] calcite-avatica-go pull request #13: Add HSQLDB support and move phoenix sup...

2018-04-15 Thread F21
Github user F21 commented on a diff in the pull request:

https://github.com/apache/calcite-avatica-go/pull/13#discussion_r181619896
  
--- Diff: phoenix/phoenix.go ---
@@ -1,82 +1,105 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to you under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package avatica
+package phoenix
--- End diff --

Good catch! thanks!


---


[GitHub] calcite-avatica-go pull request #13: Add HSQLDB support and move phoenix sup...

2018-04-15 Thread risdenk
Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica-go/pull/13#discussion_r181618280
  
--- Diff: phoenix/phoenix.go ---
@@ -1,82 +1,105 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to you under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package avatica
+package phoenix
--- End diff --

Missing license header?


---


[GitHub] calcite-avatica-go issue #13: Add HSQLDB support and move phoenix support in...

2018-04-15 Thread risdenk
Github user risdenk commented on the issue:

https://github.com/apache/calcite-avatica-go/pull/13
  
Looks like this might have been a false alarm.
```
mkdir -p $HOME/gopath/src/github.com/risdenk/calcite-avatica-go
```

Travis was picking up my username for the gopath and so the packages 
wouldn't match. Looking into this a bit more.

One idea might be to force the go import path so that forks work. 
https://docs.travis-ci.com/user/languages/go/#Go-Import-Path


---


[GitHub] calcite-avatica-go pull request #12: [CALCITE-2258] Add .travis.yml

2018-04-15 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[GitHub] calcite-avatica-go pull request #12: [CALCITE-2258] Add .travis.yml

2018-04-15 Thread F21
Github user F21 commented on a diff in the pull request:

https://github.com/apache/calcite-avatica-go/pull/12#discussion_r181611670
  
--- Diff: .travis.yml ---
@@ -0,0 +1,54 @@
+# Configuration file for Travis continuous integration.
+# See https://travis-ci.org/apache/calcite-avatica-go
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+language: go
+
+branches:
+  only:
+- master
+- /^branch-.*$/
--- End diff --

Ah, I see. Let's keep this the way it is then.


---


[GitHub] calcite-avatica-go pull request #12: [CALCITE-2258] Add .travis.yml

2018-04-15 Thread risdenk
Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica-go/pull/12#discussion_r181610048
  
--- Diff: .travis.yml ---
@@ -0,0 +1,54 @@
+# Configuration file for Travis continuous integration.
+# See https://travis-ci.org/apache/calcite-avatica-go
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+language: go
+
+branches:
+  only:
+- master
+- /^branch-.*$/
+- /^[0-9]+-.*$/
+
+go:
+  - "1.10.x"
+
+sudo: required
+services:
+  - docker
+
+env:
+  global:
+  - AVATICA_IMAGE=boostport/hbase-phoenix-all-in-one:1.3-4.13
+  - AVATICA_HOST=http://localhost:8765
+
+before_install:
+  - go get -u github.com/golang/dep/cmd/dep
+  - dep ensure -v
+  - docker pull $AVATICA_IMAGE
+  - docker run -d -p 8765:8765 $AVATICA_IMAGE
+  - docker ps -a
+
+install:
+  - go build
+
+script:
+  - go test -cover -v $(go list ./... | grep -v /vendor/)
--- End diff --

Just updated and pushed.


---


[GitHub] calcite-avatica-go pull request #12: [CALCITE-2258] Add .travis.yml

2018-04-15 Thread risdenk
Github user risdenk commented on a diff in the pull request:

https://github.com/apache/calcite-avatica-go/pull/12#discussion_r181610032
  
--- Diff: .travis.yml ---
@@ -0,0 +1,54 @@
+# Configuration file for Travis continuous integration.
+# See https://travis-ci.org/apache/calcite-avatica-go
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+language: go
+
+branches:
+  only:
+- master
+- /^branch-.*$/
--- End diff --

I tried to match what was in calcite and calcite-avatica. It is the exact 
same from those repos. Pull requests will get tested regardless of branch name.


---


[jira] [Created] (CALCITE-2259) Allow Java 8 syntax in source files

2018-04-15 Thread Julian Hyde (JIRA)
Julian Hyde created CALCITE-2259:


 Summary: Allow Java 8 syntax in source files
 Key: CALCITE-2259
 URL: https://issues.apache.org/jira/browse/CALCITE-2259
 Project: Calcite
  Issue Type: Bug
Reporter: Julian Hyde
Assignee: Julian Hyde


Allow Java 8 syntax in source files.

In core/pom.xml, I tried changing {{source=1.7 target=1.8}} to {{source=8 
target=8}} but I ran into [Janino issue 
47|https://github.com/janino-compiler/janino/issues/47]. (Thanks, 
[~vvysotskyi], for logging that issue.)

When this is fixed, we will be able to use lambdas ({{->}}).

 



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


[GitHub] calcite-avatica-go pull request #13: Add HSQLDB support and move phoenix sup...

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

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

Add HSQLDB support and move phoenix support into an adapter



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

$ git pull https://github.com/Boostport/calcite-avatica-go 
avatica-hsqldb-support

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

https://github.com/apache/calcite-avatica-go/pull/13.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 #13


commit 2e931c643d5a4b46c17dd52b28d5a0db3133d0a3
Author: Francis Chuang 
Date:   2018-04-15T04:27:20Z

Add HSQLDB support and move phoenix support into an adapter




---


[GitHub] calcite-avatica-go pull request #12: [CALCITE-2258] Add .travis.yml

2018-04-15 Thread F21
Github user F21 commented on a diff in the pull request:

https://github.com/apache/calcite-avatica-go/pull/12#discussion_r181600746
  
--- Diff: .travis.yml ---
@@ -0,0 +1,54 @@
+# Configuration file for Travis continuous integration.
+# See https://travis-ci.org/apache/calcite-avatica-go
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+language: go
+
+branches:
+  only:
+- master
+- /^branch-.*$/
--- End diff --

I think instead of these regexes, we can just use `/.*/


---


[GitHub] calcite-avatica-go pull request #12: [CALCITE-2258] Add .travis.yml

2018-04-15 Thread F21
Github user F21 commented on a diff in the pull request:

https://github.com/apache/calcite-avatica-go/pull/12#discussion_r181600756
  
--- Diff: .travis.yml ---
@@ -0,0 +1,54 @@
+# Configuration file for Travis continuous integration.
+# See https://travis-ci.org/apache/calcite-avatica-go
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+language: go
+
+branches:
+  only:
+- master
+- /^branch-.*$/
+- /^[0-9]+-.*$/
+
+go:
+  - "1.10.x"
+
+sudo: required
+services:
+  - docker
+
+env:
+  global:
+  - AVATICA_IMAGE=boostport/hbase-phoenix-all-in-one:1.3-4.13
+  - AVATICA_HOST=http://localhost:8765
+
+before_install:
+  - go get -u github.com/golang/dep/cmd/dep
+  - dep ensure -v
+  - docker pull $AVATICA_IMAGE
+  - docker run -d -p 8765:8765 $AVATICA_IMAGE
+  - docker ps -a
+
+install:
+  - go build
+
+script:
+  - go test -cover -v $(go list ./... | grep -v /vendor/)
--- End diff --

We can now use `go test -cover -v ./...` because newer versions of Go will 
no longer test repos in `/vendor/`.


---


[GitHub] calcite-avatica-go pull request #12: [CALCITE-2258] Add .travis.yml

2018-04-15 Thread risdenk
GitHub user risdenk opened a pull request:

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

[CALCITE-2258] Add .travis.yml

Addes .travis.yml based on existing wercker.yml.

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

$ git pull https://github.com/risdenk/calcite-avatica-go CALCITE-2258

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

https://github.com/apache/calcite-avatica-go/pull/12.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 #12


commit b381215f9cb1c0c0792f106cdccd2b6bcb0f1130
Author: Kevin Risden 
Date:   2018-04-15T18:55:42Z

[CALCITE-2258] Add .travis.yml




---


[GitHub] calcite-avatica-go pull request #11: Add .travis.yml

2018-04-15 Thread risdenk
Github user risdenk closed the pull request at:

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


---


[jira] [Created] (CALCITE-2258) Avatica Go - .travis.yml

2018-04-15 Thread Kevin Risden (JIRA)
Kevin Risden created CALCITE-2258:
-

 Summary: Avatica Go - .travis.yml
 Key: CALCITE-2258
 URL: https://issues.apache.org/jira/browse/CALCITE-2258
 Project: Calcite
  Issue Type: Improvement
  Components: avatica-go
Reporter: Kevin Risden
Assignee: Kevin Risden


Adding .travis.yml to test avatica-go



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


[GitHub] calcite-avatica-go issue #11: Add .travis.yml

2018-04-15 Thread risdenk
Github user risdenk commented on the issue:

https://github.com/apache/calcite-avatica-go/pull/11
  
Closing since this was a test.


---


[GitHub] calcite-avatica-go pull request #11: Add .travis.yml

2018-04-15 Thread risdenk
GitHub user risdenk opened a pull request:

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

Add .travis.yml



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

$ git pull https://github.com/risdenk/calcite-avatica-go testtravis

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

https://github.com/apache/calcite-avatica-go/pull/11.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 #11


commit ed1db9bede7aa9e90cdbe6b6e5444ac37d5ea19e
Author: Kevin Risden 
Date:   2018-04-15T18:55:42Z

Add .travis.yml




---


[jira] [Created] (CALCITE-2257) Combination of predicates can be proved to be always true

2018-04-15 Thread Vitalii Diravka (JIRA)
Vitalii Diravka created CALCITE-2257:


 Summary: Combination of predicates can be proved to be always true
 Key: CALCITE-2257
 URL: https://issues.apache.org/jira/browse/CALCITE-2257
 Project: Calcite
  Issue Type: Improvement
  Components: core
Affects Versions: 1.16.0
Reporter: Vitalii Diravka
Assignee: Vitalii Diravka
 Fix For: 1.17.0


I have found the case, when Filter operator is not necessary since filter 
condition is always true, but that is not detected by current version of 
Calcite.
{code}
select SAL from EMPNULLABLES_20 where SAL IS NOT NULL OR SAL is null
{code}
{code}
LogicalProject(SAL=[$5])
  LogicalFilter(condition=[OR(IS NOT NULL($5), IS NULL($5))])
LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], 
SAL=[$5], COMM=[$6], SLACKER=[$8])
  LogicalFilter(condition=[AND(=($7, 20), >($5, 1000))])
LogicalTableScan(table=[[CATALOG, SALES, EMPNULLABLES]])
{code}
But filter condition _OR(IS NOT NULL($5), IS NULL($5))_ can be proved to be 
always true.
I have tried _ReduceExpressionsRule_, but it doesn't give effect.



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


Re: JDK 8 syntax

2018-04-15 Thread Enrico Olivelli
Il dom 15 apr 2018, 14:22 Vova Vysotskyi  ha scritto:

> I have reproduced it in Janino only and created the issue:
> https://github.com/janino-compiler/janino/issues/47


Great work Vova,
Thank you

Enrico



>
>
>
> Kind regards,
> Volodymyr Vysotskyi
>
> 2018-04-14 20:15 GMT+03:00 Vova Vysotskyi :
>
> > Ok, I will try to prepare a test case and will log a bug on Janino soon.
> >
> > Kind regards,
> > Volodymyr Vysotskyi
> >
> > 2018-04-14 20:02 GMT+03:00 Julian Hyde :
> >
> >> Vova,
> >>
> >> Thanks for doing the research. Your explanation sounds very plausible
> >> (I suspected default methods, too). Can you please log a bug on
> >> JANINO? https://github.com/janino-compiler/janino/issues Arno, the
> >> project maintainer, has been very good to us over the years.
> >>
> >> Julian
> >>
> >>
> >> On Sat, Apr 14, 2018 at 9:28 AM, Enrico Olivelli 
> >> wrote:
> >> > Il sab 14 apr 2018, 18:20 Enrico Olivelli  ha
> >> scritto:
> >> >
> >> >>
> >> >>
> >> >> Il sab 14 apr 2018, 17:39 Vova Vysotskyi  ha
> >> scritto:
> >> >>
> >> >>> Hi all,
> >> >>>
> >> >>> I think the reason for this issue is that at the compile stage was
> >> assumed
> >> >>> that *getSubSchema()* method returns *Schema *inheritor, but not
> >> >>> *SchemaPlus*.
> >> >>> But the interesting thing is that with Java 8, methods list of
> >> >>> *SchemaPlus *interface
> >> >>> contains default *getSubSchema()* method.
> >> >>> It may be observed by executing this code:
> >> >>> *Method[] declaredMethods =
> >> >>>
> >> >>> Class.forName("org.apache.calcite.schema.SchemaPlus").getDec
> >> laredMethods();*
> >> >>> *for (Method m : declaredMethods) {*
> >> >>> *  if (m.getName().equals("getSubSchema")) {*
> >> >>> *System.out.println(m);*
> >> >>> *  }*
> >> >>> *}*
> >> >>>
> >> >>> Its output:
> >> >>>
> >> >>> *public default org.apache.calcite.schema.Schema
> >> >>> org.apache.calcite.schema.SchemaPlus.getSubSchema(java.lang.String)*
> >> >>> *public abstract org.apache.calcite.schema.SchemaPlus
> >> >>> org.apache.calcite.schema.SchemaPlus.getSubSchema(java.lang.String)*
> >> >>>
> >> >>> The output of the same code for Java 7:
> >> >>>
> >> >>> *public abstract org.apache.calcite.schema.SchemaPlus
> >> >>> org.apache.calcite.schema.SchemaPlus.getSubSchema(java.lang.String)*
> >> >>>
> >> >>> Kind regards,
> >> >>> Volodymyr Vysotskyi
> >> >>>
> >> >>
> >> >> Good catch!
> >> >> It would be useful to look into that 'default' method by
> disassembling
> >> >> .class file.
> >> >> Enrico
> >> >>
> >> >
> >> > Anyway a fix would be to add an unwrap method to Schema
> >> > Cheers
> >> > Enrico
> >> >
> >> >
> >> >>
> >> >>
> >> >>> 2018-04-10 18:43 GMT+03:00 Julian Hyde :
> >> >>>
> >> >>> > I’d really appreciate that.
> >> >>> >
> >> >>> > Can you please log a JIRA case, and record your
> >> observations/progress
> >> >>> > there.
> >> >>> >
> >> >>> > There’s no particular hurry on this one.
> >> >>> >
> >> >>> > Julian
> >> >>> >
> >> >>> > > On Apr 10, 2018, at 06:32, Enrico Olivelli  >
> >> >>> wrote:
> >> >>> > >
> >> >>> > > 2018-04-10 13:48 GMT+02:00 Julian Hyde  >:
> >> >>> > >
> >> >>> > >> Yes, that’s it.
> >> >>> > >>
> >> >>> > >> Next step would be to check whether the generated code is the
> >> same as
> >> >>> > >> previously, and if so, it is a Janino bug. Then try to create a
> >> >>> minimal
> >> >>> > >> test case for Janino. Maybe we can work around by adding an
> >> explicit
> >> >>> > cast
> >> >>> > >> somewhere.
> >> >>> > >>
> >> >>> > >> Thanks for reproducing this, and trying the Janino upgrade.
> >> >>> > >>
> >> >>> > >
> >> >>> > >
> >> >>> > > Julian,
> >> >>> > > If you have no hurry for this I will be happy to spend some time
> >> in
> >> >>> order
> >> >>> > > to figure out the root cause.
> >> >>> > >
> >> >>> > > I will follow the discussion and jump in when I have some idea.
> >> >>> > >
> >> >>> > > It will be great to have Calcite really built on jdk8 and
> leverage
> >> >>> > lambdas
> >> >>> > >
> >> >>> > >
> >> >>> > > Cheers
> >> >>> > > Enrico
> >> >>> > >
> >> >>> > >
> >> >>> > >
> >> >>> > >>
> >> >>> > >> Julian
> >> >>> > >>
> >> >>> > >>> On Apr 10, 2018, at 3:37 AM, Enrico Olivelli <
> >> eolive...@gmail.com>
> >> >>> > >> wrote:
> >> >>> > >>>
> >> >>> > >>> This is "the" error (see below). Unfortunately just be
> upgrading
> >> >>> Janino
> >> >>> > >> to
> >> >>> > >>> 3.0.8 the problem still is present.
> >> >>> > >>>
> >> >>> > >>> the only 'unwrap'  word in the generated code is here
> >> >>> > >>> ...
> >> >>> > >>> public org.apache.calcite.linq4j.Enumerable bind(final
> >> >>> > >>> org.apache.calcite.DataContext root0) {
> >> >>> > >>> root = root0;
> >> >>> > >>> final org.apache.calcite.linq4j.Enumerable _inputEnumerable =
> >> >>> > >>> 

Re: JDK 8 syntax

2018-04-15 Thread Vova Vysotskyi
I have reproduced it in Janino only and created the issue:
https://github.com/janino-compiler/janino/issues/47

Kind regards,
Volodymyr Vysotskyi

2018-04-14 20:15 GMT+03:00 Vova Vysotskyi :

> Ok, I will try to prepare a test case and will log a bug on Janino soon.
>
> Kind regards,
> Volodymyr Vysotskyi
>
> 2018-04-14 20:02 GMT+03:00 Julian Hyde :
>
>> Vova,
>>
>> Thanks for doing the research. Your explanation sounds very plausible
>> (I suspected default methods, too). Can you please log a bug on
>> JANINO? https://github.com/janino-compiler/janino/issues Arno, the
>> project maintainer, has been very good to us over the years.
>>
>> Julian
>>
>>
>> On Sat, Apr 14, 2018 at 9:28 AM, Enrico Olivelli 
>> wrote:
>> > Il sab 14 apr 2018, 18:20 Enrico Olivelli  ha
>> scritto:
>> >
>> >>
>> >>
>> >> Il sab 14 apr 2018, 17:39 Vova Vysotskyi  ha
>> scritto:
>> >>
>> >>> Hi all,
>> >>>
>> >>> I think the reason for this issue is that at the compile stage was
>> assumed
>> >>> that *getSubSchema()* method returns *Schema *inheritor, but not
>> >>> *SchemaPlus*.
>> >>> But the interesting thing is that with Java 8, methods list of
>> >>> *SchemaPlus *interface
>> >>> contains default *getSubSchema()* method.
>> >>> It may be observed by executing this code:
>> >>> *Method[] declaredMethods =
>> >>>
>> >>> Class.forName("org.apache.calcite.schema.SchemaPlus").getDec
>> laredMethods();*
>> >>> *for (Method m : declaredMethods) {*
>> >>> *  if (m.getName().equals("getSubSchema")) {*
>> >>> *System.out.println(m);*
>> >>> *  }*
>> >>> *}*
>> >>>
>> >>> Its output:
>> >>>
>> >>> *public default org.apache.calcite.schema.Schema
>> >>> org.apache.calcite.schema.SchemaPlus.getSubSchema(java.lang.String)*
>> >>> *public abstract org.apache.calcite.schema.SchemaPlus
>> >>> org.apache.calcite.schema.SchemaPlus.getSubSchema(java.lang.String)*
>> >>>
>> >>> The output of the same code for Java 7:
>> >>>
>> >>> *public abstract org.apache.calcite.schema.SchemaPlus
>> >>> org.apache.calcite.schema.SchemaPlus.getSubSchema(java.lang.String)*
>> >>>
>> >>> Kind regards,
>> >>> Volodymyr Vysotskyi
>> >>>
>> >>
>> >> Good catch!
>> >> It would be useful to look into that 'default' method by disassembling
>> >> .class file.
>> >> Enrico
>> >>
>> >
>> > Anyway a fix would be to add an unwrap method to Schema
>> > Cheers
>> > Enrico
>> >
>> >
>> >>
>> >>
>> >>> 2018-04-10 18:43 GMT+03:00 Julian Hyde :
>> >>>
>> >>> > I’d really appreciate that.
>> >>> >
>> >>> > Can you please log a JIRA case, and record your
>> observations/progress
>> >>> > there.
>> >>> >
>> >>> > There’s no particular hurry on this one.
>> >>> >
>> >>> > Julian
>> >>> >
>> >>> > > On Apr 10, 2018, at 06:32, Enrico Olivelli 
>> >>> wrote:
>> >>> > >
>> >>> > > 2018-04-10 13:48 GMT+02:00 Julian Hyde :
>> >>> > >
>> >>> > >> Yes, that’s it.
>> >>> > >>
>> >>> > >> Next step would be to check whether the generated code is the
>> same as
>> >>> > >> previously, and if so, it is a Janino bug. Then try to create a
>> >>> minimal
>> >>> > >> test case for Janino. Maybe we can work around by adding an
>> explicit
>> >>> > cast
>> >>> > >> somewhere.
>> >>> > >>
>> >>> > >> Thanks for reproducing this, and trying the Janino upgrade.
>> >>> > >>
>> >>> > >
>> >>> > >
>> >>> > > Julian,
>> >>> > > If you have no hurry for this I will be happy to spend some time
>> in
>> >>> order
>> >>> > > to figure out the root cause.
>> >>> > >
>> >>> > > I will follow the discussion and jump in when I have some idea.
>> >>> > >
>> >>> > > It will be great to have Calcite really built on jdk8 and leverage
>> >>> > lambdas
>> >>> > >
>> >>> > >
>> >>> > > Cheers
>> >>> > > Enrico
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > >>
>> >>> > >> Julian
>> >>> > >>
>> >>> > >>> On Apr 10, 2018, at 3:37 AM, Enrico Olivelli <
>> eolive...@gmail.com>
>> >>> > >> wrote:
>> >>> > >>>
>> >>> > >>> This is "the" error (see below). Unfortunately just be upgrading
>> >>> Janino
>> >>> > >> to
>> >>> > >>> 3.0.8 the problem still is present.
>> >>> > >>>
>> >>> > >>> the only 'unwrap'  word in the generated code is here
>> >>> > >>> ...
>> >>> > >>> public org.apache.calcite.linq4j.Enumerable bind(final
>> >>> > >>> org.apache.calcite.DataContext root0) {
>> >>> > >>> root = root0;
>> >>> > >>> final org.apache.calcite.linq4j.Enumerable _inputEnumerable =
>> >>> > >>> org.apache.calcite.linq4j.Linq4j.asEnumerable(((org.
>> >>> > apache.calcite.test.
>> >>> > >> ReflectiveSchemaTest.CatchallSchema)
>> >>> > >>> ((org.apache.calcite.adapter.java.ReflectiveSchema)
>> >>> > >>> root.getRootSchema().getSubSchema("s").unwrap(org.
>> >>> > >> apache.calcite.adapter.java.ReflectiveSchema.class)).
>> >>> > >> getTarget()).nullables);
>> >>> > >>> 
>> >>> > >>>
>> >>> > >>> Does any ring bell ?
>> >>> > >>>
>> >>> > >>> Enrico

[jira] [Created] (CALCITE-2256) Exception in Druid Adapter: JsonSegmentMetadata, numRows field out of range

2018-04-15 Thread SaschaC (JIRA)
SaschaC created CALCITE-2256:


 Summary: Exception in Druid Adapter: JsonSegmentMetadata, numRows 
field out of range
 Key: CALCITE-2256
 URL: https://issues.apache.org/jira/browse/CALCITE-2256
 Project: Calcite
  Issue Type: Bug
  Components: druid
Affects Versions: 1.16.0
Reporter: SaschaC
Assignee: Julian Hyde


When trying to connect to a Druid datasource, Calcite pulls metadata from Druid 
as a first action. As Druid is a database for big-data, it is not uncommon that 
a datasource would contain billions of records. The metadata about a datasource 
returns a records count, namely the total number of records residing in that 
datasource. This is returned in a property named "numRows".

The Calcite Druid Adapter tries to read the numRows field (that Druid returns 
within the response Json document of a metadata request) into an integer field 
which overflows for record counts bigger than 4 billion and triggers the below 
exception

{code}

Caused by: com.fasterxml.jackson.databind.JsonMappingException: Numeric value 
(13452491153) out of range of int
 at [Source: (sun.net.www.protocol.http.HttpURLConnection$HttpInputStream); 
line: 565, column: 26]
 at [Source: (sun.net.www.protocol.http.HttpURLConnection$HttpInputStream); 
line: 565, column: 15] (through reference chain: 
java.util.ArrayList[0]->org.apache.calcite.adapter.druid.DruidConnectionImpl$JsonSegmentMetadata["numRows"])

{code}

In class org.apache.calcite.adapter.druid,*DruidConnectionImpl*, inner class 
JsonSegmentMetadata has integer fields for reading in Druid metadata like size 
or numRows which aught to be of type *long* so that they can hold larger 
numbers:

{code}

private static class JsonSegmentMetadata {
  public String id;
  public List intervals;
  public Map columns;
  *public int size;*
  *public int numRows;*
  public Map aggregators;
}

{code}



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