timsaucer commented on PR #73:
URL: https://github.com/apache/datafusion-site/pull/73#issuecomment-3132515212

   @paleolimbot I've pushed a [repository 
here](https://github.com/timsaucer/datafusion_extension_type_examples) that 
demonstrates using scalar UDFs for working with UUIDs. Can you take a look at 
[this python 
code](https://github.com/timsaucer/datafusion_extension_type_examples/blob/main/python/examples/example_scalar_udf.py)
 to see if it matches your expectations? 
   
   This is what it generates for me:
   
   ```
   DataFrame()
   
+-----+--------------------------------------+----------------------------------+--------------------------------------+--------------+
   | idx | uuid_string                          | uuid                          
   | uuid_string_round_trip               | uuid_version |
   
+-----+--------------------------------------+----------------------------------+--------------------------------------+--------------+
   | 0   | ab021fa5-66dc-4b26-a959-19fa1a786777 | 
ab021fa566dc4b26a95919fa1a786777 | ab021fa5-66dc-4b26-a959-19fa1a786777 | 4     
       |
   | 1   | 73faefe0-86dc-4a28-ae95-9c57a97b20ea | 
73faefe086dc4a28ae959c57a97b20ea | 73faefe0-86dc-4a28-ae95-9c57a97b20ea | 4     
       |
   | 2   | 4b7e9127-4eff-499d-bb5c-fc903076c676 | 
4b7e91274eff499dbb5cfc903076c676 | 4b7e9127-4eff-499d-bb5c-fc903076c676 | 4     
       |
   | 3   | 7d80a455-10a1-4329-9498-cf8124ca57cf | 
7d80a45510a143299498cf8124ca57cf | 7d80a455-10a1-4329-9498-cf8124ca57cf | 4     
       |
   | 4   | efa5e79e-b57f-4b9e-9d20-7cefabe5db05 | 
efa5e79eb57f4b9e9d207cefabe5db05 | efa5e79e-b57f-4b9e-9d20-7cefabe5db05 | 4     
       |
   | 5   | 3760dcd8-8513-4164-a55f-652069ce0d5b | 
3760dcd885134164a55f652069ce0d5b | 3760dcd8-8513-4164-a55f-652069ce0d5b | 4     
       |
   | 6   | e0dfef4c-1463-4983-ad17-daa84202c513 | 
e0dfef4c14634983ad17daa84202c513 | e0dfef4c-1463-4983-ad17-daa84202c513 | 4     
       |
   | 7   | f052994d-b55b-4c49-9004-64d2e23507b6 | 
f052994db55b4c49900464d2e23507b6 | f052994d-b55b-4c49-9004-64d2e23507b6 | 4     
       |
   | 8   | 4fe043ec-9899-4b38-9c55-eda9dcc7562a | 
4fe043ec98994b389c55eda9dcc7562a | 4fe043ec-9899-4b38-9c55-eda9dcc7562a | 4     
       |
   | 9   | fadaee8d-5fa5-4b0c-a6de-2ac09f7a3354 | 
fadaee8d5fa54b0ca6de2ac09f7a3354 | fadaee8d-5fa5-4b0c-a6de-2ac09f7a3354 | 4     
       |
   
+-----+--------------------------------------+----------------------------------+--------------------------------------+--------------+
   
   Field names and data types:
        idx int64
        uuid_string string
        uuid extension<arrow.uuid>
        uuid_string_round_trip string_view
        uuid_version uint32
   ```
   
   I did need to do the work in the rust side, because I'm not yet sure how I 
would add metadata to the python style UDFs. I will think more about that.


-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to