| 61 | |
| 62 | @dataclasses.dataclass(frozen=True) |
| 63 | class InternalColRef(InternalColExpr): |
| 64 | kind: type[ColumnReference] |
| 65 | |
| 66 | def to_column_expression(self) -> ColumnReference: |
| 67 | return cast(ColumnReference, super().to_column_expression()) |
| 68 | |
| 69 | @staticmethod |
| 70 | def build(kind, *args, **kwargs) -> InternalColRef: |
| 71 | assert kind == ColumnReference |
| 72 | ret = InternalColExpr.build(kind, *args, **kwargs) |
| 73 | return InternalColRef(kind, args=ret.args, kwargs=ret.kwargs) |
| 74 | |
| 75 | @property |
| 76 | def _name(self) -> str: |
| 77 | return self.to_column_expression()._name |
| 78 | |
| 79 | @property |
| 80 | def _table(self) -> Table: |
| 81 | return self.to_column_expression()._table |
| 82 | |
| 83 | @property |
| 84 | def _column(self) -> Column: |
| 85 | return self.to_column_expression()._column |
| 86 | |
| 87 | |
| 88 | class ColumnExpression(OperatorInput, ABC): |