Redshift dialect: `--` comment should end at a carriage return

未關閉
#2,958 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

這個 Issue 還沒有評估資料。

描述

Redshift

In the Redshift dialect a -- comment runs to the next \n, but Redshift ends it at a lone \r too, as Postgres does. sqlparser already stops at \r for PostgreSqlDialect (tokenizer tokenize_single_line_comment).

select 1 as a --\r, pg_backend_pid()

(\r is a literal carriage return.)

  • sqlparser 0.64.0: SingleLineComment("\r, pg_backend_pid()"); parses as SELECT 1 AS a.
  • Redshift: two columns, a = 1, pg_backend_pid = 1073905994.

Redshift is based on PostgreSQL 8.0.2 (https://docs.aws.amazon.com/redshift/latest/dg/c_redshift-and-postgres-sql.html), whose lexer treats both \n and \r as newlines. Could RedshiftSqlDialect share the Postgres behavior here?

主要語言
Rust
星號
3.5k
分支
805
平均合併
2 天 3 小時
30 天內合併 PR
116

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 有 Pull Request 範本
  • 沒有貢獻指南

從這裡開始

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

apache/datafusion-sqlparser-rs 的其他 Issue

查看 apache/datafusion-sqlparser-rs 的全部 Issue

相似的 Issue

更多 Rust Issue

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

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