You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Jesus Camachorodriguez <jc...@hortonworks.com> on 2015/03/11 02:53:19 UTC

Exception in CachingRelMetadataProvider

Hello,

I was doing tests on CBO branch in Hive with the latest Calcite snapshot, and there is the following Exception that shows up now:

java.lang.NullPointerException
at org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocationHandler.invoke(CachingRelMetadataProvider.java:111)
at com.sun.proxy.$Proxy32.rel(Unknown Source)
at org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocationHandler.invoke(CachingRelMetadataProvider.java:111)
at com.sun.proxy.$Proxy32.distribution(Unknown Source)
at org.apache.calcite.rel.metadata.RelMetadataQuery.distribution(RelMetadataQuery.java:310)
at org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.obtainJoinAlgorithms(HiveJoin.java:257)
at org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.chooseJoinAlgorithmAndGetCost(HiveJoin.java:148)
at org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.computeSelfCost(HiveJoin.java:140)
at org.apache.calcite.rel.metadata.RelMdPercentageOriginalRows.getNonCumulativeCost(RelMdPercentageOriginalRows.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.calcite.rel.metadata.ReflectiveRelMetadataProvider$2$1.invoke(ReflectiveRelMetadataProvider.java:194)
at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.calcite.rel.metadata.ChainedRelMetadataProvider$ChainedInvocationHandler.invoke(ChainedRelMetadataProvider.java:109)
at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocationHandler.invoke(CachingRelMetadataProvider.java:131)
at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
at org.apache.calcite.rel.metadata.RelMetadataQuery.getNonCumulativeCost(RelMetadataQuery.java:115)
...

Any feedback on this problem?

Thanks,
Jesús


Re: Exception in CachingRelMetadataProvider

Posted by Julian Hyde <ju...@gmail.com>.
You wouldn't be the first, or the last, to do this. If you put in some
asserts/tracing that made it easier to track down, please contribute
them.

On Wed, Mar 11, 2015 at 4:25 PM, Jesus Camachorodriguez
<jc...@hortonworks.com> wrote:
> It seems one of the MD providers was not being initialized properly.
>
> Thanks Julian,
> Jesús
>
>
>
> On 3/11/15, 10:00 AM, "Julian Hyde" <ju...@hydromatic.net> wrote:
>
>>It looks as if the metadata field of CachingInvocationHandler is null.
>>I'm pretty sure that it should not be. Can you change its constructor from
>>
>>public CachingInvocationHandler(Metadata metadata) {
>>  this.metadata = metadata;
>>}
>>
>>to
>>
>>public CachingInvocationHandler(Metadata metadata) {
>>  this.metadata = Preconditions.checkNotNull(metadata);
>>}
>>
>>and work backwards to find out who is giving the bad metadata. Probably
>>one of your providers is badly written.
>>
>>Julian
>>
>>
>>> On Mar 10, 2015, at 6:53 PM, Jesus Camachorodriguez
>>><jc...@hortonworks.com> wrote:
>>>
>>> Hello,
>>>
>>> I was doing tests on CBO branch in Hive with the latest Calcite
>>>snapshot, and there is the following Exception that shows up now:
>>>
>>> java.lang.NullPointerException
>>> at
>>>org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocat
>>>ionHandler.invoke(CachingRelMetadataProvider.java:111)
>>> at com.sun.proxy.$Proxy32.rel(Unknown Source)
>>> at
>>>org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocat
>>>ionHandler.invoke(CachingRelMetadataProvider.java:111)
>>> at com.sun.proxy.$Proxy32.distribution(Unknown Source)
>>> at
>>>org.apache.calcite.rel.metadata.RelMetadataQuery.distribution(RelMetadata
>>>Query.java:310)
>>> at
>>>org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.obtainJ
>>>oinAlgorithms(HiveJoin.java:257)
>>> at
>>>org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.chooseJ
>>>oinAlgorithmAndGetCost(HiveJoin.java:148)
>>> at
>>>org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.compute
>>>SelfCost(HiveJoin.java:140)
>>> at
>>>org.apache.calcite.rel.metadata.RelMdPercentageOriginalRows.getNonCumulat
>>>iveCost(RelMdPercentageOriginalRows.java:165)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
>>>:57)
>>> at
>>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
>>>mpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:606)
>>> at
>>>org.apache.calcite.rel.metadata.ReflectiveRelMetadataProvider$2$1.invoke(
>>>ReflectiveRelMetadataProvider.java:194)
>>> at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
>>>:57)
>>> at
>>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
>>>mpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:606)
>>> at
>>>org.apache.calcite.rel.metadata.ChainedRelMetadataProvider$ChainedInvocat
>>>ionHandler.invoke(ChainedRelMetadataProvider.java:109)
>>> at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
>>>:57)
>>> at
>>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
>>>mpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:606)
>>> at
>>>org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocat
>>>ionHandler.invoke(CachingRelMetadataProvider.java:131)
>>> at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
>>> at
>>>org.apache.calcite.rel.metadata.RelMetadataQuery.getNonCumulativeCost(Rel
>>>MetadataQuery.java:115)
>>> ...
>>>
>>> Any feedback on this problem?
>>>
>>> Thanks,
>>> Jesús
>>>
>>
>

Re: Exception in CachingRelMetadataProvider

Posted by Jesus Camachorodriguez <jc...@hortonworks.com>.
It seems one of the MD providers was not being initialized properly.

