calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Hyde <jh...@apache.org>
Subject Re: Re-working the metadata framework
Date Wed, 03 Feb 2016 22:30:19 GMT
The fix has been available for review for a couple of weeks now.

Jacques, Vladimir (and anyone else),

Do you need more time to review? If not I’d like to check in.

Julian

> On Jan 22, 2016, at 2:51 PM, Julian Hyde <jhyde@apache.org> wrote:
> 
> 
>> On Jan 22, 2016, at 1:52 PM, Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
wrote:
>> 
>> I want something like
>> 
>> @Setup
>> public void ...
>> 
>> @Benchmark
>> public Object columnUniqueness() {
>> return metadataProvider.getColumnUniqueness(whateverArgs);
>> }
>> 
> 
> RelMetadataTest pretty much does that. Copy it, add the @Benchmark annotations, and maybe
move some code into setup methods.
> 
> 
>> Julian> it sounds like you're
>> Julian>talking about perfect hashing
>> 
>> I am.
>> FIY: switch(String) is compiled to switch(s.hashCode()) kind of thing.
>> Well, the requirements are slightly different, thus map might work
>> better for us.
> 
> I did consider using switch (r.getClass().getName()), except that janino doesn’t support
it. But since we have all of the Class objects when we are compiling the code, we also know
their identity hash codes (i.e. their addresses) and we could construct a perfect hash. We
could replace 
> 
>  switch (relClasses.indexOf(r.getClass())
> 
> with
> 
>  switch (System.identityHashCode(r.getClass()) % 137)
> 
> (replacing 137 with some value chosen by an algorithm)
> 
> Julian


Mime
View raw message