You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "tshauck (via GitHub)" <gi...@apache.org> on 2024/07/17 16:25:25 UTC

[I] Explore Updating VariadicAny Signature to take 0 Args [datafusion]

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

   ### Is your feature request related to a problem or challenge?
   
   Currently `VariadicAny` represents 1 or more arguments, but given the name and seemingly intention, it seems like 0 or more would make more sense (though there a number of counter examples).
   
   See https://github.com/apache/datafusion/pull/11229/files#r1680888279 for more discussion.
   
   ### Describe the solution you'd like
   
   `VariadicAny` is updated to support 0 arguments.
   
   ### Describe alternatives you've considered
   
   See the linked discussion for a few alternatives. It's unclear if `VariadicAny` w/ 0 args is the best option here, but was an issue implementing `COUNT()`.
   
   ### Additional context
   
   https://github.com/apache/datafusion/blob/b0925c801e1c07bd78c78b045ab58fbd0630b638/datafusion/expr/src/signature.rs#L100-L101


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Explore Updating VariadicAny Signature to take 0 Args [datafusion]

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

   The reason is that we currently use `VariadicAny` for functions that at least one args. If we now accept empty args for `VariadicAny`, we need to do tons of non-zero length check for them. functions that accept 0 is little, therefore adding Any(0) is easy. 


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Explore Updating VariadicAny Signature to take 0 Args [datafusion]

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

   That's actually what I did do in https://github.com/apache/datafusion/blob/b19744968770c4ab426d065dec3cc5147534e87a/datafusion/functions-aggregate/src/count.rs#L98-L102 -- it was more the discussion in https://github.com/apache/datafusion/pull/11229/files#r1680888279. To your point, I took a quick look at duckdb and they also represent their variadic any as >= 1, so maybe there is a good reason, and if someone can remember it (or rediscover it), it could be good to document. 


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Explore Updating VariadicAny Signature to take 0 Args [datafusion]

Posted by "2010YOUY01 (via GitHub)" <gi...@apache.org>.
2010YOUY01 commented on issue #11522:
URL: https://github.com/apache/datafusion/issues/11522#issuecomment-2235538061

   Does that work for your use case? I vaguely remember `VariadicAny` is set to >=1 argument for some reason 🤔 
   https://github.com/apache/datafusion/blob/b0925c801e1c07bd78c78b045ab58fbd0630b638/datafusion/expr/src/signature.rs#L116-L118


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org