Skip to content

Commit

Permalink
Merge pull request #1247 from mabel-dev/#1241
Browse files Browse the repository at this point in the history
🪲 aliases not handled correctly #1241
  • Loading branch information
joocer authored Nov 7, 2023
2 parents 3ad9c69 + ebdc282 commit cea14c5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions opteryx/components/binder/binder_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,19 @@ def name_column(qualifier, column):
):
if projection_column.alias:
return projection_column.alias
if len(context.schemas) > 1 or needs_qualifier:
return f"{qualifier}.{column.name}"

if len(context.relations) > 1 or needs_qualifier:
if isinstance(projection_column, LogicalColumn):
if qualifier:
projection_column.sourcce = qualifier
return projection_column.qualified_name
return f"{qualifier}.{column.name}"

if projection_column.query_column:
return str(projection_column.query_column)
if projection_column.current_name:
return projection_column.current_name

return column.name

def keep_column(column, identities):
Expand Down

0 comments on commit cea14c5

Please sign in to comment.