this.<name>` resolves to the source relation instead of a same-named colum

Đang mở
#6,065 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
54/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust, sql
Lĩnh vực
compilers, databases

Hướng nghiên cứu

Start by tracing how this.<name> is resolved during compilation, using the sort and select examples in the issue as reproductions. Check the discussion in related issue #6020 for context. Done means both examples compile to SQL that references the same-named column, rather than treating it as a relation or producing a wildcard select.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
What happened?

Related to #6020 . When a column has the same name as a relation, referencing it resolves to the source table instead of the columns.

In a sort, this causes the compilation to fail. In a select, it results in a wildcard select

PRQL input
# Sort case
from status | sort {this.status}

# Select case
from status | select {this.status}
SQL output
# Sort case
from `status` | sort {this.`status`}
                      ──────┬──────
                            ╰──────── table instance cannot be referenced directly

# Select case
SELECT
  *
FROM
  status
Expected SQL output
# Sort case
SELECT * FROM status ORDER BY status.status

# Select case
SELECT status FROM status
MVCE confirmation
  • Minimal example
  • New issue
Anything else?

No response

Ngôn ngữ chính
Rust
Star
10.9k
Fork
261
Merge trung bình
3 ngày 21 giờ
Pull request đã merge (30 ngày)
84

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PRQL/prql

Tất cả issue của PRQL/prql

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.