Class

mimir

Database

Related Doc: package mimir

Permalink

case class Database(backend: Backend) extends LazyLogging with Product with Serializable

The central dispatcher for Mimir. Most Mimir functionality makes use of the Relational Algebra and Expression ASTs in mimir.algebra.{Operator,Expression}, but individual components may make use of SQL or other query representations. The Database class acts as a bridge between these components, and provides a single, central way to access all of Mimir's resources. As a side effect, this allows us to decouple logic for different parts of Mimir into separate classes, linked only by this central Database class.

You should never need to access any of the classes below directly. If you do, add another accessor method to Database instead.

Parsing

* mimir.sql.SqlToRA (sql) Responsible for translating JSqlParser AST elements into corresponding AST elements from mimir.algebra._ * mimir.sql.RAToSql (ra) Responsible for translating mimir.algebra._ AST elements back to JSqlParser's AST. This is typically only required for compatibility with JDBC. * mimir.parser.OperatorParser (operator) Responsible for directly constructing mimir.algebra.{Operator,Expression} ASTs from string representations. Allows these ASTs to be serialized through toString()

Persistence

* mimir.views.ViewManager (views) Responsible for creating, serializing, and deserializing virtual Mimir-level views. * mimir.views.ModelManager (models) Responsible for creating, serializing, and deserializing models. * mimir.lenses.LensManager (lenses) Responsible for creating and managing lenses * mimir.adaptive.AdaptiveSchemaManager (adaptiveSchemas) Responsible for creating and managing adaptive schemas (multilenses)

Logic

* mimir.sql.Backend (backend) Pluggable wrapper for database backends over which Mimir will actually run. Basically, a simplified form of JDBC. See mimir.sql._ for examples. * mimir.lenses.LensManager (lenses) Responsible for creating, serializing, and deserializing lenses and virtual views. * mimir.exec.Compiler (compiler) Responsible for query execution. Acts as a wrapper around the logic in mimir.ctables._, mimir.lenses._, and mimir.exec._ that prepares non-deterministic queries to be evaluated on the backend database. * mimir.statistics.SystemCatalog (catalog) Responsible for managing the system catalog tables/views * mimir.explainer.CTExplainer (explainer) Responsible for creating explanation objects.

