Code Monkey home page Code Monkey logo

Comments (3)

2010YOUY01 avatar 2010YOUY01 commented on August 17, 2024

Does that work for your use case? I vaguely remember VariadicAny is set to >=1 argument for some reason 🤔

/// # Examples
/// Function `make_array` takes 0 or more arguments with arbitrary types, its `TypeSignature`
/// is `OneOf(vec![Any(0), VariadicAny])`.

from arrow-datafusion.

tshauck avatar tshauck commented on August 17, 2024

That's actually what I did do in

signature: Signature::one_of(
// TypeSignature::Any(0) is required to handle `Count()` with no args
vec![TypeSignature::VariadicAny, TypeSignature::Any(0)],
Volatility::Immutable,
),
-- 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.

from arrow-datafusion.

jayzhan211 avatar jayzhan211 commented on August 17, 2024

The reason is that we currently use VariadicAny for functions that expect 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.

from arrow-datafusion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.