Packages

c

org.apache.spark.sql.jdbc

JdbcSQLQueryBuilder

class JdbcSQLQueryBuilder extends AnyRef

The builder to build a single SELECT query.

Note: All the withXXX methods will be invoked at most once. The invocation order does not matter, as all these clauses follow the natural SQL order: sample the table first, then filter, then group by, then sort, then offset, then limit.

Source
JdbcSQLQueryBuilder.scala
Since

3.5.0

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JdbcSQLQueryBuilder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JdbcSQLQueryBuilder(dialect: JdbcDialect, options: JDBCOptions)

Value Members

  1. def build(): String

    Build the final SQL query that following dialect's SQL syntax.

  2. def withColumns(columns: Array[String]): JdbcSQLQueryBuilder

    The columns names that following dialect's SQL syntax.

    The columns names that following dialect's SQL syntax. e.g. The column name is the raw name or quoted name.

  3. def withGroupByColumns(groupByColumns: Array[String]): JdbcSQLQueryBuilder

    Constructs the GROUP BY clause that following dialect's SQL syntax.

  4. def withLimit(limit: Int): JdbcSQLQueryBuilder

    Saves the limit value used to construct LIMIT clause.

  5. def withOffset(offset: Int): JdbcSQLQueryBuilder

    Saves the offset value used to construct OFFSET clause.

  6. def withPredicates(predicates: Array[Predicate], part: JDBCPartition): JdbcSQLQueryBuilder

    Constructs the WHERE clause that following dialect's SQL syntax.

  7. def withSortOrders(sortOrders: Array[String]): JdbcSQLQueryBuilder

    Constructs the ORDER BY clause that following dialect's SQL syntax.

  8. def withTableSample(sample: TableSampleInfo): JdbcSQLQueryBuilder

    Constructs the table sample clause that following dialect's SQL syntax.