MakeSchema

scalation.database.MakeSchema
object MakeSchema

The MakeSchema object provides helper methods for making database schema. It attempts to infers the domain (data-type) for a column of data, e.g., from a csv file or database table. The domain for a column is inferred by examining the data elements in a sample from its vector (VectorS).

Attributes

See also

makeSchemaTest2 for an example of making a schema for a datafile.

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
MakeSchema.type

Members list

Value members

Concrete methods

def analyzeColumns(cols: Array[VectorS], samplePerc: Int): Array[Char]

Analyze the type of several COLUMNS by calling the analyzeType method on each one.

Analyze the type of several COLUMNS by calling the analyzeType method on each one.

Value parameters

cols

the columns to have their types analyzed

samplePerc

the percentage for each column in cols to analyze

Attributes

def analyzeRows(rows: ArrayBuffer[Array[String]], samplePerc: Int): Array[Char]

Analyze the type for several ROWS by creating corresponding columns and calling the analyzeColumns method.

Analyze the type for several ROWS by creating corresponding columns and calling the analyzeColumns method.

Value parameters

rows

the rows to have their types analyzed

samplePerc

the percentage for each column in cols to analyze

Attributes

def analyzeType(c: VectorS, samplePerc: Int): Char

Analyze the type of a given column as a VectorS by using regular expression matching. Types can be Double (D), Integer (I), Long (L), String (S), or TimeNum (T).

Analyze the type of a given column as a VectorS by using regular expression matching. Types can be Double (D), Integer (I), Long (L), String (S), or TimeNum (T).

Value parameters

c

the column/VectorS to have its type analyzed

samplePerc

the percentage of c used to analyze the type of column c

Attributes

def isDateTime(str: String): Boolean

Determine whether the str argument has a date-time format.

Determine whether the str argument has a date-time format.

Value parameters

str

the string argument to be checked

Attributes

See also

scalation.TimeNum