-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEncoding.scala
29 lines (24 loc) · 1.46 KB
/
Encoding.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
trait Encoding {
type EncodedQuery
def schemaEncoding(r: String, sch: Database.Schema) : Map[String,Database.Schema]
def schemaEncodingWithSourceField(r: String, sch: Database.Schema) : Map[String,(String,Database.Schema)]
def instanceSchemaEncoding(sch: Map[String, Database.Schema]): Map[String, Database.Schema]
def insertEncodedStream(r: String, sch:Database.Schema, stream: Iterator[Database.Row]): Iterator[String]
def queryEncoding(q: Absyn.Query): EncodedQuery
def getEncodedView(vtable: String, eq: EncodedQuery): Map[String,Absyn.Query]
def iterateEncodedTable(conn: java.sql.Connection, r: String, sch: Database.Schema): Iterator[Database.Row]
def iterateEncodedQuery(conn: java.sql.Connection, eq: EncodedQuery, es: Map[String, Database.Schema]): Iterator[Database.Row]
def iterateEncodedConstraints(conn: java.sql.Connection, eq: EncodedQuery, es: Map[String, Database.Schema]): Iterator[Database.Equation]
def schemaToViewDef(sourceName:String, r:String, sourceField:String, sch: Database.Schema): Map[String,String]
}
object Encoding {
def encoder_to_use(arg: String) = arg match {
case "partitioning" => { println("Partitioning encoding")
EncodePartitioning }
case "nf2_sparsev" => { println("Non-First Normal Form encoding with sparse vectors")
EncodeNF2_SparseV }
case _ => { println("A valid encoding needs to be provided instead of '"+arg+"'")
throw Absyn.NYI
}
}
}