jdbc (DataFrameReader)
Constructs a DataFrame representing the database table accessible via JDBC URL url. Partitions of the table are retrieved in parallel if either column or predicates is specified. If both column and predicates are specified, column takes precedence.
Syntax
jdbc(url, table, column=None, lowerBound=None, upperBound=None,
numPartitions=None, predicates=None, properties=None)
Parameters
Parameter | Type | Description |
|---|---|---|
| str | The JDBC URL of the form |
| str | The name of the table in the external database. |
| str, optional | The column to use for partitioning (alias for the |
| int or str, optional | The minimum value of |
| int or str, optional | The maximum value of |
| int, optional | The number of partitions. Required when |
| list, optional | A list of WHERE clause expressions, each defining one partition of the |
| dict, optional | JDBC connection arguments, typically including |
Returns
DataFrame
Notes
Avoid creating too many partitions in parallel on a large cluster, as this can crash external database systems.