You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by lu...@apache.org on 2026/10/17 14:13:07 UTC

(datafusion-sqlparser-rs) branch sqlite-shift-operators created (now df912229b)

This is an automated email from the ASF dual-hosted git repository.

LucaCappelletti94 pushed a change to branch sqlite-shift-operators
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git


      at df912229b SQLite: Support `<<` and `>>` bitwise shift operators

This branch includes the following new commits:

     new df912229b SQLite: Support `<<` and `>>` bitwise shift operators

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


(datafusion-sqlparser-rs) 01/01: SQLite: Support `<<` and `>>` bitwise shift operators

Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

LucaCappelletti94 pushed a commit to branch sqlite-shift-operators
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git

commit df912229b4bf53c2d6ef397ffb80485ec9d7ffbb
Author: LucaCappelletti94 <ca...@gmail.com>
AuthorDate: Wed Sep 23 09:27:33 2026 +0200

    SQLite: Support `<<` and `>>` bitwise shift operators
---
 src/dialect/sqlite.rs     |  4 ++++
 tests/sqlparser_sqlite.rs | 20 ++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/src/dialect/sqlite.rs b/src/dialect/sqlite.rs
index 497639556..10384c104 100644
--- a/src/dialect/sqlite.rs
+++ b/src/dialect/sqlite.rs
@@ -142,4 +142,8 @@ impl Dialect for SQLiteDialect {
     fn supports_national_string_literal(&self) -> bool {
         false
     }
+
+    fn supports_bitwise_shift_operators(&self) -> bool {
+        true
+    }
 }
diff --git a/tests/sqlparser_sqlite.rs b/tests/sqlparser_sqlite.rs
index ade2d9d82..fdc342028 100644
--- a/tests/sqlparser_sqlite.rs
+++ b/tests/sqlparser_sqlite.rs
@@ -1117,6 +1117,26 @@ fn parse_create_table_options_list() {
     }
 }
 
+#[test]
+fn parse_bitwise_shift_operators() {
+    sqlite().verified_stmt("SELECT a << 1 FROM t");
+    sqlite().verified_stmt("SELECT a >> 1 FROM t");
+
+    let unsupported = all_dialects_where(|d| !d.supports_bitwise_shift_operators());
+    for (sql, token) in [
+        ("SELECT a << 1 FROM t", "ShiftLeft"),
+        ("SELECT a >> 1 FROM t", "ShiftRight"),
+    ] {
+        assert_eq!(
+            unsupported.parse_sql_statements(sql),
+            Err(ParserError::ParserError(format!(
+                "No infix parser for token {token}"
+            ))),
+            "{sql}"
+        );
+    }
+}
+
 fn sqlite() -> TestedDialects {
     TestedDialects::new(vec![Box::new(SQLiteDialect {})])
 }


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