adriangb commented on code in PR #26824:
URL: https://github.com/apache/datafusion/pull/26824#discussion_r4765971658


##########
datafusion/datasource-json/src/source.rs:
##########
@@ -328,30 +324,39 @@ impl JsonSource {
                 "PhysicalPlanNode is not a JsonScan"
             );
         };
-
-        // Exhaustive destructure: a new field on `JsonScanExecNode` is a
-        // compile error here rather than a silently ignored wire field.
-        let protobuf::JsonScanExecNode {
-            base_conf,
-            newline_delimited,
-            coerce_primitive,
-        } = scan;
-
-        let base_conf = base_conf.as_ref().ok_or_else(|| {
+        let base_conf = scan.base_conf.as_ref().ok_or_else(|| {
             datafusion_common::internal_datafusion_err!(
                 "JsonScanExecNode is missing required field 'base_conf'"
             )
         })?;
+        let source_node = protobuf::JsonSourceNode::from(scan);
+        let source = Self::try_from_proto_file_source(&source_node, base_conf, 
ctx)?;
+        let conf = FileScanConfig::try_from_proto(base_conf, ctx, source)?;
+        Ok(DataSourceExec::from_data_source(conf))
+    }
 
-        let table_schema = 
FileScanConfig::parse_table_schema_from_proto(base_conf)?;
-        let source = Arc::new(
+    /// Reconstructs a `JsonSource` from its protobuf representation. `base`
+    /// is the enclosing scan's shared config, used for the table schema.
+    ///
+    /// Payloads without a mode default to newline-delimited JSON, and 
payloads without
+    /// `coerce_primitive` default to `false`.
+    pub fn try_from_proto_file_source(

Review Comment:
   It's already covered: the enclosing `impl JsonSource` block has 
`#[cfg(feature = "proto")]`.



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