Re:FugueSQL: SQL-ish for pandas, dask, spark
by kvnkho on Monday October 11, 2021 @08:46PM
(#28834717)
Hello, FugueSQL also supports SQL being the dominant language when describing computation. Current SQL interfaces are normally invoked between predominantly Python code. FugueSQL was created to support the other way around with SQL invoking Python code.
For example, with a python function
```python
# schema: , c:int
def add_new_col(df:pd.DataFrame) -> pd.DataFrame:
df['c'] = 1
return df
query = """SELECT FROM df TRANSFORM USING add_new_col"""
For example, with a python function
```python
# schema: , c:int
def add_new_col(df:pd.DataFrame) -> pd.DataFrame:
query = """SELECT FROM df TRANSFORM USING add_new_col"""fsql(query).run()
# to run on Spark
fsql(query).run(SparkExecutionEngine)
```