class RelationSQL extends Tabular with Serializable

The RelationSQL class provides an SQL-like API to data stored internally in a Relation object.

Linear Supertypes
Serializable, Serializable, Tabular, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RelationSQL
  2. Serializable
  3. Serializable
  4. Tabular
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RelationSQL(r: Relation)

    Construct a new RelationSQL object from an existing relation 'r'.

    Construct a new RelationSQL object from an existing relation 'r'.

    r

    the existing relation

  2. new RelationSQL(name: String, colName: Seq[String], col: Vector[Vec], key: Int = 0, domain: String = null, fKeys: Seq[(String, String, Int)] = null)

    name

    the name of the relation

    colName

    the names of columns

    col

    the Scala Vector of columns making up the columnar relation

    key

    the column number for the primary key (< 0 => no primary key)

    domain

    an optional string indicating domains for columns (e.g., 'SD' = 'StrNum', 'Double')

    fKeys

    an optional sequence of foreign keys - Seq (column name, ref table name, ref column position)

Value Members

  1. def groupBy(cName: String*): RelationSQL

    Group 'this' relation by the specified column names, returning 'this' relation.

    Group 'this' relation by the specified column names, returning 'this' relation.

    cName

    the group column names

  2. def intersect(r2: RelationSQL): RelationSQL

    Intersect 'this' relation and 'r2'.

    Intersect 'this' relation and 'r2'. Check that the two relations are compatible. Use index to finish intersect operation.

    r2

    the other relation

  3. def join(r2: RelationSQL): RelationSQL

    Join 'this' relation and 'r2' by performing a "natural-join".

    Join 'this' relation and 'r2' by performing a "natural-join".

    r2

    the other relation

  4. def minus(r2: RelationSQL): RelationSQL

    Take the difference of 'this' relation and 'r2' ('this - r2').

    Take the difference of 'this' relation and 'r2' ('this - r2'). Check that the two relations are compatible.

    r2

    the other relation

  5. def orderBy(cName: String*): RelationSQL

    Order (ascending) the rows in the relation by the selected columns '_cName'.

    Order (ascending) the rows in the relation by the selected columns '_cName'. A stable sorting is used to allow sorting on multiple columns.

    cName

    the column names that are to be sorted

  6. def repr: Relation

    Return the internal representation.

  7. def reverseOrderBy(cName: String*): RelationSQL

    Order (descending) the rows in the relation by the selected columns '_cName'.

    Order (descending) the rows in the relation by the selected columns '_cName'. A stable sorting is used to allow sorting on multiple columns.

    cName

    the column names that are to be sorted

  8. def save(): Unit

    Save 'this' relation in a file using serialization.

  9. def select(cName: String*): RelationSQL

    Select the attributes to return in the answer to the query.

    Select the attributes to return in the answer to the query.

    cName

    the attribute names

  10. def show(limit: Int = Int.MaxValue): Unit

    Show 'this' relation row by row.

    Show 'this' relation row by row.

    limit

    the limit on the number of rows to display

    Definition Classes
    RelationSQLTabular
  11. def union(r2: RelationSQL): RelationSQL

    Union 'this' relation and 'r2'.

    Union 'this' relation and 'r2'. Check that the two relations are compatible. If they are not, return the first 'this' relation.

    r2

    the other relation

  12. def where[T](p: Predicate[T]*)(implicit arg0: ClassTag[T]): RelationSQL

    The where function filters on predicates (logic is and), returning the relation satisfying the predicates (column compare with constant)

    The where function filters on predicates (logic is and), returning the relation satisfying the predicates (column compare with constant)

    T

    the predicate type

    p

    tuple(1): column name, tuple(2): predicate (T => Boolean)