PROJECT x, y TO map is documented but rejected with "Unknown coord type: map"

Đang mở
#589 1 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 6 ngày

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
backend, documentation

Hướng nghiên cứu

Start with parse_coord_system in src/parser/builder.rs, where the accepted coord names are matched, and with the example in doc/syntax/coord/crs.qmd. Reproduce by running validate() on the PROJECT x, y TO map query from the issue. Done means either map parses to the generic map coord or the doc example uses TO crs or TO geographic and still validates. The issue lists two options and does not say which is preferred, so confirm with a maintainer before choosing.

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

Mô tả

documentation
Problem

The map coordinate system documentation (doc/syntax/coord/crs.qmd, titled "Map") shows position-aesthetic renaming like this:

PROJECT x, y TO map

but the parser doesn't recognize map as a coordinate system:

Parse error: Unknown coord type: map
Reproduce (Rust only, no database needed)
use ggsql::validate::validate;

fn main() {
    let v = validate(
        "SELECT x, y FROM pts VISUALISE DRAW point MAPPING x, y PROJECT x, y TO map"
    ).unwrap();
    for e in v.errors() {
        println!("{}", e.message);
    }
    // Parse error: Unknown coord type: map
}

(Any entry point hits this — it's a parse error, so execute() fails identically.)

Details

parse_coord_system in src/parser/builder.rs accepts cartesian, polar, crs, and the named projections — but not map, even though the map coord is constructed internally via Coord::map(...):

match name {
    Some("cartesian") | None => Ok(Coord::cartesian()),
    Some("polar") => Ok(Coord::polar()),
    Some("crs") => Ok(Coord::map("crs", properties)),
    Some(n) if NAMED_PROJECTIONS.contains(&n) => Ok(Coord::map(n, properties)),
    Some(n) => Err(GgsqlError::ParseError(format!("Unknown coord type: {}", n))),
}

Verified working alternatives today: PROJECT x, y TO crs and PROJECT x, y TO geographic.

Resolution options
  1. Accept map as an alias for the generic map coordinate system — e.g. Some("map") => Ok(Coord::map("crs", properties)) — matching the docs; or
  2. Fix doc/syntax/coord/crs.qmd to use TO crs (or TO geographic) in the aesthetic-renaming example.

Found while probing validate() coverage of map query patterns in the context of #587.

Ngôn ngữ chính
Rust
Star
573
Fork
32
Merge trung bình
8 ngày 23 giờ
Pull request đã merge (30 ngày)
5

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 posit-dev/ggsql

Tất cả issue của posit-dev/ggsql

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.