You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "alrevuelta (via GitHub)" <gi...@apache.org> on 2026/05/08 15:26:29 UTC

[PR] Make clickhouse tuples work [datafusion-sqlparser-rs]

alrevuelta opened a new pull request, #2337:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2337

   (no comment)


-- 
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: [PR] Make clickhouse tuples work [datafusion-sqlparser-rs]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #2337: Make clickhouse tuples work
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2337


-- 
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: [PR] Make clickhouse tuples work [datafusion-sqlparser-rs]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2337:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2337#issuecomment-4920964189

   Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.


-- 
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: [PR] Make clickhouse tuples work [datafusion-sqlparser-rs]

Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on code in PR #2337:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2337#discussion_r3212718252


##########
src/dialect/clickhouse.rs:
##########
@@ -72,6 +72,11 @@ impl Dialect for ClickHouseDialect {
         true
     }
 
+    /// See <https://clickhouse.com/docs/sql-reference/functions/tuple-functions#tupleelement>

Review Comment:
   does this behavior differ from `parse_compound_expr` handling (if so how, on a first glance they look identical syntax wise)?



##########
src/tokenizer.rs:
##########
@@ -4303,6 +4331,98 @@ mod tests {
         );
     }
 
+    #[test]
+    fn tokenize_clickhouse_tuple_element_access() {
+        let dialects = all_dialects_where(|dialect| dialect.supports_tuple_element_access());
+
+        // After a Word, RBracket, or RParen, `.<digit>` is split into `Period`
+        // and a separate integer `Number`, so the parser can build a
+        // CompoundFieldAccess instead of seeing a single decimal literal.
+        dialects.tokenizes_to(

Review Comment:
   not sure I follow the patch/tests - are we saying that without this PR, a sql like `t.1` tokenizes to something other than what's being asserted (if so what does the previous behavior tokenized to)?



-- 
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: [PR] Make clickhouse tuples work [datafusion-sqlparser-rs]

Posted by "alrevuelta (via GitHub)" <gi...@apache.org>.
alrevuelta commented on PR #2337:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2337#issuecomment-4407659100

   note. this PR does not address `tuple.-1` which seems to be valid clickhouse syntax.
   
   > Extracts an element from a tuple by index or name.
   
   > For access by index, an 1-based numeric index is expected. For access by name, the element name can be provided as a string (works only for named tuples).
   
   > Negative indexes are supported. In this case, the corresponding element is selected, numbered from the end. For example, tuple.-1 is the last element in the tuple.
   
   > An optional third argument specifies a default value which is returned instead of throwing an exception when the accessed element does not exist. All arguments must be constants.
   
   > This function has zero runtime cost and implements the operators x.index and x.name.
   
   source: https://clickhouse.com/docs/sql-reference/functions/tuple-functions#tupleelement


-- 
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