Hi Micah, thanks for your suggestion. 
You are right, the mainly difference between FixSizedListVector and ListVector 
is the offsetBuffer, but I think this could be avoided through 
allocateNewSafe() overwrite which calls allocateOffsetBuffer() in 
BaseRepeatedValueVector, in this way, offsetBuffer in FixSizedListVector will 
remain allocator.getEmpty(). 

Meanwhile, we could add getStartIndex(int index)/getEndIndex(int index) API to 
handle read data logic respectively which could be used in getObject(int index) 
or encoding parts. What’s more, no new interface need to be introduced.

What do you think?


Thanks,
Ji Liu


------------------------------------------------------------------
From:Micah Kornfield <emkornfi...@gmail.com>
Send Time:2019年8月11日(星期日) 08:47
To:dev <dev@arrow.apache.org>; Ji Liu <niki...@aliyun.com>
Subject:Re: [DISCUSS][JAVA] Make FixedSizedListVector inherit from ListVector

Hi Ji Liu,
I think have a common interface/base-class for the two makes sense (but don't 
have historical context) from a reading data perspective. 

I think the change would need to be something above BaseRepeatedValueVector, 
since the FixedSizeListVector doesn't contain an offset buffer, and that field 
is contained on BaseRepeatedValueVector.

Thanks,
Micah
On Sat, Aug 10, 2019 at 5:25 PM Ji Liu <niki...@aliyun.com.invalid> wrote:
Hi, all

 While working on the issue to implement dictionary-encoded subfields[1] [2], I 
found FixedSizeListVector not extends ListVector(Thanks Micah pointing this out 
and curious why implemented FixedSizeListVector this way 
 before). Since FixedSizeListVector is a specific case of ListVector, should we 
make former extends the latter to reduce the plenty duplicated logic in these 
two and writer/reader classes? 


 Thanks,
 Ji Liu

 [1] 
https://issues.apache.org/jira/browse/ARROW-1175[2]https://github.com/apache/arrow/pull/4972

Reply via email to