-
Notifications
You must be signed in to change notification settings - Fork 63
refactor: add agg_ops.MedianOp compiler to sqlglot #2108
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
Conversation
| excluded_cols=[ | ||
| "bytes_col", | ||
| "date_col", | ||
| "datetime_col", | ||
| "time_col", | ||
| "timestamp_col", | ||
| "string_col", | ||
| ], | ||
| ).node |
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.
Can we modify the MedianOp definition itself to exclude these then?
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.
Updated the codes so that the Ibis can allow the non-numeric dtypes for the MedianOp now.
| # TODO(swast): Allow switching between exact and approximate median. | ||
| # For now, the best we can do is an approximate median when we're doing | ||
| # an aggregation, as PERCENTILE_CONT is only an analytic function. |
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.
Exact and approximate median work a lot differently mechanically, so I probably wouldn't handle this far down in the stack, we would probably dispatch a different operator close to the API surface.
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.
Removed the comments. We are using the QuantileOp for the exact median now.
714bcb3 to
1edee54
Compare
Fixes internal issue 445774480 🦕