You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "s5dsn-eqee (via GitHub)" <gi...@apache.org> on 2026/09/29 18:51:42 UTC

[I] ClickHouse: tuple element access followed by a field changes meaning after round-trip [datafusion-sqlparser-rs]

s5dsn-eqee opened a new issue, #2599:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/2599

   ### 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
   
   ```rust
   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] ClickHouse: tuple element access followed by a field changes meaning after round-trip [datafusion-sqlparser-rs]

Posted by "s5dsn-eqee (via GitHub)" <gi...@apache.org>.
s5dsn-eqee closed issue #2599: ClickHouse: tuple element access followed by a field changes meaning after round-trip
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/2599


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] ClickHouse: tuple element access followed by a field changes meaning after round-trip [datafusion-sqlparser-rs]

Posted by "s5dsn-eqee (via GitHub)" <gi...@apache.org>.
s5dsn-eqee commented on issue #2599:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/2599#issuecomment-6339087321

   Thank you @princejain756 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] ClickHouse: tuple element access followed by a field changes meaning after round-trip [datafusion-sqlparser-rs]

Posted by "princejain756 (via GitHub)" <gi...@apache.org>.
princejain756 commented on issue #2599:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/2599#issuecomment-6339278056

   Happy to help. #2675 covers the reparsing side; the report can probably close.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org