The Table
companion object provides factory methods for creating tables. Supported domains/data-types are 'D'ouble, 'I'nt, 'L'ong, 'S'tring, and 'T'imeNum. Note 'X' is for Long String (a formatting issue).
Attributes
Members list
Value members
Concrete methods
Create a table given convenient string specifications.
Create a table given convenient string specifications.
Value parameters
- domain_
-
the domains/data-types for attributes ('D', 'I', 'L', 'S', 'X', 'T')
- key
-
the attributes forming the primary key
- name
-
the name of the table
- schema
-
the attributes for the table
Attributes
Create a new empty table with the same schema as an existing table.
Create a new empty table with the same schema as an existing table.
Value parameters
- name
-
the name of the new table
- tab
-
the existing table
Attributes
Return the average of all the elements for a numeric column or 0 otherwise.
Return the average of all the elements for a numeric column or 0 otherwise.
Value parameters
- colj
-
the given column
Attributes
Return the total number of elements in a column.
Return the total number of elements in a column.
Value parameters
- colj
-
the given column
Attributes
Return the number of distinct elements in a column.
Return the number of distinct elements in a column.
Value parameters
- colj
-
the given column
Attributes
Return whether the given table file exists in STORE_DIR.
Return whether the given table file exists in STORE_DIR.
Value parameters
- name
-
the name of table.
Attributes
Create a table from a matrix of doubles.
Create a table from a matrix of doubles.
Value parameters
- key
-
the attributes forming the primary key
- name
-
the name of the table
- schema
-
the attribute/column names
- x
-
the matrix containing the data
Attributes
- See also
-
the
toMatrix
mathod
Read the table with the given name into memory loading its columns with data from the CSV file named fileName. The attribute names are read from the FIRST LINE.
Read the table with the given name into memory loading its columns with data from the CSV file named fileName. The attribute names are read from the FIRST LINE.
Value parameters
- domain_
-
the domains/data-types (as one string) for attributes ('D', 'I', 'L', 'S', 'X', 'T')
- fileName
-
the file name (or file-path) of the data file
- key
-
the attributes forming the primary key
- name
-
the name of the table
- pos_
-
the sequence of column positions in the input file to be used (null => select all)
- sep
-
the element separation string/regex (e.g., "," ";" " +")
Attributes
Read the table with the given name into memory loading its columns with data from the CSV file named fileName. The attribute names are read from the FIRST LINE.
Read the table with the given name into memory loading its columns with data from the CSV file named fileName. The attribute names are read from the FIRST LINE.
Value parameters
- domain
-
the domains/data-types for attributes ('D', 'I', 'L', 'S', 'X', 'T')
- fileName
-
the file name (or file-path) of the data file
- key
-
the attributes forming the primary key
- name
-
the name of the table
- pos_
-
the sequence of column positions in the input file to be used (null => select all)
- sep
-
the element separation string/regex (e.g., "," ";" " +")
Attributes
- See also
-
scalation.readFileIntoArray
Read the table with the given name into memory loading its columns with data from the CSV file named fileName. The attribute names are read from the FIRST LINE. Use a short-cut (not reliable) to determines the column domains, by applying the 'tuple2type' method to the SECOND LINE. Note: safer to pull a row without missing or zero values from the middle of the dataset
Read the table with the given name into memory loading its columns with data from the CSV file named fileName. The attribute names are read from the FIRST LINE. Use a short-cut (not reliable) to determines the column domains, by applying the 'tuple2type' method to the SECOND LINE. Note: safer to pull a row without missing or zero values from the middle of the dataset
Value parameters
- fileName
-
the file name (or file-path) of the data file
- key
-
the attributes forming the primary key
- mumCol
-
the number of columns
- name
-
the name of the table
Attributes
- See also
-
tableTest3
scalation.readFileIntoArray
LOAD/Read the table with the given name into memory using serialization.
LOAD/Read the table with the given name into memory using serialization.
Value parameters
- name
-
the name of the table to load
Attributes
- See also
-
save in
Table
class.
LOAD/Read the table with the given name into memory from a JSON file.
LOAD/Read the table with the given name into memory from a JSON file.
Value parameters
- fileName
-
the file name of the JSON file
- name
-
the name of the table to load
Attributes
Make a tuple from an array of token strings, converting each each token according the corresponding domain specification. Use only the tokens in the array at the pos positions.
Make a tuple from an array of token strings, converting each each token according the corresponding domain specification. Use only the tokens in the array at the pos positions.
Value parameters
- domain
-
the domains/data-types for attributes ('D', 'I', 'L', 'S', 'X', 'T')
- pos
-
the positions in the token array to be used, e.g., Array (0, 2)
- token
-
the array of token strings, e.g., Array ("5.0", "12", "Smith")
Attributes
Return the maximum value of all the elements in a column.
Return the maximum value of all the elements in a column.
Value parameters
- colj
-
the given column
Attributes
Return the minimum value of all the elements in a column.
Return the minimum value of all the elements in a column.
Value parameters
- colj
-
the given column
Attributes
Set the full-path flag to the value of parameter fullPath.
Set the full-path flag to the value of parameter fullPath.
Value parameters
- fullPath
-
flag indicating whether full or relative paths should be used
Attributes
Set the limit on the number of lines to read to lim.
Set the limit on the number of lines to read to lim.
Value parameters
- lim
-
the limit on the number of lines to read (<= 0 => unlimited)
Attributes
Return basic statistics on the given column corresponding to SQL's aggregate functions: count, countd, min, max, sum, avg.
Return basic statistics on the given column corresponding to SQL's aggregate functions: count, countd, min, max, sum, avg.
Value parameters
- cname
-
the given column name
- colj
-
the given column
Attributes
Return the sum of all the elements for a numeric column or 0 otherwise.
Return the sum of all the elements for a numeric column or 0 otherwise.
Value parameters
- colj
-
the given column
Attributes
Given an array of strings (e.g., read from a file) with unknown domains, return the data-types (domains) by the lexical form of the strings.
Given an array of strings (e.g., read from a file) with unknown domains, return the data-types (domains) by the lexical form of the strings.
Value parameters
- tup
-
the type un-differentiated tuple as an array of strings
Attributes
- See also
-
scalation.typeOfStr
(in ValueType.scala) Caveat: may not be reliable since a column of doubles may start: 5, 7, 9.2, ...