package columnar_db
The columar_db
package contains classes, traits and objects for
columnar relational database, where columns are vectors from the
linalgebra
package. Basic type definitions are given.
- Alphabetic
- By Inheritance
- columnar_db
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
AggColumn = (AggFunction, String, String)
Aggregate column type has Aggregate Funtion, new column name and old column name
-
type
AggFunction = (Relation, String) ⇒ Vec
Indicates which relation and which column an aggregate is to be applied to
-
trait
Imputation extends AnyRef
The
Imputation
trait specifies an imputation operation to be defined by the objects implementing it, i.e.,Interpolate
- Uses Linear Interpolation technique to impute the missing valueImputeMean
- Estimates the mean of the vector filtered from missing valuesImputeNormal
- Estimates the mean and variance of the vector filtered from missing valuesImputeMovingAverage
- Imputes the missing value in the vector by taking historical Moving Average of last 'n' seasonal values. -
case class
KeyType(valu: Any) extends Ordered[KeyType] with Product with Serializable
The
KeyType
class is used as key type for relation key and is needed forSortedMap
such asBpTreeMap
.The
KeyType
class is used as key type for relation key and is needed forSortedMap
such asBpTreeMap
.- valu
the value for the key (any of several types)
-
class
MM_Relation extends Table with Error
The
MM_Relation
class stores and operates on vectors.The
MM_Relation
class stores and operates on vectors. The vectors form the columns of the columnar relational datastore. Columns may have any of the following types:C -
Complex
-VectorC
- 128 bit complex number a + bi D -Double
-VectorD
- 64 bit double precision floating point number I -Int
-VectorI
- 32 bit integer L -Long
-VectorL
- 64 bit long integer Q -Rational
-VectorQ
- 128 bit ratio of two long integers R -Real
-VectorR
- 128 bit quad precision floating point number S -StrNum
-VectorS
- variable length numeric string T -TimeNum
-VectorT
- 96 bit time number -
trait
Outlier extends AnyRef
The
Outlier
trait specifies an outlier detection operation to be defined by the objects implementing it, i.e.,DistanceOutlier
- outlier = beyond 'STDDEV_CUTOFF' units from meanQuantileOutlier
- outlier = in the 'PERCENTILE' tails of the distributionQuartileOutlier
- outlier = 'X_MULTIPLIER' times beyond the middle two quartiles -
type
Predicate[T] = (String, (T) ⇒ Boolean)
Boolean function that uses the value for the given column name (String) in the predicate (e.g., used by 'where' and 'filter')
-
type
Predicate2[T] = (String, String, (T, T) ⇒ Boolean)
Boolean function that uses the values for two given column names (String, String) in the predicate (e.g., used by 'thetajoin')
-
trait
Query extends Error
The
Query
trait specifies operations such as doQuery and doUpdate that can be performed on Relations. -
class
Relation extends Table with Error with Serializable
The
Relation
class stores and operates on vectors.The
Relation
class stores and operates on vectors. The vectors form the columns of the columnar relational datastore. Columns may have any of the following types:C -
Complex
-VectorC
- 128 bit complex number a + bi D -Double
-VectorD
- 64 bit double precision floating point number I -Int
-VectorI
- 32 bit integer L -Long
-VectorL
- 64 bit long integer Q -Rational
-VectorQ
- 128 bit ratio of two long integers R -Real
-VectorR
- 128 bit quad precision floating point number S -StrNum
-VectorS
- variable length numeric string T -TimeNum
-VectorT
- 96 bit time Instant = (Long, Int)FIX - (1) don't allow (public) var (2) avoid unchecked or incomplete .asInstanceOf [T] ------------------------------------------------------------------------------
-
class
RelationF extends Relation
The
RelationF
class create a relation/data frame by extending theRelation
class, and provides high order functions such as map and reduce.The
RelationF
class create a relation/data frame by extending theRelation
class, and provides high order functions such as map and reduce. FIX - should extend Tabular, not Relation -
class
RelationSQL extends Tabular with Serializable
The
RelationSQL
class provides an SQL-like API to data stored internally in aRelation
object. -
trait
Table extends Tabular
The
Table
trait defines methods for operating on vectors.The
Table
trait defines methods for operating on vectors. The vectors form the columns of the columnar relational datastore. Columns may have any of the following types:C -
Complex
-VectorC
- 128 bit complex number a + bi D -Double
-VectorD
- 64 bit double precision floating point number I -Int
-VectorI
- 32 bit integer L -Long
-VectorL
- 64 bit long integer Q -Rational
-VectorQ
- 128 bit ratio of two long integers R -Real
-VectorR
- 128 bit quad precision floating point number S -StrNum
-VectorS
- variable length numeric string T -TimeNum
-VectorT
- 96 bit time Instant = (Long, Int) -
trait
Tabular extends AnyRef
The
Tabular
trait is the base for all the relational structures defined in this package.The
Tabular
trait is the base for all the relational structures defined in this package. FIX - factor out additional methods the apply universally to Relation, RelationF, RelationSQL
Value Members
-
object
Catalog extends Serializable
The
Catalog
object keeps track of relations in the database.The
Catalog
object keeps track of relations in the database. It maintains two Maps: one mapping name to relation schema and the other mapping name to relation object stored in memory. -
object
CatalogTest extends App
The
CatalogTest
object is used to test theCatalog
object.The
CatalogTest
object is used to test theCatalog
object. > runMain scalation.columnar_db.CatalogTest -
object
CreateTable1
The
CreateTable1
object is used to create two tables: 'professor' and 'teaching'. -
object
DistanceOutlier extends Outlier
Detect outliers in the vector by treating anything that falls outside of some distance from the mean as an outlier.
-
object
ImputeMean extends Imputation
The
ImputeMean
object uses the mean of the vector filtered of missing values as estimates for missing values. -
object
ImputeMovingAverage extends Imputation
The
ImputeMovingAverage
object imputes the missing value in the vector by taking the historical Moving Average of last 'n' seaonal values. -
object
ImputeNormal extends Imputation
The
ImputeNormal
object uses a Normal distribution estimated from the filtered mean and variance as estimates for missing values -
object
ImputeNormalWin
The
ImputeNormalWin
object imputes the missing values in the vector using Normal Distribution for a sliding window. -
object
Interpolate extends Imputation
The
Interpolate
object imputes the missing value in the vector using Linear Interpolation based on the previous and next values. -
object
MM_Relation
The
MM_Relation
companion object provides additional functions for theMM_Relation
class. -
object
MM_RelationEx
The
MM_RelationEx
object provides and example relation for testing.The
MM_RelationEx
object provides and example relation for testing.- See also
www.codeproject.com/Articles/652108/Create-First-Data-WareHouse
-
object
MM_RelationTest extends App
The
MM_RelationTest
object tests the operations provided byMM_Relation
.The
MM_RelationTest
object tests the operations provided byMM_Relation
. > runMain scalation.columnar_db.MM_RelationTest -
object
MM_RelationTest2 extends App
The
MM_RelationTest2
object tests the operations provided byMM_Relation
.The
MM_RelationTest2
object tests the operations provided byMM_Relation
. The relational algebra operators are given using Unicode.- See also
en.wikipedia.org/wiki/List_of_Unicode_characters > runMain scalation.columnar_db.MM_RelationTest2
-
object
MM_RelationTest3 extends App
The
MM_RelationTest3
object tests the operations provided byMM_Relation
.The
MM_RelationTest3
object tests the operations provided byMM_Relation
. It test various aggregate/OLAP operations on a simple data warehouse fact table.- See also
www.codeproject.com/Articles/652108/Create-First-Data-WareHouse FIX - allow entering doubles as "13" rather than "13.0" > runMain scalation.columnar_db.MM_RelationTest3
-
object
MM_RelationTest4 extends App
The
MM_RelationTest4
object tests conversionMM_Relation
to a matrix.The
MM_RelationTest4
object tests conversionMM_Relation
to a matrix. > runMain scalation.columnar_db.MM_RelationTest4 -
object
MakeSchema
The
MakeSchema
object attempts to infers the domain of a relation without a domain specification and creates a new relation with the inferred domains by examining the data.The
MakeSchema
object attempts to infers the domain of a relation without a domain specification and creates a new relation with the inferred domains by examining the data. Should be checked and overridden when inaccurate. -
object
MakeSchemaTest extends App
The
MakeSchemaTest
object is used to test theMakeSchema
object.The
MakeSchemaTest
object is used to test theMakeSchema
object. > runMain scalation.columnar_db.MakeSchemaTest -
object
MakeSchemaTest2 extends App
The
MakeSchemaTest2
object is used to test theMakeSchema
object.The
MakeSchemaTest2
object is used to test theMakeSchema
object. > runMain scalation.columnar_db.MakeSchemaTest2 -
object
MissingValues
The
MissingValues
object is used to replace missing values in a dataset.The
MissingValues
object is used to replace missing values in a dataset.- See also
www.utexas.edu/cola/prc/_files/cs/Missing-Data.pdf
-
object
MissingValuesTable
The
MissingValuesTable
object build a data realtion containing missing values. -
object
MissingValuesTest extends App
The
MissingValuesTest
object is used to test theMissingValues
object.The
MissingValuesTest
object is used to test theMissingValues
object. > runMain scalation.columnar_db.MissingValuesTest -
object
MissingValuesTest2 extends App
The
MissingValuesTest2
object is used to test theMissingValues
object.The
MissingValuesTest2
object is used to test theMissingValues
object. > runMain scalation.columnar_db.MissingValuesTest2 -
object
MissingValuesTest3 extends App
The
MissingValuesTest3
object is used to test theMissingValues
object.The
MissingValuesTest3
object is used to test theMissingValues
object. > runMain scalation.columnar_db.MissingValuesTest3 -
object
MissingValuesTest4 extends App
The
MissingValuesTest4
object is used to test theMissingValues
object.The
MissingValuesTest4
object is used to test theMissingValues
object. > runMain scalation.columnar_db.MissingValuesTest4 -
object
OutlierTest extends App
The
OutlierTest
object is used to test the Outliers Detection techniques presented in Outliers trait for doubles.The
OutlierTest
object is used to test the Outliers Detection techniques presented in Outliers trait for doubles. > runMain scalation.columnar_db.OutlierTest -
object
OutlierTest2 extends App
The
OutlierTest2
object is used to test the Outliers Detection techniques presented in Outliers trait for integers.The
OutlierTest2
object is used to test the Outliers Detection techniques presented in Outliers trait for integers. > runMain scalation.columnar_db.OutlierTest2 -
object
QuantileOutlier extends Outlier
Detect outliers in the vector by treating anything that falls outside 10th or 90th percentile.
Detect outliers in the vector by treating anything that falls outside 10th or 90th percentile. Other percentiles may be passed in 'args'.
-
object
QuartileXOutlier extends Outlier
Detect outliers in the vector by treating anything that falls below the 1st Quartile or above the 3rd Quartile as an Outlier.
-
object
Query1 extends Query
The
Query1
object is a sample object for a basic query. -
object
QueryRunner extends App
The
QueryRunner
object provides a command prompt for querying a database.The
QueryRunner
object provides a command prompt for querying a database. Commands and their usage:- 'prefix package' - set the package prefix for convenience, e.g., scalation.columnar.db 2. 'create createTable' - execute the create table(s) statement, e.g., CreateTable1 3. 'load table' - load the table 4. 'save table' - save the table 5. 'query queryStat' - execute the compiled query statement, e.g., Query1 6. 'test queryStat' - perfoamnce test the complier query statement 7. 'update updateStmt' - execute the compiled update statement, e.g., Update1 8. 'show table' - show the contents of the table 9. 'help' - list the commands 10. 'quit' - quit the current QueryRunner session
> runMain scalation.columnar_db.QueryRunner
-
object
Relation extends Error with Serializable
The
Relation
companion object provides additional functions for theRelation
class. -
object
RelationEx
The
RelationEx
object provides and example relation for testing.The
RelationEx
object provides and example relation for testing.- See also
www.codeproject.com/Articles/652108/Create-First-Data-WareHouse
-
object
RelationF extends Serializable
The
RelationF
companion object provides additional functions for theRelationF
class, specifically a factory method to build a relation frame from a relation. -
object
RelationFTest extends App
The
RelationFTest
object tests theRelationF
class's map, reduce, fold, filter funtions.The
RelationFTest
object tests theRelationF
class's map, reduce, fold, filter funtions. > runMain scalation.columnar_db.RelationFTest -
object
RelationSQL extends Serializable
The
RelationSQL
companion object provides factory methods for creatingRelationSQL
object. -
object
RelationSQLTest extends App
The
RelationSQLTest
object is used to t3est theRelationSQL
class.The
RelationSQLTest
object is used to t3est theRelationSQL
class. > runMain scalation.columnar_db.RelationSQLTest -
object
RelationSQLTest2 extends App
The
RelationSQLTest2
object tests 'save' method.The
RelationSQLTest2
object tests 'save' method. > runMain scalation.columnar_db.RelationSQLTest2 -
object
RelationSQLTest3 extends App
The
RelationSQLTest3
object tests 'apply' method to load a saved relation.The
RelationSQLTest3
object tests 'apply' method to load a saved relation. > runMain scalation.columnar_db.RelationSQLTest3 -
object
RelationTest extends App
The
RelationTest
object tests the operations provided byRelation
.The
RelationTest
object tests the operations provided byRelation
. > runMain scalation.columnar_db.RelationTest -
object
RelationTest10 extends App
The
RelationTest10
object tests the 'orderBy' method.The
RelationTest10
object tests the 'orderBy' method. > runMain scalation.columnar_db.RelationTest10 -
object
RelationTest2 extends App
The
RelationTest2
object tests the operations provided byRelation
.The
RelationTest2
object tests the operations provided byRelation
. The relational algebra operators are given using Unicode.- See also
en.wikipedia.org/wiki/List_of_Unicode_characters > runMain scalation.columnar_db.RelationTest2
-
object
RelationTest3 extends App
The
RelationTest3
object tests the operations provided byRelation
.The
RelationTest3
object tests the operations provided byRelation
. It test various aggregate/OLAP operations on a simple data warehouse fact table.- See also
www.codeproject.com/Articles/652108/Create-First-Data-WareHouse FIX - allow entering doubles as "13" rather than "13.0" > runMain scalation.columnar_db.RelationTest3
-
object
RelationTest4 extends App
The
RelationTest4
object tests conversionRelation
to a matrix.The
RelationTest4
object tests conversionRelation
to a matrix. > runMain scalation.columnar_db.RelationTest4 -
object
RelationTest5 extends App
The
RelationTest5
object tests the interoperability between Relations and Matrices.The
RelationTest5
object tests the interoperability between Relations and Matrices. > runMain scalation.columnar_db.RelationTest5 -
object
RelationTest6 extends App
The
RelationTest6
object tests 'indexjoin', 'parjoin', 'groupby' and 'aggregation'.The
RelationTest6
object tests 'indexjoin', 'parjoin', 'groupby' and 'aggregation'. > runMain scalation.columnar_db.RelationTest6 -
object
RelationTest7 extends App
The
RelationTest7
object tests 'join' method.The
RelationTest7
object tests 'join' method. > runMain scalation.columnar_db.RelationTest7 -
object
RelationTest8 extends App
The
RelationTest8
object tests 'save' method.The
RelationTest8
object tests 'save' method. > runMain scalation.columnar_db.RelationTest8 -
object
RelationTest9 extends App
The
RelationTest9
object tests 'apply' method to load a saved relation.The
RelationTest9
object tests 'apply' method to load a saved relation. > runMain scalation.columnar_db.RelationTest9 -
object
TableGen extends Error
The
TableGen
object generates data forTable
classes (e.g.,Relation
). -
object
TableGenTest extends App
The
TableGenTest
is used to test theTableGen
object.The
TableGenTest
is used to test theTableGen
object. Create unpopulated tables and use the table generator to populate their columns. > runMain scalation.columnar_db.TableGenTest -
object
TableObj extends Error
The
Table
object provides functions for theTable
companion objects.