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

未關閉
#589 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 6 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
rust

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
Rust
星號
573
分支
32
平均合併
8 天 23 小時
30 天內合併 PR
5

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

posit-dev/ggsql 的其他 Issue

查看 posit-dev/ggsql 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。