-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename TypeSignature::NullAry
--> TypeSignature::Nullary
and improve comments
#13817
base: main
Are you sure you want to change the base?
Conversation
@@ -74,6 +74,8 @@ pub enum Volatility { | |||
/// adds a cast such as `cos(CAST int_column AS DOUBLE)` during planning. | |||
/// | |||
/// # Data Types | |||
/// | |||
/// ## Timestamps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be one empty line after a header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call -- fixed
Coercible(Vec<TypeSignatureClass>), | ||
/// The arguments will be coerced to a single type based on the comparison rules. | ||
/// For example, i32 and i64 has coerced type Int64. | ||
/// One or more arguments that can be "compared" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this mean ?
/// | ||
/// Note: | ||
/// - If compares with numeric and string, numeric is preferred for numeric string cases. For example, nullif('2', 1) has coerced types Int64. | ||
/// - If compares with numeric and string, numeric is preferred for numeric string cases. For example, `nullif('2', 1)` has coerced types `Int64`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the reader expected to know/assume that nullif uses signature "Comparable"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actual example direct reader to understand this easily
/// | ||
/// # Examples | ||
/// Function `make_array` takes 0 or more arguments with arbitrary types, its `TypeSignature` | ||
/// | ||
/// Since `make_array` takes 0 or more arguments with arbitrary types, its `TypeSignature` | ||
/// is `OneOf(vec![Any(0), VariadicAny])`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This IMO is wrong design of those signatures, but whatever (for now)
/// For example, if a function is called with (utf8, large_utf8), all | ||
/// arguments will be coerced to `LargeUtf8` | ||
/// | ||
/// For functions that take no arguments (e.g. `random()` see [`TypeSignature::Nullary`]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
Thanks @alamb |
Which issue does this PR close?
Signature::nullary
in 44.0.0 easier / less confusing #13763Rationale for this change
While I was making that change I noticed that the
TypeSignature
documentation could be improved as well so I did it at the same timeWhat changes are included in this PR?
TypeSignature::NullAry
-->TypeSignature::Nullary
Are these changes tested?
By CI
Are there any user-facing changes?
The name of an enum has changed, but this has not yet been released, so it isn't a user visible change in my mind