-
Notifications
You must be signed in to change notification settings - Fork 166
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
feat: support window functions #224
Conversation
It looks like this is failing yaml validation. Have you reviewed the yaml schema? Also, it looks like there are several properties that are part of window function in the yaml schema that should probably be marked required and are not currently. For example, I think we should make window_type required. |
The specification says the window_type property is optional. |
f9af502
to
e89787d
Compare
The yaml schema also need to be changed to support the windowFunction. Now everything is ok. |
I see here that you've defined intermediate types but also state that these are not decomposable. Why have you provided intermediate types? Additionally, you are stating that nullability is declared output but your output is all non-nullable. So none of these functions can ever return a null value? (Just confirming here, I don't recall the nullability behavior of these window functions.) I also see you're including an empty args array. Is this for the yaml schema or just for clarity. (again, just curious). |
Sorry, I don't know how to express non-nullable. If I don't have the The same question is to the The empty args array is for clarity. |
56ac2e0
to
8db9261
Compare
I removed the |
Is there way to express a more complex relationship here? E.g. require intermediate if things are decomposable? |
For nullability behavior: declared output means whatever you say the output type is, is exactly the output type. If you say output is If you use "MIRROR" then if at least one of the input arguments is nullable, the output is nullable. You can see the specifics here. |
I don't get the point. If one function is decomposable, then it can declare the |
Thanks for the nullability explanation. |
8db9261
to
9958b30
Compare
I'm asking if it is possible to express this relationship in the json/yaml schema. "If function is decomposable, make sure intermediate is declared. If function is not decomposable, ensure there is no intermediate declared." |
e1e1779
to
81a74ae
Compare
seems the CI flow went wrong, I tried to add a validation rule that if one declare a decomposable with value |
Can you change this to use a different yaml validator if the current one is incomplete? |
Does it really? That plugin also seems based on jsonschema, and jsonschema has no concept of "if" and "then" that I'm aware of. What I'm pretty sure you did there instead is define that two new properties of the AFAICT from the spec, jsonschema can't do this directly. The best it can do is
Just so you know, I went through quite a bit of trouble to get jsonschema into the validator and coerce it to deal with YAML files instead, so I have some reservations about this... Honestly, I don't think it's reasonable to expect this level of semantic validation from a generic schema validator. This kind of constraint would be like trying to get a Substrait table schema to assert that if the value for a record in one column is X, then, and only then, column Y is nullable (or exists at all). |
I wasn't sure it could. If it can't and/or isn't spec'd in json schem nor the yaml schema extension. Let's skip it and just loosen the schema required properties as you originally did. |
@jvanstraten the json schema has a definition of
Yeah, I tried following schema format :
or
If you don't declare an intermedidate property, while declaring decomposable property with value of But I find it only work at the aggregate function , no effect at the window function. That's weird. If we agree to skip these rules, I'll removed them. |
81a74ae
to
a5f2933
Compare
Yes, let's just remove these. |
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.
Pending fixes to schema.
a5f2933
to
1bd55a2
Compare
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.
Did you confirm that all of these functions return only non-null values? You currently saying they are declared output with a non null value.
Thanks for the tips, you are right, they are all nullable. To a non-existense partition by row, or a filtered ( the filter where clause) row, its window function value will be null. |
1bd55a2
to
2edda46
Compare
2edda46
to
6bc1ba1
Compare
@jacques-n I think it'ready to merge now. |
No description provided.