You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "westonpace (via GitHub)" <gi...@apache.org> on 2023/04/11 23:43:25 UTC

[GitHub] [arrow] westonpace commented on issue #34588: [C++][Python] Add compute kernel for "dictionary_decode"

westonpace commented on issue #34588:
URL: https://github.com/apache/arrow/issues/34588#issuecomment-1504276524

   > Hi, where is the code of dictionary_encode in cpp?
   
   This can be done today with the cast function (and I'm pretty sure that is how its done when we need to decode in Acero):
   
   >>> x = pa.array(["a", "a", "b"], pa.dictionary(pa.int8(), pa.string()))
   >>> x
   <pyarrow.lib.DictionaryArray object at 0x7f9eaaf60900>
   
   -- dictionary:
     [
       "a",
       "b"
     ]
   -- indices:
     [
       0,
       0,
       1
     ]
   >>> pc.cast(x, pa.string())
   <pyarrow.lib.StringArray object at 0x7f9eaaf80b20>
   [
     "a",
     "a",
     "b"
   ]
   
   I agree that an explicit `dictionary_decode` alias would be nice.  Maybe we can use a MetaFunction?


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org