You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Paul Rogers (JIRA)" <ji...@apache.org> on 2019/03/13 05:27:00 UTC

[jira] [Commented] (DRILL-7096) Develop vector for canonical Map

    [ https://issues.apache.org/jira/browse/DRILL-7096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16791308#comment-16791308 ] 

Paul Rogers commented on DRILL-7096:
------------------------------------

Interesting idea. There are a number of items to consider.

Drill is a SQL engine. JDBC and ODBC are the primary client APIs. These APIs, and relational operators, know how to work on relational structures. Drills "structs" are, in fact, nested tuples. Because of that, users can use things like "unnest" to convert them to relational format.

Would be good to understand the use cases for true maps in a SQL query. For example, what functions that user might want to use?

Another issue is the form of values. Simplest if values are strings. If values can be of mixed types, then the "valuesVector" must be a union vector, and union vectors are very complex, space inefficient, are not fully supported in Drill, and are not well defined in SQL.

> Develop vector for canonical Map<K,V>
> -------------------------------------
>
>                 Key: DRILL-7096
>                 URL: https://issues.apache.org/jira/browse/DRILL-7096
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Igor Guzenko
>            Assignee: Bohdan Kazydub
>            Priority: Major
>
> Canonical Map<K,V> datatype can be represented using combination of three value vectors:
> keysVector - vector for storing keys of each map
> valuesVector - vector for storing values of each map
> offsetsVector - vector for storing of start indexes of next each map
> So it's not very hard to create such Map vector, but there is a major issue with such map representation. It's hard to search maps values by key in such vector, need to investigate some advanced techniques to make such search efficient. Or find other more suitable options to represent map datatype in world of vectors.
> After question about maps, Apache Arrow developers responded that for Java they don't have real Map vector, for now they just have logical Map type definition where they define Map like: List< Struct<key:key_type, value:value_type> >. So implementation of value vector would be useful for Arrow too.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)