KazydubB commented on issue #1870: DRILL-7359: Add support for DICT type in 
RowSet Framework
URL: https://github.com/apache/drill/pull/1870#issuecomment-548392780
 
 
   @paul-rogers thank you for review. I've made some changes, please take a 
look.
   
   There is a (interface) `DictWriter` similar to what you proposed with the 
exception it `extends` `ArrayWriter`, i.e. when writing a `dict` is assumed to 
be an array of tuples (with `key` and `value` fields) other than a pair of 
arrays. (`DictWriter`'s implementation, `ObjectDictWriter`, actually `extends 
ObjectArrayWriter`).
   
   For reading, there is a (interface) `DictReader` (`extends ColumnReader`) 
introduces 5 new methods:
   ```
   ObjectReader getValueReader(Object key);
   Object get(Object key);
   int size();
   ValueType keyColumnType();
   ObjectType valueColumnType();
   ```
   
   For key/value lookup `getValueReader(Object key)` is used. When a `key` is 
found, `value`'s reader is returned with its position set correspondingly to 
the `key`. In a case there is no such `key` - a special type of `ObjectReader` 
- `org.apache.drill.exec.vector.accessor.reader.NullReader` will be returned.
   
   I am not sure that array access is needed - can't see any use case yet.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to