-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add support for querying with metric alias #1573
Conversation
42b8dcf
to
0fbefff
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.
Thanks for handling this!! Dataflow plan looks good. There are some changes that need to be made to the other parts of the code, and I don't think you should try to make them before you leave for vacation, so I can pick this up!
metricflow-semantics/metricflow_semantics/query/query_resolver.py
Outdated
Show resolved
Hide resolved
metricflow-semantics/metricflow_semantics/query/query_resolver.py
Outdated
Show resolved
Hide resolved
12a2463
to
06eada3
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.
- Since the alias in this case is describing user inputs, can it be added as a field to
ResolverInputForMetric
? - If not, need to have a think about the placement as the spec pattern is more about identifying items in the semantic manifest.
- Can you add a test case for when the user specifies two aliases that are the same in a query?
...w/snapshots/test_engine_specific_rendering.py/SqlPlan/BigQuery/test_add_time_expr__plan0.sql
Outdated
Show resolved
Hide resolved
86a7499
to
76b1c03
Compare
75d0e42
to
ea952ef
Compare
ea952ef
to
dfc4743
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.
LGTM!
Summary
This PR introduces support for querying with aliased metrics. This is done by adding an
AliasSpecsNode
after the order by step inDataflowPlanBuilder
. To make the alias information reach that point, I also had to modify some of the query interface classes to allow aliases in metrics.You can review commit by commit.