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
-
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)
-
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
-
val
BASE_DIR: String
The base directory for data files
-
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
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
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.The
Relation
companion object provides additional functions for theRelation
class. FIX - apply methods - make compatible with RelationSQL -
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 the 'save' method.The
RelationSQLTest2
object tests the '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
RelationSQLTest4 extends App
The
RelationSQLTest4
object tests theRelationSQL
on the traffic schema.The
RelationSQLTest4
object tests theRelationSQL
on the traffic schema. > runMain scalation.columnar_db.RelationSQLTest4 -
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
RelationTest11 extends App
The
RelationTest11
object tests theRelation
on the traffic schema.The
RelationTest11
object tests theRelation
on the traffic schema. > runMain scalation.columnar_db.RelationTest11 -
object
RelationTest12 extends App
The
RelationTest12
object tests theRelation
class on JSON data.The
RelationTest12
object tests theRelation
class on JSON data.- See also
www.learningcontainer.com/sample-json-file > runMain scalation.columnar_db.RelationTest12
-
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.