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


   **Describe the bug**
   Some queries error with an error like
   ```
   ArrowError(ExternalError(ArrowError(InvalidArgumentError("column types must 
match schema types, expected Boolean but found Float32 at column index 0"))))', 
datafusion/tests/sql.rs:3857:39
   ```
   
   **To Reproduce**
   Write a query that aliases one column to the name of another in the input 
that has a different type
   
   Specifically:
   
   A reproducer in sql.rs:
   ```rust
   #[tokio::test]
   async fn projection_type_alias() -> Result<()> {
       let mut ctx = ExecutionContext::new();
       register_aggregate_simple_csv(&mut ctx).await?;
   
       // Query that aliases one column to the name of a different column
       // that also has a different type (c1 == float32, c3 == boolean)
       let sql = "SELECT c1 as c3 FROM aggregate_simple ORDER BY c3";
       let actual = execute_to_batches(&mut ctx, sql).await;
   
       let expected = vec!["foo"];
       assert_batches_eq!(expected, &actual);
   
       Ok(())
   }
   ```
   
   **Expected behavior**
   Query should run successfully
   
   **Additional context**
   This bug was caught by some of the IOx tests while updating IOx 
https://github.com/influxdata/influxdb_iox/pull/3359
   
   I am pretty sure the issue was intrduced in 
https://github.com/apache/arrow-datafusion/pull/1378. I'll have a PR shortly


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


Reply via email to