-
Notifications
You must be signed in to change notification settings - Fork 49
refactor: compile the selected_cols for the ResultNode #1765
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
813b50e
to
b8a7e33
Compare
b8a7e33
to
02959ef
Compare
If it is, returns a tuple containing the alias name and original column name. | ||
Returns `None` otherwise. | ||
""" | ||
if not isinstance(expr, sge.Alias): |
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.
non-rhetorical question: is it possible to check alias at the BFET level?
We have something like this:
python-bigquery-dataframes/bigframes/core/nodes.py
Lines 1097 to 1113 in 1f6442e
class AliasedRef(typing.NamedTuple): | |
ref: ex.DerefOp | |
id: identifiers.ColumnId | |
@classmethod | |
def identity(cls, id: identifiers.ColumnId) -> AliasedRef: | |
return cls(ex.DerefOp(id), id) | |
def remap_vars( | |
self, mappings: Mapping[identifiers.ColumnId, identifiers.ColumnId] | |
) -> AliasedRef: | |
return AliasedRef(self.ref, mappings.get(self.id, self.id)) | |
def remap_refs( | |
self, mappings: Mapping[identifiers.ColumnId, identifiers.ColumnId] | |
) -> AliasedRef: | |
return AliasedRef(ex.DerefOp(mappings.get(self.ref.id, self.ref.id)), self.id) |
Checking BigFrames objects instead of SQLGlot ones might make or architecture cleaner.
This suggestion is totally optional, though.
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.
That's valid concerns. I created b/419595879 to revisit the issues considering the complexity of current architecture.
02959ef
to
36b98f7
Compare
No description provided.