DataFrameReader.
jdbc
Construct a DataFrame representing the database table named table accessible via JDBC URL url and connection properties.
DataFrame
table
url
properties
Partitions of the table will be retrieved in parallel if either column or predicates is specified. lowerBound, upperBound and numPartitions is needed when column is specified.
column
predicates
lowerBound
upperBound
numPartitions
If both column and predicates are specified, column will be used.
New in version 1.4.0.
a JDBC URL of the form jdbc:subprotocol:subname
jdbc:subprotocol:subname
the name of the table
the name of a column of numeric, date, or timestamp type that will be used for partitioning; if this parameter is specified, then numPartitions, lowerBound (inclusive), and upperBound (exclusive) will form partition strides for generated WHERE clause expressions used to split the column column evenly
the minimum value of column used to decide partition stride
the maximum value of column used to decide partition stride
the number of partitions
a list of expressions suitable for inclusion in WHERE clauses; each one defines one partition of the DataFrame
a dictionary of JDBC database connection arguments. Normally at least properties “user” and “password” with their corresponding values. For example { ‘user’ : ‘SYSTEM’, ‘password’ : ‘mypassword’ }
Notes
Don’t create too many partitions in parallel on a large cluster; otherwise Spark might crash your external database systems.