You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "LucaCappelletti94 (via GitHub)" <gi...@apache.org> on 2026/10/17 14:52:23 UTC

[PR] Tokenize `~~` as `LIKE` only in PostgreSQL, Redshift and DuckDB [datafusion-sqlparser-rs]

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

   In SQLite `~` is the unary bitwise NOT operator (https://www.sqlite.org/lang_expr.html#operators_and_parse_affecting_attributes), so `SELECT ~~5` applies it twice and returns `5`. The tokenizer always read `~~` as PostgreSQL's `LIKE` match operator, so `SELECT ~~a FROM t` failed to parse with the SQLite dialect (`Expected: an expression, found: ~~`).
   
   A new dialect method, `supports_tilde_like_match_operator`, defaults to `true` so every other dialect keeps today's tokenization, and `SQLiteDialect` returns `false`, which makes `~~` and `~~~` tokenize as separate `~` tokens. The SQLite test covers both, and the dialects that keep the operator are tested to still parse `a ~~ b` and still reject a leading `~~`.


-- 
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] Tokenize `~~` as `LIKE` only in PostgreSQL, Redshift and DuckDB [datafusion-sqlparser-rs]

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

   ## [Codecov](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/pull/2659?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 81.26%. Comparing base ([`7b5821d`](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/commit/7b5821dd45ce13ba6a77b24c39854a863848c2b2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`d9dce3e`](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/commit/d9dce3e8789a3f85ab0ebc89bd2c015ff77530c0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##             main    #2659      +/-   ##
   ==========================================
   + Coverage   81.24%   81.26%   +0.02%     
   ==========================================
     Files          42       42              
     Lines       33901    33934      +33     
     Branches    33901    33934      +33     
   ==========================================
   + Hits        27543    27577      +34     
   + Misses       2792     2791       -1     
     Partials     3566     3566              
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/pull/2659?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
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] Tokenize `~~` as `LIKE` only in PostgreSQL, Redshift and DuckDB [datafusion-sqlparser-rs]

Posted by "LucaCappelletti94 (via GitHub)" <gi...@apache.org>.
LucaCappelletti94 merged PR #2659:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2659


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