Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

ClickHouse: tuple element access followed by a field changes meaning after round-trip

未关闭 适合新手
#2,599 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
clickhouse, rust, sql
领域
databases

调研方向

从 ClickHouse 方言的 Display 实现和 fuzz_parse_roundtrip 目标开始,以复现用例 SELECT t.1.name 作为起始案例。将打印出的 SQL 与预期的带空格访问链进行比较,并验证重新解析后产生相同的 AST;src/Parsers/Lexer.cpp 提供了 lexer 消歧所需的上下文。

由索引模型根据 Issue 内容生成。

描述

ClickHouse
Description

With ClickHouseDialect, a tuple element access followed by a named field prints without spaces around the second dot. The printed SQL parses back as a different query, with no error.

Reproduction
use sqlparser::dialect::ClickHouseDialect;
use sqlparser::parser::Parser;

let sql = "SELECT t.1.name";
let ast = Parser::parse_sql(&ClickHouseDialect {}, sql).unwrap();
let printed = ast[0].to_string();
println!("{printed}"); // SELECT t . 1.name

let reparsed = Parser::parse_sql(&ClickHouseDialect {}, &printed).unwrap();
println!("{}", reparsed[0]); // SELECT t . 1. AS name
Step Result
Input SELECT t.1.name
Parsed CompoundFieldAccess { root: t, access_chain: [Dot(1), Dot(name)] } (correct)
Printed SELECT t . 1.name
Re-parsed SELECT t . 1. AS name: the number 1. with alias name
Expected

The printed output keeps the access chain, e.g. SELECT t . 1 . name, and parses back to the same AST.

Context

ClickHouse's lexer tokenizes t.1.name as t . 1 . name (see the "chained tuple access" disambiguation in src/Parsers/Lexer.cpp), so the initial parse is correct and only Display is wrong.

Follow-up to #2574 (tuple element access). Found with the fuzz_parse_roundtrip fuzz target.

主要语言
Rust
星标
3.5k
派生
780
平均合并
4 天 10 小时
30 天内合并 PR
60

环境准备

  • 没有 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 摘要。