Object

org.apache.spark.sql.aliyun.jdbc2

JdbcUtils

Related Doc: package jdbc2

Permalink

object JdbcUtils extends Logging

Util functions for JDBC tables.

Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JdbcUtils
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def createConnectionFactory(options: JDBCOptions): () ⇒ Connection

    Permalink

    Returns a factory for creating connections to the given JDBC URL.

    Returns a factory for creating connections to the given JDBC URL.

    options

    - JDBC options that contains url, table and other information.

  7. def createTable(conn: Connection, schema: StructType, sparkSession: SparkSession, options: JDBCOptions): Unit

    Permalink

    Creates a table with a given schema.

  8. def dropTable(conn: Connection, table: String): Unit

    Permalink

    Drops a table from the JDBC database.

  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def executeSimpleStatement(getConnection: () ⇒ Connection, statement: String, isolationLevel: Int): Iterator[Byte]

    Permalink
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def getCommonJDBCType(dt: DataType): Option[JdbcType]

    Permalink

    Retrieve standard jdbc types.

    Retrieve standard jdbc types.

    dt

    The datatype (e.g. org.apache.spark.sql.types.StringType)

    returns

    The default JdbcType for this DataType

  15. def getCopyStatement(sourceTable: String, targetTable: String, rddSchema: StructType, tableSchema: Option[StructType], dialect: JdbcDialect): String

    Permalink

    Returns an Insert SQL statement for copying all rows from the source table into the target table via JDBC conn.

  16. def getCustomSchema(tableSchema: StructType, customSchema: String, nameEquality: Resolver): StructType

    Permalink

    Parses the user specified customSchema option value to DataFrame schema, and returns a schema that is replaced by the custom schema's dataType if column name is matched.

  17. def getInsertStatement(table: String, rddSchema: StructType, tableSchema: Option[StructType], isCaseSensitive: Boolean, dialect: JdbcDialect): String

    Permalink

    Returns an Insert SQL statement for inserting a row into the target table via JDBC conn.

  18. def getJdbcType(dt: DataType, dialect: JdbcDialect): JdbcType

    Permalink
  19. def getSchema(resultSet: ResultSet, dialect: JdbcDialect, alwaysNullable: Boolean = false): StructType

    Permalink

    Takes a ResultSet and returns its Catalyst schema.

    Takes a ResultSet and returns its Catalyst schema.

    alwaysNullable

    If true, all the columns are nullable.

    returns

    A StructType giving the Catalyst schema.

    Exceptions thrown

    SQLException if the schema contains an unsupported type.

  20. def getSchemaOption(conn: Connection, options: JDBCOptions): Option[StructType]

    Permalink

    Returns the schema if the table already exists in the JDBC database.

  21. def getStatement(conf: RuntimeConfig, table: String, rddSchema: StructType, tableSchema: Option[StructType], isCaseSensitive: Boolean, dialect: JdbcDialect): String

    Permalink
  22. def getTableName(options: JDBCOptions): String

    Permalink
  23. def getTruncateStatement(table: String): String

    Permalink

    Returns an truncate SQL statement for truncating a table via JDBC conn.

  24. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  25. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  26. def initializeLogIfNecessary(isInterpreter: Boolean): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  27. def isCascadingTruncateTable(url: String): Option[Boolean]

    Permalink
  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. def isTableEmpty(conn: Connection, options: JDBCOptions): Boolean

    Permalink

    Returns true if the table is empty

  30. def isTraceEnabled(): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  31. def log: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  32. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  33. def logDebug(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  34. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  35. def logError(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  36. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  37. def logInfo(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  38. def logName: String

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  39. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  40. def logTrace(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  41. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  42. def logWarning(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  43. def makeInternalSetter(conn: Connection, dialect: JdbcDialect, dataType: DataType): JDBCInternalValueSetter

    Permalink
  44. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  45. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  46. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  47. def resultSetToRows(resultSet: ResultSet, schema: StructType): Iterator[Row]

    Permalink

    Convert a ResultSet into an iterator of Catalyst Rows.

  48. def saveInternalPartition(getConnection: () ⇒ Connection, table: String, iterator: Iterator[InternalRow], rddSchema: StructType, insertStmt: String, batchSize: Int, dialect: JdbcDialect, isolationLevel: Int): Iterator[Byte]

    Permalink

    Saves a partition of a DataFrame to the JDBC database.

    Saves a partition of a DataFrame to the JDBC database. This is done in a single database transaction (unless isolation level is "NONE") in order to avoid repeatedly inserting data as much as possible.

    It is still theoretically possible for rows in a DataFrame to be inserted into the database more than once if a stage somehow fails after the commit occurs but before the stage can return successfully.

    This is not a closure inside saveTable() because apparently cosmetic implementation changes elsewhere might easily render such a closure non-Serializable. Instead, we explicitly close over all variables that are used.

  49. def savePartition(getConnection: () ⇒ Connection, table: String, iterator: Iterator[Row], rddSchema: StructType, insertStmt: String, batchSize: Int, dialect: JdbcDialect, isolationLevel: Int): Iterator[Byte]

    Permalink

    Saves a partition of a DataFrame to the JDBC database.

    Saves a partition of a DataFrame to the JDBC database. This is done in a single database transaction (unless isolation level is "NONE") in order to avoid repeatedly inserting data as much as possible.

    It is still theoretically possible for rows in a DataFrame to be inserted into the database more than once if a stage somehow fails after the commit occurs but before the stage can return successfully.

    This is not a closure inside saveTable() because apparently cosmetic implementation changes elsewhere might easily render such a closure non-Serializable. Instead, we explicitly close over all variables that are used.

  50. def saveTable(df: DataFrame, tableSchema: Option[StructType], isCaseSensitive: Boolean, options: JDBCOptions): Unit

    Permalink

    Saves the RDD to the database in a single transaction.

  51. def schemaString(schema: StructType, sparkSession: SparkSession, url: String, createTableColumnTypes: Option[String] = None): String

    Permalink

    Compute the schema string for this RDD.

  52. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  53. def tableExists(conn: Connection, options: JDBCOptions): Boolean

    Permalink

    Returns true if the table already exists in the JDBC database.

  54. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  55. def truncateTable(conn: Connection, options: JDBCOptions): Unit

    Permalink

    Truncates a table from the JDBC database without side effects.

  56. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  57. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped