-
Notifications
You must be signed in to change notification settings - Fork 230
implemented query hints (flatten) (fb-2124) #2373
Conversation
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 looks good but I would like to push for slightly more comprehensive testing just because this is a pretty major new feature surface.
hdr("ids1", fldTypeIDSet), | ||
hdr("ss1", fldTypeStringSet), | ||
), | ||
ExpRows: rows( |
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 doesn't look like ids1
got flattened?
I am ... not actually sure what I expect here. I think I sort of expect the id set column values to all be 1, 2, 3, or 4, rather than sets, because they're being flattened. And I think that implies something like
1, {"a", "b"}
2, {"a", "b"}
3, {"d", "e"}
4, {"d", "e"}
etcetera? but now i'm not sure.
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.
so, the behavior of flatten when there's more than one column being selected is "just ignore it", which i think maybe ought to get a ticket, but that's the understood/expected behavior, so i think we can be okay with this for now? but maybe it should be an error to specify a flatten that won't have any effect, because otherwise it might confuse users.
So i'm okay with this as is, although i think i'd prefer "error on a flatten we won't do" because otherwise users won't understand why it's not happening, if we can do that now. otherwise, i guess, ticket it for doing that next.
looking at the CI failures, they look intentional in that we changed the semantics of group by. e.g., we would now need:
|
We do need to fix the existing tests, because we've fixed group by semantics to match SQL semantics by default, which is intentional, but it does mean the existing tests will need updates. I'm fine with either direction of changing that (changing expected test results or adding the with(flatten(...)) to them). |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This PR implements query options hints that govern behavior for distinct and group by on set columns.
...from table_name with (hint(param))
flatten(column)
hintdistinct
with and without flatten with a single set column ref works correctlygroup by
with and without flatten with a single set column ref works correctly