Thanks Julian,
Jesús



On 3/11/15, 10:00 AM, "Julian Hyde" <ju...@hydromatic.net> wrote:

>It looks as if the metadata field of CachingInvocationHandler is null.
>I'm pretty sure that it should not be. Can you change its constructor from
>
>public CachingInvocationHandler(Metadata metadata) {
>  this.metadata = metadata;
>}
>
>to
>
>public CachingInvocationHandler(Metadata metadata) {
>  this.metadata = Preconditions.checkNotNull(metadata);
>}
>
>and work backwards to find out who is giving the bad metadata. Probably
>one of your providers is badly written.
>
>Julian
>
>
>> On Mar 10, 2015, at 6:53 PM, Jesus Camachorodriguez
>><jc...@hortonworks.com> wrote:
>> 
>> Hello,
>> 
>> I was doing tests on CBO branch in Hive with the latest Calcite
>>snapshot, and there is the following Exception that shows up now:
>> 
>> java.lang.NullPointerException
>> at 
>>org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocat
>>ionHandler.invoke(CachingRelMetadataProvider.java:111)
>> at com.sun.proxy.$Proxy32.rel(Unknown Source)
>> at 
>>org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocat
>>ionHandler.invoke(CachingRelMetadataProvider.java:111)
>> at com.sun.proxy.$Proxy32.distribution(Unknown Source)
>> at 
>>org.apache.calcite.rel.metadata.RelMetadataQuery.distribution(RelMetadata
>>Query.java:310)
>> at 
>>org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.obtainJ
>>oinAlgorithms(HiveJoin.java:257)
>> at 
>>org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.chooseJ
>>oinAlgorithmAndGetCost(HiveJoin.java:148)
>> at 
>>org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.compute
>>SelfCost(HiveJoin.java:140)
>> at 
>>org.apache.calcite.rel.metadata.RelMdPercentageOriginalRows.getNonCumulat
>>iveCost(RelMdPercentageOriginalRows.java:165)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at 
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
>>:57)
>> at 
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
>>mpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:606)
>> at 
>>org.apache.calcite.rel.metadata.ReflectiveRelMetadataProvider$2$1.invoke(
>>ReflectiveRelMetadataProvider.java:194)
>> at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at 
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
>>:57)
>> at 
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
>>mpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:606)
>> at 
>>org.apache.calcite.rel.metadata.ChainedRelMetadataProvider$ChainedInvocat
>>ionHandler.invoke(ChainedRelMetadataProvider.java:109)
>> at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at 
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
>>:57)
>> at 
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
>>mpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:606)
>> at 
>>org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocat
>>ionHandler.invoke(CachingRelMetadataProvider.java:131)
>> at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
>> at 
>>org.apache.calcite.rel.metadata.RelMetadataQuery.getNonCumulativeCost(Rel
>>MetadataQuery.java:115)
>> ...
>> 
>> Any feedback on this problem?
>> 
>> Thanks,
>> Jesús
>> 
>


Re: Exception in CachingRelMetadataProvider

Posted by Julian Hyde <ju...@hydromatic.net>.
It looks as if the metadata field of CachingInvocationHandler is null. I'm pretty sure that it should not be. Can you change its constructor from

public CachingInvocationHandler(Metadata metadata) {
  this.metadata = metadata;
}

to

public CachingInvocationHandler(Metadata metadata) {
  this.metadata = Preconditions.checkNotNull(metadata);
}

and work backwards to find out who is giving the bad metadata. Probably one of your providers is badly written.

Julian


> On Mar 10, 2015, at 6:53 PM, Jesus Camachorodriguez <jc...@hortonworks.com> wrote:
> 
> Hello,
> 
> I was doing tests on CBO branch in Hive with the latest Calcite snapshot, and there is the following Exception that shows up now:
> 
> java.lang.NullPointerException
> at org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocationHandler.invoke(CachingRelMetadataProvider.java:111)
> at com.sun.proxy.$Proxy32.rel(Unknown Source)
> at org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocationHandler.invoke(CachingRelMetadataProvider.java:111)
> at com.sun.proxy.$Proxy32.distribution(Unknown Source)
> at org.apache.calcite.rel.metadata.RelMetadataQuery.distribution(RelMetadataQuery.java:310)
> at org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.obtainJoinAlgorithms(HiveJoin.java:257)
> at org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.chooseJoinAlgorithmAndGetCost(HiveJoin.java:148)
> at org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin.computeSelfCost(HiveJoin.java:140)
> at org.apache.calcite.rel.metadata.RelMdPercentageOriginalRows.getNonCumulativeCost(RelMdPercentageOriginalRows.java:165)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.calcite.rel.metadata.ReflectiveRelMetadataProvider$2$1.invoke(ReflectiveRelMetadataProvider.java:194)
> at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.calcite.rel.metadata.ChainedRelMetadataProvider$ChainedInvocationHandler.invoke(ChainedRelMetadataProvider.java:109)
> at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.calcite.rel.metadata.CachingRelMetadataProvider$CachingInvocationHandler.invoke(CachingRelMetadataProvider.java:131)
> at com.sun.proxy.$Proxy25.getNonCumulativeCost(Unknown Source)
> at org.apache.calcite.rel.metadata.RelMetadataQuery.getNonCumulativeCost(RelMetadataQuery.java:115)
> ...
> 
> Any feedback on this problem?
> 
> Thanks,
> Jesús
>