Skip to content

Commit

Permalink
🪲 aliases not handled correctly #1241
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Nov 7, 2023
1 parent 3ad9c69 commit ebdc282
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 ebdc282

Please sign in to comment.