You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "oridag (via GitHub)" <gi...@apache.org> on 2023/06/08 06:33:34 UTC

[GitHub] [arrow-datafusion] oridag opened a new issue, #6597: Return type of the struct function is always a struct with an empty list of fields

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

   ### Describe the bug
   
   Same as title
   
   ### To Reproduce
   
   ```rust
   use datafusion::prelude::*;
   use datafusion_expr::BuiltinScalarFunction;
   ​
   #[tokio::main]
   async fn main() -> datafusion::error::Result<()> {
       let ctx = SessionContext::new();
       ctx.register_csv("example", "tests/data/example.csv", CsvReadOptions::new()).await?;
   ​
       let df = ctx.table("example").await?;
   ​
       let f = Expr::ScalarFunction(datafusion_expr::expr::ScalarFunction {
           fun: BuiltinScalarFunction::Struct,
           args: vec![col("a"), col("b")],
       });
   ​
       let df2 = df.select(vec![f])?;
       df2.show().await?;
       Ok(())
   }
   ```
   
   
   ### Expected behavior
   
   No error
   
   ### Additional context
   
   Returns the following error:
   ```
   Error: ArrowError(InvalidArgumentError("column types must match schema types, expected Struct([]) but found Struct([Field { name: \"c0\", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: \"c1\", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]) at column index 0"))
   ```


-- 
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] jiangzhx commented on issue #6597: Return type of the struct function is always a struct with an empty list of fields

Posted by "jiangzhx (via GitHub)" <gi...@apache.org>.
jiangzhx commented on issue #6597:
URL: https://github.com/apache/arrow-datafusion/issues/6597#issuecomment-1581995132

   @oridag thanks.
   I pulled #6594 to resolve this bug.


-- 
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 closed issue #6597: Return type of the struct function is always a struct with an empty list of fields

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #6597: Return type of the struct function is always a struct with an empty list of fields
URL: https://github.com/apache/arrow-datafusion/issues/6597


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