[
https://issues.apache.org/jira/browse/ARROW-1741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16340320#comment-16340320
]
Panchen Xue commented on ARROW-1741:
------------------------------------
Is the following pseudocode correct?
{code:java}
std::shared_ptr<DictionaryArray> small;
std::shared_ptr<DictionaryArray> large;
/*
bool RangeEquals(int64_t start_idx,
int64_t end_idx,
int64_t other_start_idx,
const std::shared_ptr<Array>& other) const;
*/
if (small->RangeEquals(0, small->size() , 0, large)) {
// SetDictionary() to be implemented
small->SetDictionary(large->dictionary());
}
{code}
> [C++] Comparison function for DictionaryArray to determine if indices are
> "compatible"
> --------------------------------------------------------------------------------------
>
> Key: ARROW-1741
> URL: https://issues.apache.org/jira/browse/ARROW-1741
> Project: Apache Arrow
> Issue Type: New Feature
> Components: C++
> Reporter: Wes McKinney
> Priority: Major
>
> For example, if one array's dictionary is larger than the other, but the
> overlapping beginning portion is the same, then the respective dictionary
> indices correspond to the same values. Therefore, in analytics, one may
> choose to drop the smaller dictionary in favor of the larger dictionary, and
> this need not incur any computational overhead (beyond comparing the
> dictionary prefixes -- there may be some way to engineer "dictionary lineage"
> to make this comparison even cheaper)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)