calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Hyde <jh...@apache.org>
Subject Re: JavaTypeFactoryImpl Record class is reused
Date Tue, 12 Jan 2016 06:07:59 GMT
The behavior you are seeing might be intentional. Note that the argument to JavaTypeFactoryImpl.register
is SyntheticRecordType. The intent is to create a record type — internally, a java pojo
class — that has the desired fields to carry around records in generated code.

Usually I think I use RelDataTypeFactoryImpl rather than JavaTypeFactoryImpl, and I think
that does the right thing — checks field names and types before declaring that two types
are equivalent. Not sure why you are ending up with a JavaTypeFactoryImpl.

Julian

> On Jan 11, 2016, at 9:26 PM, Mike Hinchey <hincheymg@gmail.com> wrote:
> 
> I found a problem where I have 2 tables with the same field types, but
> different field names. My table overrides Table.getRowType and uses
> typeFactory.createStructType().  The generated Record class is reused, so
> the field names are wrong for the second table.
> 
> JavaTypeFactoryImpl.register() uses only type and nullable in the key, so I
> was able to fix the problem by adding field.getName() to the key.
> 
> Should I file a bug and PR?
> 
> -Mike


Mime
View raw message