cyberbeam524 commented on code in PR #21714:
URL: https://github.com/apache/datafusion/pull/21714#discussion_r3172614684


##########
datafusion/sql/src/planner.rs:
##########
@@ -641,6 +641,21 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
 
         // If no type_planner can handle this type, use the default conversion
         match sql_type {
+            // Canonical Arrow extension types
+            SQLDataType::Uuid => Ok(Arc::new(
+                Field::new("", DataType::FixedSizeBinary(16), 
true).with_metadata(
+                    HashMap::from([(
+                        "ARROW:extension:name".to_string(),
+                        "arrow.uuid".to_string(),
+                    )]),
+                ),
+            )),
+            SQLDataType::JSON | SQLDataType::JSONB => Ok(Arc::new(
+                Field::new("", DataType::Utf8, 
true).with_metadata(HashMap::from([(
+                    "ARROW:extension:name".to_string(),
+                    "arrow.json".to_string(),
+                )])),

Review Comment:
   I've updated the JSON mapping to include an empty string for the 
EXTENSION_TYPE_METADATA_KEY. Based on the deserialize_metadata logic you 
shared, this ensures the metadata isn't None, which would have triggered the 
InvalidArgumentError. This should now correctly satisfy the arrow-rs JSON 
extension type requirements



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to