Linear Supertypes
Serializable, Serializable, Product, Equals, LazyLogging, Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Database
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. LazyLogging
  7. Logging
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Database(backend: Backend)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val adaptiveSchemas: AdaptiveSchemaManager

    Permalink
  5. val aggregates: AggregateRegistry

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. val backend: Backend

    Permalink
  8. val catalog: SystemCatalog

    Permalink
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. val compiler: Compiler

    Permalink
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def explainCell(query: Operator, token: RowIdPrimitive, column: String): CellExplanation

    Permalink

    Generate an explanation object for a column

  13. def explainRow(query: Operator, token: RowIdPrimitive): RowExplanation

    Permalink

    Generate an explanation object for a row

  14. val explainer: CTExplainer

    Permalink
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. val functions: FunctionRegistry

    Permalink
  17. def getAllTables(): Set[String]

    Permalink

    Get all availale table names

  18. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. def getView(name: String): Option[Operator]

    Permalink

    Retrieve the query corresponding to the Lens or Virtual View with the specified name (or None if no such lens exists)

  20. def initializeDBForMimir(): Unit

    Permalink

    Prepare a database for use with Mimir.

  21. val interpreter: Eval

    Permalink
  22. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  23. val lenses: LensManager

    Permalink
  24. def loadTable(sourceFile: File): Unit

    Permalink
  25. def loadTable(sourceFile: String): Unit

    Permalink
  26. def loadTable(targetTable: String, sourceFile: String): Unit

    Permalink
  27. def loadTable(targetTable: String, sourceFile: File, force: Boolean = true, format: (String, Seq[PrimitiveValue]) = ("CSV", Seq(StringPrimitive(",")))): Unit

    Permalink

    Load a CSV file into the database

    Load a CSV file into the database

    The CSV file can either have a header or not

    • If the file has a header, the first line will be skipped during the insert process
    • If the file does not have a header, the table must exist in the database, created through a CREATE TABLE statement Otherwise, a SQLException will be thrown

    Right now, the detection logic for whether a CSV file has a header or not is unimplemented. So its assumed every CSV file supplies an appropriate header.

  28. def loadTableNoTI(sourceFile: File): Unit

    Permalink
  29. def loadTableNoTI(sourceFile: String): Unit

    Permalink
  30. def loadTableNoTI(targetTable: String, sourceFile: String): Unit

    Permalink
  31. def loadTableNoTI(targetTable: String, sourceFile: File, force: Boolean = true): Unit

    Permalink
  32. lazy val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    LazyLogging → Logging
  33. val models: ModelManager

    Permalink
  34. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  35. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  37. def parse(queryString: String): List[Statement]

    Permalink

    Parse raw SQL data

  38. final def query[T](stmt: String)(handler: (ResultIterator) ⇒ T): T

    Permalink

    Translate, optimize and evaluate the specified query.

    Translate, optimize and evaluate the specified query. Applies all Mimir-specific optimizations and rewrites the query to properly account for Virtual Tables.

  39. final def query[T](stmt: Select)(handler: (ResultIterator) ⇒ T): T

    Permalink

    Translate, optimize and evaluate the specified query.

    Translate, optimize and evaluate the specified query. Applies all Mimir-specific optimizations and rewrites the query to properly account for Virtual Tables.

  40. final def query[T](oper: Operator)(handler: (ResultIterator) ⇒ T): T

    Permalink

    Optimize and evaluate the specified query.

    Optimize and evaluate the specified query. Applies all Mimir-specific optimizations and rewrites the query to properly account for Virtual Tables.

  41. final def query[T, R <: ResultIterator](stmt: String, mode: CompileMode[R])(handler: (R) ⇒ T): T

    Permalink

    Translate, optimize and evaluate the specified query.

    Translate, optimize and evaluate the specified query. Applies all Mimir-specific optimizations and rewrites the query to properly account for Virtual Tables.

  42. final def query[T, R <: ResultIterator](stmt: Select, mode: CompileMode[R])(handler: (R) ⇒ T): T

    Permalink

    Translate, optimize and evaluate the specified query.

    Translate, optimize and evaluate the specified query. Applies all Mimir-specific optimizations and rewrites the query to properly account for Virtual Tables.

  43. final def query[T, R <: ResultIterator](oper: Operator, mode: CompileMode[R])(handler: (R) ⇒ T): T

    Permalink

    Optimize and evaluate the specified query.

    Optimize and evaluate the specified query. Applies all Mimir-specific optimizations and rewrites the query to properly account for Virtual Tables.

  44. val ra: RAToSql

    Permalink
  45. def requireTable(name: String, schema: Seq[(String, Type)], primaryKey: Option[String] = None): Unit

    Permalink

    Utility for modules to ensure that a table with the specified schema exists.

    Utility for modules to ensure that a table with the specified schema exists.

    If the table doesn't exist, it will be created. If the table does exist, non-existant columns will be created. If the table does exist and a column has a different type, an error will be thrown.

  46. def select(s: String): Operator

    Permalink
  47. def selectInto(targetTable: String, tableName: String): Unit

    Permalink
  48. def selectInto(targetTable: String, sourceQuery: Operator): Unit

    Permalink

    Materialize a view into the database

  49. val sql: SqlToRA

    Permalink
  50. def stmt(s: String): Statement

    Permalink
  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  52. def table(tableName: String, alias: String): Operator

    Permalink
  53. def table(tableName: String): Operator

    Permalink

    Build a Table operator for the table with the provided name.

  54. def tableExists(name: String): Boolean

    Permalink

    Determine whether the specified table exists

  55. def tableSchema(name: String): Option[Seq[(String, Type)]]

    Permalink

    Look up the schema for the table with the provided name.

  56. val typechecker: Typechecker

    Permalink
  57. def update(stmt: Statement): Unit

    Permalink

    Evaluate a statement that does not produce results.

    Evaluate a statement that does not produce results.

    Generally these are routed directly to the back-end, but there are a few operations that Mimir needs to handle directly.

  58. val views: ViewManager

    Permalink
  59. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from LazyLogging

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped