Jefffrey opened a new issue, #17874:
URL: https://github.com/apache/datafusion/issues/17874

   ### Is your feature request related to a problem or challenge?
   
   Be able to run something like this:
   
   ```rust
   use datafusion::error::Result;
   use datafusion::functions_aggregate::expr_fn::approx_distinct;
   use datafusion::prelude::*;
   
   #[tokio::main]
   async fn main() -> Result<()> {
       let ctx = SessionContext::new();
   
       let testdata = datafusion::test_util::arrow_test_data();
       ctx.register_csv(
           "aggregate_test_100",
           format!("{testdata}/csv/aggregate_test_100.csv"),
           CsvReadOptions::default().has_header(true),
       )
       .await?;
   
       ctx.table("aggregate_test_100")
           .await?
           // Run aggregate in select() without needing to do via aggregate()
           .select(vec![
               approx_distinct(col("c9")).alias("count_c9"),
               approx_distinct(cast(col("c9"), 
arrow_schema::DataType::Utf8View))
                   .alias("count_c9_str"),
           ])?
           .show()
           .await?;
   
       Ok(())
   }
   ```
   
   Currently failing with:
   
   ```
   Error: NotImplemented("Physical plan does not support logical expression 
AggregateFunction(AggregateFunction { func: AggregateUDF { inner: 
ApproxDistinct { name: \"approx_distinct\", signature: Signature { 
type_signature: Any(1), volatility: Immutable } } }, params: 
AggregateFunctionParams { args: [Column(Column { relation: Some(Bare { table: 
\"aggregate_test_100\" }), name: \"c9\" })], distinct: false, filter: None, 
order_by: [], null_treatment: None } })")
   ```
   
   ### Describe the solution you'd like
   
   If using aggregate via `select()` then assume no group by.
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


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