Relation

scalation.database.relation.Relation
See theRelation companion class
object Relation

The Relation companion object provides additional functions for the Relation class. FIX - apply methods - make compatible with RelationSQL

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Relation.type

Members list

Value members

Concrete methods

def apply(name: String, schema: Schema, domain: Domain, key: Schema): Relation

Create an unpopulated relation.

Create an unpopulated relation.

Value parameters

domain

the string indicating domains for columns, e.g., Array ('S', 'D')

key

the column number for the primary key

name

the name of the relation

schema

the names of columns

Attributes

def apply(name: String, schema: Schema, domain: Domain, key: Schema, row: ArrayBuffer[Row]): Relation

Create a relation from a sequence of row/tuples. These rows must be converted to columns.

Create a relation from a sequence of row/tuples. These rows must be converted to columns.

Value parameters

domain

the string indicating domains for columns (e.g., 'SD' = 'String', 'Double')

key

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

name

the name of the relation

row

the sequence of rows to be converted to columns for the columnar relation

schema

the names of columns

Attributes

def apply(name: String): Relation

Read the relation with the given name into memory using serialization.

Read the relation with the given name into memory using serialization.

Value parameters

name

the name of the relation to load

Attributes

def count(r: Relation): IndexedSeq[Int]

Return the count (number of elements) of each of the columns of columnar relation r.

Return the count (number of elements) of each of the columns of columnar relation r.

Value parameters

r

the given relation

Attributes

def count(r: Relation, cName: String): Relation

Get a Vectr of count of the cName column for the r relation.

Get a Vectr of count of the cName column for the r relation.

Value parameters

cName

the column name for the column to be counted

r

the relation you want to operate on

Attributes

def count1(r: Relation, c: String): VectorI
def from(relations: Relation*): Relation

From function return cartesian product of all the relations.

From function return cartesian product of all the relations.

Value parameters

relations

the relations making up the from clause

Attributes

def fromMatrix(xy: MatrixD, name: String, schema: Schema, domain: Domain, key: Schema): Relation

Create a relation from the xy matrix of doubles.

Create a relation from the xy matrix of doubles.

Value parameters

domain

the string indicating domains for columns, e.g., Array ('S', 'D')

key

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

name

the name of the relation

schema

the names of columns

xy

the matrix containing the data

Attributes

def fromMatrixV(x: MatrixD, y: VectorD, name: String, schema: Schema, domain: Domain, key: Schema): Relation

Create a relation from the x matrix of doubles and y vector of doubles or integers.

Create a relation from the x matrix of doubles and y vector of doubles or integers.

Value parameters

domain

the string indicating domains for columns, e.g., Array ('S', 'D')

key

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

name

the name of the relation

schema

the names of columns

x

the matrix containing the data

y

the vector containing the data

Attributes

def load(fileName: String, name: String, schema: Schema, domain: Domain, key: Schema, skip: Int, eSep: String): Relation

Read the relation with the given name into memory loading its columns with data from the CSV file named fileName. Note: "ln.split (eSep, -1)" will keep all values even if empty "one,,three" -> "one","",three"

Read the relation with the given name into memory loading its columns with data from the CSV file named fileName. Note: "ln.split (eSep, -1)" will keep all values even if empty "one,,three" -> "one","",three"

Value parameters

domain

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

eSep

the element separation string/regex (e.g., "," ";" " +")

fileName

the file name of the data file

key

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

name

the name of the relation

schema

the names of columns

skip

the number of lines in the CSV file to skip (e.g., header line(s))

Attributes

def load(fileName: String, name: String, domain: Domain, key: Schema, eSep: String, cPos: ArrayBuffer[Int]): Relation

Read the relation with the given name into memory loading its columns with data from the CSV file named fileName. In this version, the column names are read from the first line of the file.

Read the relation with the given name into memory loading its columns with data from the CSV file named fileName. In this version, the column names are read from the first line of the file.

Value parameters

cPos

the sequence of column positions in the input file to be used (null => select all)

domain

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

eSep

the element separation string/regex (e.g., "," ";" " +")

fileName

the file name of the data file

key

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

name

the name of the relation

Attributes

def load(fileName: String, name: String, domain: Domain, key: Schema, eSep: String): Relation

Read the relation with the given name into memory loading its columns with data from the CSV file named fileName. In this version, the column names are read from the first line of the file. It uses col2 which is a temporary VEC, and maintains indices.

Read the relation with the given name into memory loading its columns with data from the CSV file named fileName. In this version, the column names are read from the first line of the file. It uses col2 which is a temporary VEC, and maintains indices.

Value parameters

domain

the string indicating domains for columns (e.g., 'SD' = 'String', 'Double')

eSep

the element separation string/regex (e.g., "," ";" " +")

fileName

the file name of the data file

key

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

name

the name of the relation

Attributes

def load(fileName: String, name: String, schema: Schema, domain: Domain, key: Schema): Relation

Read the relation with the given name into memory loading its columns with data from the CSV file named fileName. This version assumes defaults for eSep and skip of ("," and 0).

Read the relation with the given name into memory loading its columns with data from the CSV file named fileName. This version assumes defaults for eSep and skip of ("," and 0).

Value parameters

domain

the string indicating domains for columns, e.g., Array ('S', 'D')

fileName

the file name of the data file

key

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

name

the name of the relation

schema

the names of columns

Attributes

def load(fileName: String, domain: Domain, key: Schema): Relation

Read the relation with the given name into memory loading its columns with data from the .arff file named fileName.

Read the relation with the given name into memory loading its columns with data from the .arff file named fileName.

Value parameters

domain

the string indicating domains for columns, e.g., Array ('S', 'D')

fileName

the file name of the data file

key

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

Attributes

def max(r: Relation): Vector[Double]

Return the maximum of each of the columns of columnar relation r.

Return the maximum of each of the columns of columnar relation r.

Value parameters

r

the given relation

Attributes

def mean(r: Relation): Vector[Double]

Compute the mean of each of the columns of columnar relation r.

Compute the mean of each of the columns of columnar relation r.

Value parameters

r

the given relation

Attributes

def min(r: Relation): Vector[Double]

Return the minimum of each of the columns of columnar relation r.

Return the minimum of each of the columns of columnar relation r.

Value parameters

r

the given relation

Attributes

def sum(r: Relation): Vector[Double]

Compute the mean of each of the columns of columnar relation r.

Compute the mean of each of the columns of columnar relation r.

Value parameters

r

the given relation

Attributes

def test(query: String, result: Relation): Unit

Test/execute the given query.

Test/execute the given query.

Value parameters

query

the query to execute

result

the table resulting from the query

Attributes

def variance(r: Relation): Vector[Double]

Compute the variance of each of the columns of columnar relation r.

Compute the variance of each of the columns of columnar relation r.

Value parameters

r

the given relation

Attributes