public class JDBCRDD extends RDD<Row>
Modifier and Type | Class and Description |
---|---|
class |
JDBCRDD.BinaryConversion$ |
class |
JDBCRDD.BinaryLongConversion$ |
class |
JDBCRDD.BooleanConversion$ |
class |
JDBCRDD.DateConversion$ |
class |
JDBCRDD.DecimalConversion$ |
class |
JDBCRDD.DoubleConversion$ |
class |
JDBCRDD.FloatConversion$ |
class |
JDBCRDD.IntegerConversion$ |
class |
JDBCRDD.JDBCConversion |
class |
JDBCRDD.LongConversion$ |
class |
JDBCRDD.StringConversion$ |
class |
JDBCRDD.TimestampConversion$ |
Constructor and Description |
---|
JDBCRDD(SparkContext sc,
scala.Function0<java.sql.Connection> getConnection,
StructType schema,
String fqTable,
String[] columns,
Filter[] filters,
Partition[] partitions) |
Modifier and Type | Method and Description |
---|---|
JDBCRDD.BinaryConversion$ |
BinaryConversion()
Accessor for nested Scala object
|
JDBCRDD.BinaryLongConversion$ |
BinaryLongConversion()
Accessor for nested Scala object
|
JDBCRDD.BooleanConversion$ |
BooleanConversion()
Accessor for nested Scala object
|
scala.collection.Iterator<Row> |
compute(Partition thePart,
TaskContext context)
Runs the SQL query against the JDBC driver.
|
JDBCRDD.DateConversion$ |
DateConversion()
Accessor for nested Scala object
|
JDBCRDD.DecimalConversion$ |
DecimalConversion()
Accessor for nested Scala object
|
JDBCRDD.DoubleConversion$ |
DoubleConversion()
Accessor for nested Scala object
|
JDBCRDD.FloatConversion$ |
FloatConversion()
Accessor for nested Scala object
|
static scala.Function0<java.sql.Connection> |
getConnector(String driver,
String url,
java.util.Properties properties)
Given a driver string and an url, return a function that loads the
specified driver string then returns a connection to the JDBC url.
|
JDBCRDD.JDBCConversion[] |
getConversions(StructType schema)
Maps a StructType to a type tag list.
|
Partition[] |
getPartitions()
Retrieve the list of partitions corresponding to this RDD.
|
JDBCRDD.IntegerConversion$ |
IntegerConversion()
Accessor for nested Scala object
|
JDBCRDD.LongConversion$ |
LongConversion()
Accessor for nested Scala object
|
static StructType |
resolveTable(String url,
String table,
java.util.Properties properties)
Takes a (schema, table) specification and returns the table's Catalyst
schema.
|
static RDD<Row> |
scanTable(SparkContext sc,
StructType schema,
String driver,
String url,
java.util.Properties properties,
String fqTable,
String[] requiredColumns,
Filter[] filters,
Partition[] parts)
Build and return JDBCRDD from the given information.
|
JDBCRDD.StringConversion$ |
StringConversion()
Accessor for nested Scala object
|
JDBCRDD.TimestampConversion$ |
TimestampConversion()
Accessor for nested Scala object
|
aggregate, cache, cartesian, checkpoint, checkpointData, coalesce, collect, collect, collectPartitions, computeOrReadCheckpoint, conf, context, count, countApprox, countApproxDistinct, countApproxDistinct, countByValue, countByValueApprox, creationSite, dependencies, distinct, distinct, doCheckpoint, doubleRDDToDoubleRDDFunctions, elementClassTag, filter, filterWith, first, flatMap, flatMapWith, fold, foreach, foreachPartition, foreachWith, getCheckpointFile, getCreationSite, getNarrowAncestors, getStorageLevel, glom, groupBy, groupBy, groupBy, id, intersection, intersection, intersection, isCheckpointed, isEmpty, iterator, keyBy, map, mapPartitions, mapPartitionsWithContext, mapPartitionsWithIndex, mapPartitionsWithSplit, mapWith, markCheckpointed, max, min, name, numericRDDToDoubleRDDFunctions, partitioner, partitions, persist, persist, pipe, pipe, pipe, preferredLocations, randomSplit, rddToAsyncRDDActions, rddToOrderedRDDFunctions, rddToPairRDDFunctions, rddToSequenceFileRDDFunctions, reduce, repartition, retag, retag, sample, saveAsObjectFile, saveAsTextFile, saveAsTextFile, setName, sortBy, sparkContext, subtract, subtract, subtract, take, takeOrdered, takeSample, toArray, toDebugString, toJavaRDD, toLocalIterator, top, toString, treeAggregate, treeReduce, union, unpersist, zip, zipPartitions, zipPartitions, zipPartitions, zipPartitions, zipPartitions, zipPartitions, zipWithIndex, zipWithUniqueId
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public JDBCRDD(SparkContext sc, scala.Function0<java.sql.Connection> getConnection, StructType schema, String fqTable, String[] columns, Filter[] filters, Partition[] partitions)
public static StructType resolveTable(String url, String table, java.util.Properties properties)
url
- - The JDBC url to fetch information from.table
- - The table name of the desired table. This may also be a
SQL query wrapped in parentheses.
SQLException
- if the table specification is garbage.SQLException
- if the table contains an unsupported type.public static scala.Function0<java.sql.Connection> getConnector(String driver, String url, java.util.Properties properties)
driver
- - The class name of the JDBC driver for the given url.url
- - The JDBC url to connect to.
public static RDD<Row> scanTable(SparkContext sc, StructType schema, String driver, String url, java.util.Properties properties, String fqTable, String[] requiredColumns, Filter[] filters, Partition[] parts)
sc
- - Your SparkContext.schema
- - The Catalyst schema of the underlying database table.driver
- - The class name of the JDBC driver for the given url.url
- - The JDBC url to connect to.fqTable
- - The fully-qualified table name (or paren'd SQL query) to use.requiredColumns
- - The names of the columns to SELECT.filters
- - The filters to include in all WHERE clauses.parts
- - An array of JDBCPartitions specifying partition ids and
per-partition WHERE clauses.
public Partition[] getPartitions()
public JDBCRDD.BooleanConversion$ BooleanConversion()
public JDBCRDD.DateConversion$ DateConversion()
public JDBCRDD.DecimalConversion$ DecimalConversion()
public JDBCRDD.DoubleConversion$ DoubleConversion()
public JDBCRDD.FloatConversion$ FloatConversion()
public JDBCRDD.IntegerConversion$ IntegerConversion()
public JDBCRDD.LongConversion$ LongConversion()
public JDBCRDD.BinaryLongConversion$ BinaryLongConversion()
public JDBCRDD.StringConversion$ StringConversion()
public JDBCRDD.TimestampConversion$ TimestampConversion()
public JDBCRDD.BinaryConversion$ BinaryConversion()
public JDBCRDD.JDBCConversion[] getConversions(StructType schema)