You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/12/06 12:49:29 UTC

[GitHub] [arrow] alamb commented on a change in pull request #8839: ARROW-10732: [Rust] [DataFusion] Integrate DFSchema as a step towards supporting qualified column names

alamb commented on a change in pull request #8839:
URL: https://github.com/apache/arrow/pull/8839#discussion_r537030760



##########
File path: rust/datafusion/src/execution/context.rs
##########
@@ -214,7 +212,7 @@ impl ExecutionContext {
             has_header: options.has_header,
             delimiter: Some(options.delimiter),
             projection: None,
-            projected_schema: csv.schema(),
+            projected_schema: Arc::new(DFSchema::from(&csv.schema())),

Review comment:
       We could make this code look better if we implemented `impl Into<DFSchemaRef> for SchemaRef` -- so then we could write something like `projected_schema: csv.schema().into(),`
   
   Doing so in some follow on PR would be totally fine
   

##########
File path: rust/datafusion/src/execution/context.rs
##########
@@ -408,7 +406,7 @@ impl ExecutionContext {
             let path = Path::new(&path).join(&filename);
             let file = fs::File::create(path)?;
             let mut writer =
-                ArrowWriter::try_new(file.try_clone().unwrap(), plan.schema(), None)?;
+                ArrowWriter::try_new(file.try_clone().unwrap(), plan.schema().to_arrow_schema(), None)?;

Review comment:
       We could likewise implement `impl Into<Schema> for DFSchema` and so call `into()` rather than `to_arrow_schema()`. This is again just a stylistic thing




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

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