Fugue SQL Antlr Parser
Fugue SQL Antlr Parser is an internal dependency of the Fugue project, providing the ANTLR4-based parsing capabilities for FugueSQL. It is not intended for direct use by end-users but is crucial for the SQL functionality within the Fugue ecosystem. The library has its own versioning, distinct from the main `fugue` package, with the current version being 0.2.4.
Warnings
- gotcha The `fugue-sql-antlr` package is an internal component of the Fugue project and is not designed for direct user interaction. Attempting to directly import or use its classes can lead to unexpected behavior or breakage with future updates.
- breaking Prior to `fugue` version 0.9.0, `fugue-sql-antlr` was included as a core dependency of the main `fugue` package. From `fugue` 0.9.0 onwards, it was moved to the `sql` extra. Users who previously relied on Fugue SQL without specifying the extra might find it missing after upgrading `fugue`.
- gotcha For performance-critical Fugue SQL parsing, the optional `fugue-sql-antlr-cpp` package is highly recommended as it can be significantly faster. However, its installation may require a C++ compiler on the system.
Install
-
pip install fugue-sql-antlr -
pip install fugue[sql] -
pip install fugue[sql,cpp_sql_parser]
Imports
- FugueSQL
from fugue_sql import fsql
Quickstart
import pandas as pd
from fugue_sql import fsql
df = pd.DataFrame({"id": [1, 2, 3], "value": [10, 20, 30]})
# FugueSQL uses the fugue-sql-antlr parser internally
result_df = fsql("SELECT id, value * 2 AS doubled_value FROM df WHERE value > 15").run(df).as_pandas()
print(result_df)