calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrew <and...@primer.org>
Subject Re: UNION Type in Calcite
Date Thu, 17 Dec 2015 00:23:07 GMT
That sounds like it might fit the bill. Thanks Julien.


> On Dec 16, 2015, at 1:30 PM, Julian Hyde <jhyde.apache@gmail.com> wrote:
> 
> You could declare a STRUCT(i INT, ai ARRAY(INT)) and make sure exactly one of i and ai
is set.
> 
>> On Dec 16, 2015, at 10:51 AM, andrew <andrew@primer.org> wrote:
>> 
>> I’m wondering if it would be possible to add a UNION type in Calcite. 
>> 
>> My use case is that I am developing a backend storage engine using Calcite that only
partially declares its schema. Specifically, the engine declares columns such as ‘int’
when it actually means the column can contain ‘int’ or ‘array of int’. There is no
way to tell without actually reading the table if the data is scalar or array. Indeed it can
be both.
>> 
>> My idea is that if Calcite had a UNION type, I could declare the columns as e.g.
UNION(INT, ARRAY(INT)).
>> 
>> Does this sound reasonable? Or is there a better way of handling this situation using
the current features of Calcite?
>> 
>> Thanks.
>> - A
>> 
>> 
> 


Mime
View raw message