com.datastax.spark.connector.rdd.CqlWhereClause.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spark-cassandra-connector_2.11 Show documentation
Show all versions of spark-cassandra-connector_2.11 Show documentation
A library that exposes YugaByte DB tables as Spark RDDs, writes Spark RDDs to YugaByte DB tables, and executes CQL queries in Spark applications using YugaByte DB's Cassandra-compatible API.
package com.datastax.spark.connector.rdd
/** Represents a logical conjunction of CQL predicates.
* Each predicate can have placeholders denoted by '?' which get substituted by values from the `values` array.
* The number of placeholders must match the size of the `values` array. */
case class CqlWhereClause(predicates: Seq[String], values: Seq[Any]) {
/** Returns a conjunction of this clause and the given predicate. */
def and(other: CqlWhereClause) =
CqlWhereClause(predicates ++ other.predicates, values ++ other.values)
}
object CqlWhereClause {
/** Empty CQL WHERE clause selects all rows */
val empty = new CqlWhereClause(Nil, Nil)
}