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


##########
datafusion/sql/src/planner.rs:
##########
@@ -677,6 +679,31 @@ 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 => {
+                let data_type = DataType::FixedSizeBinary(16);
+                let df_uuid = DFUuid::try_new(&data_type, Default::default())?;
+
+                // Re-construct the Arrow Uuid using the validated data from 
df_uuid
+                let arrow_uuid = 
Uuid::try_new(&df_uuid.storage_type().clone(), ())
+                    .map_err(|e| DataFusionError::External(Box::new(e)))?;
+
+                Ok(Arc::new(
+                    Field::new("", data_type, 
true).with_extension_type(arrow_uuid),
+                ))
+            }
+            SQLDataType::JSON => {
+                let data_type = DataType::Utf8;
+                let df_json = DFJson::try_new(&data_type, Default::default())?;
+
+                let arrow_json =
+                    Json::try_new(&df_json.storage_type().clone(), 
Default::default())
+                        .map_err(|e| DataFusionError::External(Box::new(e)))?;
+
+                Ok(Arc::new(
+                    Field::new("", data_type, 
true).with_extension_type(arrow_json),
+                ))

Review Comment:
   True that, thank you for the suggestions, changed it to the suggested 
versions



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