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 2022/10/06 13:11:15 UTC

[GitHub] [arrow-datafusion] alamb opened a new issue, #3733: `DataFrame::select_columns` doesn't work with names containing "."

alamb opened a new issue, #3733:
URL: https://github.com/apache/arrow-datafusion/issues/3733

   **Describe the bug**
   A clear and concise description of what the bug is.
   
   **To Reproduce**
   Put in `core/src/dataframe.rs`
   
   ```rust
       #[tokio::test]
       async fn select_with_periods() -> Result<()> {
           // define data with a column name that has a "." in it:
           let array: Int32Array = [1, 10].into_iter().collect();
           let batch =
               RecordBatch::try_from_iter(vec![("f.c1", Arc::new(array) as _)]).unwrap();
   
           let ctx = SessionContext::new();
           ctx.register_batch("t", batch).unwrap();
   
           let df = ctx
               .table("t")
               .unwrap()
               .select_columns(&["f.c1"])
               .unwrap();
   
           let df_results = df.collect().await.unwrap();
   
           assert_batches_sorted_eq!(
               vec![
                   "+------+",
                   "| f.c1 |",
                   "+------+",
                   "| 1    |",
                   "| 10   |",
                   "+------+",
               ],
               &df_results
           );
   
           Ok(())
   }
   ```
   
   Fails like:
   ```
   thread 'dataframe::tests::select_with_periods' panicked at 'called `Result::unwrap()` on an `Err` value: SchemaError(FieldNotFound { qualifier: Some("f"), name: "c1", valid_fields: Some(["t.f.c1"]) })', datafusion/core/src/dataframe.rs:1437:14
   ```
   
   **Expected behavior**
   The test should pass
   
   
   **Additional context**
   Found while working on https://github.com/apache/arrow-datafusion/pull/3700
   
   cc @hengfeiyang


-- 
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-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow-datafusion] alamb closed issue #3733: `DataFrame::select_columns` doesn't work with names containing "."

Posted by GitBox <gi...@apache.org>.
alamb closed issue #3733: `DataFrame::select_columns` doesn't work with names containing "."
URL: https://github.com/apache/arrow-datafusion/issues/3733


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] alamb commented on issue #3733: `DataFrame::select_columns` doesn't work with names containing "."

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #3733:
URL: https://github.com/apache/arrow-datafusion/issues/3733#issuecomment-1270020419

   Marking this as a good first issue as it should be relatively isolated to the DataFrame code and would be a good way to get some experience with `DFSchema`, etc


-- 
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-unsubscribe@arrow.apache.org

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