dask_expr.read_sql
dask_expr.read_sql¶
- dask_expr.read_sql(sql, con, index_col, **kwargs)[source]¶
Read SQL query or database table into a DataFrame.
This function is a convenience wrapper around
read_sql_table
andread_sql_query
. It will delegate to the specific function depending on the provided input. A SQL query will be routed toread_sql_query
, while a database table name will be routed toread_sql_table
. Note that the delegated function might have more specific notes about their functionality not listed here.- Parameters
- sqlstr or SQLAlchemy Selectable
Name of SQL table in database or SQL query to be executed. TextClause is not supported
- constr
Full sqlalchemy URI for the database connection
- index_colstr
Column which becomes the index, and defines the partitioning. Should be a indexed column in the SQL server, and any orderable type. If the type is number or time, then partition boundaries can be inferred from
npartitions
orbytes_per_chunk
; otherwise must supply explicitdivisions
.
- Returns
- dask.dataframe
See also
read_sql_table
Read SQL database table into a DataFrame.
read_sql_query
Read SQL query into a DataFrame.