Loader Class
Loader classes.
SQLLoader
Class for loading and parsing SQL queries.
Source code in amee_utils/loader.py
from_file(path)
Load an SQL query from a file, parse it, and execute it using the SparkSession.
Returns the parsed query result as a PySpark DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The path to the file containing the SQL query. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
The result of the SQL query execution as a PySpark DataFrame. |
Source code in amee_utils/loader.py
parse(query)
Parse and execute an SQL query using the SparkSession.
Drop duplicates, and return the result as a PySpark DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
The SQL query to parse and execute. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
The result of the SQL query execution as a PySpark DataFrame. |