diff --git a/build.sbt b/build.sbt index 0be830fb..18cbb357 100755 --- a/build.sbt +++ b/build.sbt @@ -2,14 +2,13 @@ scalaVersion := "2.11.1" libraryDependencies += "org.scala-lang" % "scala-reflect" % "2.11.1" -scalacOptions += "-language:postfixOps" - scalacOptions += "-language:implicitConversions" scalacOptions += "-deprecation" -scalacOptions += "-optimise" - scalacOptions += "-Yinline-warnings" unmanagedJars in Compile <<= baseDirectory map { base => (base ** "*.jar").classpath } + +// there is a bug in SBT that does not allow compiler plugins to have dependencies +addCommandAlias("embed", ";clean ;legolifter/run ;project lego-core ;set scalacOptions ++= Seq(s\"-Xplugin:${System.getProperty(\"user.home\")}/.ivy2/local/ch.epfl.data/autolifter_2.11/0.1-SNAPSHOT/jars/autolifter_2.11.jar:${System.getProperty(\"user.home\")}/.ivy2/local/ch.epfl.lamp/yy-core_2.11/0.1-SNAPSHOT/jars/yy-core_2.11.jar:${System.getProperty(\"user.home\")}/.ivy2/local/ch.epfl.lamp/yin-yang_2.11/0.1-SNAPSHOT/jars/yin-yang_2.11.jar\"); compile; set scalacOptions := Seq(); project root; clean") diff --git a/generator-out/.gitignore b/generator-out/.gitignore new file mode 100644 index 00000000..afcdcd19 --- /dev/null +++ b/generator-out/.gitignore @@ -0,0 +1 @@ +*.scala diff --git a/lego/src/main/scala/LegoBase.scala b/lego/src/main/scala/LegoBase.scala index f9d01a40..b643d4b8 100755 --- a/lego/src/main/scala/LegoBase.scala +++ b/lego/src/main/scala/LegoBase.scala @@ -29,31 +29,32 @@ object MiniDB extends storagemanager.Loader with Queries { else args.tail.toList for (q <- queries) { currQuery = q - Console.setOut(new PrintStream(getOutputName)) - currQuery match { - case "Q1" => Q1(numRuns) - // case "Q2" => Q2(numRuns) - case _ => throw new Exception("Query not supported!") - } - // Check results - if (Config.checkResults) { - if (new java.io.File(getResultFileName).exists) { - val resq = scala.io.Source.fromFile(getOutputName).mkString - val resc = { - val str = scala.io.Source.fromFile(getResultFileName).mkString - str * numRuns - } - if (resq != resc) { - System.out.println("-----------------------------------------") - System.out.println("QUERY" + q + " DID NOT RETURN CORRECT RESULT!!!") - System.out.println("Correct result:") - System.out.println(resc) - System.out.println("Result obtained from execution:") - System.out.println(resq) - System.out.println("-----------------------------------------") - System.exit(0) - } else System.out.println("CHECK RESULT FOR QUERY " + q + ": [OK]") - } else System.out.println("Reference result file not found. Skipping checking of result") + Console.withOut(new PrintStream(getOutputName)) { + currQuery match { + case "Q1" => Q1(numRuns) + // case "Q2" => Q2(numRuns) + case _ => throw new Exception("Query not supported!") + } + // Check results + if (Config.checkResults) { + if (new java.io.File(getResultFileName).exists) { + val resq = scala.io.Source.fromFile(getOutputName).mkString + val resc = { + val str = scala.io.Source.fromFile(getResultFileName).mkString + str * numRuns + } + if (resq != resc) { + System.out.println("-----------------------------------------") + System.out.println("QUERY" + q + " DID NOT RETURN CORRECT RESULT!!!") + System.out.println("Correct result:") + System.out.println(resc) + System.out.println("Result obtained from execution:") + System.out.println(resq) + System.out.println("-----------------------------------------") + System.exit(0) + } else System.out.println("CHECK RESULT FOR QUERY " + q + ": [OK]") + } else System.out.println("Reference result file not found. Skipping checking of result") + } } } } diff --git a/lego/src/main/scala/queryengine/volcano/Operators.scala b/lego/src/main/scala/queryengine/volcano/Operators.scala index fdf89f4f..e64ebe2b 100644 --- a/lego/src/main/scala/queryengine/volcano/Operators.scala +++ b/lego/src/main/scala/queryengine/volcano/Operators.scala @@ -8,8 +8,23 @@ import scala.collection.mutable.ArrayBuffer import scala.collection.mutable.HashMap import scala.collection.mutable.Set import GenericEngine._ +import ch.epfl.data.autolifter.annotations.{ deep, metadeep } -abstract class Operator[+A: Manifest] { +// This is a temporary solution until we introduce dependency management and adopt policies. Not a priority now! +@metadeep( + "legocompiler/src/main/scala/ch/epfl/data/legobase/deep", + """ +package ch.epfl.data +package legobase +package deep + +import scalalib._ +import pardis.ir._ +""", + """OperatorsComponent""") +class MetaInfo + +@deep abstract class Operator[+A: Manifest] { def open() def next(): A def close() @@ -37,7 +52,7 @@ abstract class Operator[+A: Manifest] { def NullDynamicRecord[D: Manifest] = null.asInstanceOf[D] } -case class ScanOp[A: Manifest](table: Array[A]) extends Operator[A] { +@deep case class ScanOp[A: Manifest](table: Array[A]) extends Operator[A] { var i = 0 def open() {} def next() = { @@ -51,14 +66,14 @@ case class ScanOp[A: Manifest](table: Array[A]) extends Operator[A] { def reset() { i = 0 } } -case class SelectOp[A: Manifest](parent: Operator[A])(selectPred: A => Boolean) extends Operator[A] { +@deep case class SelectOp[A: Manifest](parent: Operator[A])(selectPred: A => Boolean) extends Operator[A] { def open() = { parent.open; } def next() = parent findFirst selectPred def close() = {} def reset() { parent.reset } } -case class AggOp[A: Manifest, B: Manifest](parent: Operator[A], numAggs: Int)(val grp: A => B)(val aggFuncs: Function2[A, Double, Double]*) extends Operator[AGGRecord[B]] { +@deep case class AggOp[A: Manifest, B: Manifest](parent: Operator[A], numAggs: Int)(val grp: A => B)(val aggFuncs: Function2[A, Double, Double]*) extends Operator[AGGRecord[B]] { val mA = manifest[A] val mB = manifest[B] @@ -90,7 +105,7 @@ case class AggOp[A: Manifest, B: Manifest](parent: Operator[A], numAggs: Int)(va def reset() { parent.reset; hm.clear; open } } -case class SortOp[A: Manifest](parent: Operator[A])(orderingFunc: Function2[A, A, Int]) extends Operator[A] { +@deep case class SortOp[A: Manifest](parent: Operator[A])(orderingFunc: Function2[A, A, Int]) extends Operator[A] { val sortedTree = new scala.collection.mutable.TreeSet()( new Ordering[A] { def compare(o1: A, o2: A) = orderingFunc(o1, o2) @@ -111,7 +126,7 @@ case class SortOp[A: Manifest](parent: Operator[A])(orderingFunc: Function2[A, A } // Limited version of map -- touches data in place and does not create new data -case class MapOp[A: Manifest](parent: Operator[A])(aggFuncs: Function1[A, Unit]*) extends Operator[A] { +@deep case class MapOp[A: Manifest](parent: Operator[A])(aggFuncs: Function1[A, Unit]*) extends Operator[A] { def open() = { parent.open; } def next() = { val t: A = parent.next @@ -124,7 +139,7 @@ case class MapOp[A: Manifest](parent: Operator[A])(aggFuncs: Function1[A, Unit]* def reset { parent.reset } } -case class PrintOp[A: Manifest](var parent: Operator[A])(printFunc: A => Unit, limit: () => Boolean = () => true) extends Operator[A] { +@deep case class PrintOp[A: Manifest](var parent: Operator[A])(printFunc: A => Unit, limit: () => Boolean = () => true) extends Operator[A] { var numRows = 0 def open() = { parent.open; } def next() = { diff --git a/lego/src/main/scala/storagemanager/Loader.scala b/lego/src/main/scala/storagemanager/Loader.scala index dcca46f6..35ba9f55 100755 --- a/lego/src/main/scala/storagemanager/Loader.scala +++ b/lego/src/main/scala/storagemanager/Loader.scala @@ -103,7 +103,7 @@ trait Loader { def fileLineCount(file: String) = { import scala.sys.process._; - Integer.parseInt((("wc -l " + file) #| "awk {print($1)}" !!).replaceAll("\\s+$", "")) + Integer.parseInt(((("wc -l " + file) #| "awk {print($1)}").!!).replaceAll("\\s+$", "")) } def loadRegion() = { diff --git a/legocompiler/src/main/scala/ch/epfl/data/legobase/deep/DeepLegoBase.scala b/legocompiler/src/main/scala/ch/epfl/data/legobase/deep/DeepLegoBase.scala index 64ca536a..9d02ff57 100644 --- a/legocompiler/src/main/scala/ch/epfl/data/legobase/deep/DeepLegoBase.scala +++ b/legocompiler/src/main/scala/ch/epfl/data/legobase/deep/DeepLegoBase.scala @@ -7,234 +7,6 @@ package deep import scalalib._ import pardis.ir._ -trait SelectOpOps extends Base { this: DeepDSL => - implicit class SelectOpRep[A](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A], evidence$4: Manifest[A]) { - def foreach(f: Rep[(A => Unit)]): Rep[Unit] = selectOpForeach[A](self, f)(manifestA) - def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = selectOpFindFirst[A](self, cond)(manifestA) - def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = selectOpNullDynamicRecord[A, D](self)(manifestA, manifestD) - def open(): Rep[Unit] = selectOpOpen[A](self)(manifestA) - def next(): Rep[A] = selectOpNext[A](self)(manifestA) - def close(): Rep[Unit] = selectOpClose[A](self)(manifestA) - def reset(): Rep[Unit] = selectOpReset[A](self)(manifestA) - } - // constructors - def __newSelectOp[A](parent: Rep[Operator[A]])(selectPred: Rep[(A => Boolean)])(implicit evidence$4: Manifest[A], manifestA: Manifest[A]): Rep[SelectOp[A]] = selectOpNew[A](parent, selectPred)(manifestA) - // case classes - case class SelectOpNew[A](parent: Rep[Operator[A]], selectPred: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[SelectOp[A]](None, "new SelectOp", List(List(parent), List(selectPred))) - case class SelectOpForeach[A](self: Rep[SelectOp[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) - case class SelectOpFindFirst[A](self: Rep[SelectOp[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) - case class SelectOpNullDynamicRecord[A, D](self: Rep[SelectOp[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) - case class SelectOpOpen[A](self: Rep[SelectOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) - case class SelectOpNext[A](self: Rep[SelectOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) - case class SelectOpClose[A](self: Rep[SelectOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) - case class SelectOpReset[A](self: Rep[SelectOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) - // method definitions - def selectOpNew[A](parent: Rep[Operator[A]], selectPred: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[SelectOp[A]] = SelectOpNew[A](parent, selectPred) - def selectOpForeach[A](self: Rep[SelectOp[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = SelectOpForeach[A](self, f) - def selectOpFindFirst[A](self: Rep[SelectOp[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = SelectOpFindFirst[A](self, cond) - def selectOpNullDynamicRecord[A, D](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = SelectOpNullDynamicRecord[A, D](self) - def selectOpOpen[A](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SelectOpOpen[A](self) - def selectOpNext[A](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A]): Rep[A] = SelectOpNext[A](self) - def selectOpClose[A](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SelectOpClose[A](self) - def selectOpReset[A](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SelectOpReset[A](self) - type SelectOp[A] = ch.epfl.data.legobase.queryengine.volcano.SelectOp[A] -} -trait SelectOpImplicits { this: SelectOpComponent => - // Add implicit conversions here! -} -trait SelectOpComponent extends SelectOpOps with SelectOpImplicits { self: DeepDSL => } - -trait ScanOpOps extends Base { this: DeepDSL => - implicit class ScanOpRep[A](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A], evidence$3: Manifest[A]) { - def foreach(f: Rep[(A => Unit)]): Rep[Unit] = scanOpForeach[A](self, f)(manifestA) - def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = scanOpFindFirst[A](self, cond)(manifestA) - def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = scanOpNullDynamicRecord[A, D](self)(manifestA, manifestD) - def open(): Rep[Unit] = scanOpOpen[A](self)(manifestA) - def next(): Rep[A] = scanOpNext[A](self)(manifestA) - def close(): Rep[Unit] = scanOpClose[A](self)(manifestA) - def reset(): Rep[Unit] = scanOpReset[A](self)(manifestA) - } - // constructors - def __newScanOp[A](table: Rep[Array[A]])(implicit evidence$3: Manifest[A], manifestA: Manifest[A]): Rep[ScanOp[A]] = scanOpNew[A](table)(manifestA) - // case classes - case class ScanOpNew[A](table: Rep[Array[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[ScanOp[A]](None, "new ScanOp", List(List(table))) - case class ScanOpForeach[A](self: Rep[ScanOp[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) - case class ScanOpFindFirst[A](self: Rep[ScanOp[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) - case class ScanOpNullDynamicRecord[A, D](self: Rep[ScanOp[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) - case class ScanOpOpen[A](self: Rep[ScanOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) - case class ScanOpNext[A](self: Rep[ScanOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) - case class ScanOpClose[A](self: Rep[ScanOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) - case class ScanOpReset[A](self: Rep[ScanOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) - // method definitions - def scanOpNew[A](table: Rep[Array[A]])(implicit manifestA: Manifest[A]): Rep[ScanOp[A]] = ScanOpNew[A](table) - def scanOpForeach[A](self: Rep[ScanOp[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = ScanOpForeach[A](self, f) - def scanOpFindFirst[A](self: Rep[ScanOp[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = ScanOpFindFirst[A](self, cond) - def scanOpNullDynamicRecord[A, D](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = ScanOpNullDynamicRecord[A, D](self) - def scanOpOpen[A](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = ScanOpOpen[A](self) - def scanOpNext[A](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A]): Rep[A] = ScanOpNext[A](self) - def scanOpClose[A](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = ScanOpClose[A](self) - def scanOpReset[A](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = ScanOpReset[A](self) - type ScanOp[A] = ch.epfl.data.legobase.queryengine.volcano.ScanOp[A] -} -trait ScanOpImplicits { this: ScanOpComponent => - // Add implicit conversions here! -} -trait ScanOpComponent extends ScanOpOps with ScanOpImplicits { self: DeepDSL => } - -trait AggOpOps extends Base { this: DeepDSL => - implicit class AggOpRep[A, B](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B], evidence$6: Manifest[B], evidence$5: Manifest[A]) { - def foreach(f: Rep[(A => Unit)]): Rep[Unit] = aggOpForeach[A, B](self, f)(manifestA, manifestB) - def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = aggOpFindFirst[A, B](self, cond)(manifestA, manifestB) - def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = aggOpNullDynamicRecord[A, B, D](self)(manifestA, manifestB, manifestD) - def open(): Rep[Unit] = aggOpOpen[A, B](self)(manifestA, manifestB) - def next(): Rep[AGGRecord[B]] = aggOpNext[A, B](self)(manifestA, manifestB) - def close(): Rep[Unit] = aggOpClose[A, B](self)(manifestA, manifestB) - def reset(): Rep[Unit] = aggOpReset[A, B](self)(manifestA, manifestB) - } - // constructors - def __newAggOp[A, B](parent: Rep[Operator[A]], numAggs: Rep[Int])(grp: Rep[(A => B)])(aggFuncs: Rep[((A, Double) => Double)]*)(implicit evidence$5: Manifest[A], evidence$6: Manifest[B], manifestA: Manifest[A], manifestB: Manifest[B]): Rep[AggOp[A, B]] = aggOpNew[A, B](parent, numAggs, grp, aggFuncs: _*)(manifestA, manifestB) - // case classes - case class AggOpNew[A, B](parent: Rep[Operator[A]], numAggs: Rep[Int], grp: Rep[((A) => B)], aggFuncsOutput: Rep[Seq[((A, Double) => Double)]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[AggOp[A, B]](None, "new AggOp", List(List(parent, numAggs), List(grp), List(__varArg(aggFuncsOutput)))) - case class AggOpForeach[A, B](self: Rep[AggOp[A, B]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) - case class AggOpFindFirst[A, B](self: Rep[AggOp[A, B]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) - case class AggOpNullDynamicRecord[A, B, D](self: Rep[AggOp[A, B]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) - case class AggOpOpen[A, B](self: Rep[AggOp[A, B]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[Unit](Some(self), "open", List()) - case class AggOpNext[A, B](self: Rep[AggOp[A, B]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[AGGRecord[B]](Some(self), "next", List()) - case class AggOpClose[A, B](self: Rep[AggOp[A, B]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[Unit](Some(self), "close", List()) - case class AggOpReset[A, B](self: Rep[AggOp[A, B]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[Unit](Some(self), "reset", List()) - // method definitions - def aggOpNew[A, B](parent: Rep[Operator[A]], numAggs: Rep[Int], grp: Rep[((A) => B)], aggFuncs: Rep[((A, Double) => Double)]*)(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[AggOp[A, B]] = { - val aggFuncsOutput = __liftSeq(aggFuncs.toSeq) - AggOpNew[A, B](parent, numAggs, grp, aggFuncsOutput) - } - def aggOpForeach[A, B](self: Rep[AggOp[A, B]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[Unit] = AggOpForeach[A, B](self, f) - def aggOpFindFirst[A, B](self: Rep[AggOp[A, B]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[A] = AggOpFindFirst[A, B](self, cond) - def aggOpNullDynamicRecord[A, B, D](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B], manifestD: Manifest[D]): Rep[D] = AggOpNullDynamicRecord[A, B, D](self) - def aggOpOpen[A, B](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[Unit] = AggOpOpen[A, B](self) - def aggOpNext[A, B](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[AGGRecord[B]] = AggOpNext[A, B](self) - def aggOpClose[A, B](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[Unit] = AggOpClose[A, B](self) - def aggOpReset[A, B](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[Unit] = AggOpReset[A, B](self) - type AggOp[A, B] = ch.epfl.data.legobase.queryengine.volcano.AggOp[A, B] -} -trait AggOpImplicits { this: AggOpComponent => - // Add implicit conversions here! -} -trait AggOpComponent extends AggOpOps with AggOpImplicits { self: DeepDSL => } - -trait MapOpOps extends Base { this: DeepDSL => - implicit class MapOpRep[A](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A], evidence$8: Manifest[A]) { - def foreach(f: Rep[(A => Unit)]): Rep[Unit] = mapOpForeach[A](self, f)(manifestA) - def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = mapOpFindFirst[A](self, cond)(manifestA) - def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = mapOpNullDynamicRecord[A, D](self)(manifestA, manifestD) - def open(): Rep[Unit] = mapOpOpen[A](self)(manifestA) - def next(): Rep[A] = mapOpNext[A](self)(manifestA) - def close(): Rep[Unit] = mapOpClose[A](self)(manifestA) - def reset(): Rep[Unit] = mapOpReset[A](self)(manifestA) - } - // constructors - def __newMapOp[A](parent: Rep[Operator[A]])(aggFuncs: Rep[(A => Unit)]*)(implicit evidence$8: Manifest[A], manifestA: Manifest[A]): Rep[MapOp[A]] = mapOpNew[A](parent, aggFuncs: _*)(manifestA) - // case classes - case class MapOpNew[A](parent: Rep[Operator[A]], aggFuncsOutput: Rep[Seq[((A) => Unit)]])(implicit val manifestA: Manifest[A]) extends FunctionDef[MapOp[A]](None, "new MapOp", List(List(parent), List(__varArg(aggFuncsOutput)))) - case class MapOpForeach[A](self: Rep[MapOp[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) - case class MapOpFindFirst[A](self: Rep[MapOp[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) - case class MapOpNullDynamicRecord[A, D](self: Rep[MapOp[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) - case class MapOpOpen[A](self: Rep[MapOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) - case class MapOpNext[A](self: Rep[MapOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) - case class MapOpClose[A](self: Rep[MapOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) - case class MapOpReset[A](self: Rep[MapOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) - // method definitions - def mapOpNew[A](parent: Rep[Operator[A]], aggFuncs: Rep[((A) => Unit)]*)(implicit manifestA: Manifest[A]): Rep[MapOp[A]] = { - val aggFuncsOutput = __liftSeq(aggFuncs.toSeq) - MapOpNew[A](parent, aggFuncsOutput) - } - def mapOpForeach[A](self: Rep[MapOp[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = MapOpForeach[A](self, f) - def mapOpFindFirst[A](self: Rep[MapOp[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = MapOpFindFirst[A](self, cond) - def mapOpNullDynamicRecord[A, D](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = MapOpNullDynamicRecord[A, D](self) - def mapOpOpen[A](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = MapOpOpen[A](self) - def mapOpNext[A](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A]): Rep[A] = MapOpNext[A](self) - def mapOpClose[A](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = MapOpClose[A](self) - def mapOpReset[A](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = MapOpReset[A](self) - type MapOp[A] = ch.epfl.data.legobase.queryengine.volcano.MapOp[A] -} -trait MapOpImplicits { this: MapOpComponent => - // Add implicit conversions here! -} -trait MapOpComponent extends MapOpOps with MapOpImplicits { self: DeepDSL => } - -trait SortOpOps extends Base { this: DeepDSL => - implicit class SortOpRep[A](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A], evidence$7: Manifest[A]) { - def foreach(f: Rep[(A => Unit)]): Rep[Unit] = sortOpForeach[A](self, f)(manifestA) - def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = sortOpFindFirst[A](self, cond)(manifestA) - def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = sortOpNullDynamicRecord[A, D](self)(manifestA, manifestD) - def open(): Rep[Unit] = sortOpOpen[A](self)(manifestA) - def next(): Rep[A] = sortOpNext[A](self)(manifestA) - def close(): Rep[Unit] = sortOpClose[A](self)(manifestA) - def reset(): Rep[Unit] = sortOpReset[A](self)(manifestA) - } - // constructors - def __newSortOp[A](parent: Rep[Operator[A]])(orderingFunc: Rep[((A, A) => Int)])(implicit evidence$7: Manifest[A], manifestA: Manifest[A]): Rep[SortOp[A]] = sortOpNew[A](parent, orderingFunc)(manifestA) - // case classes - case class SortOpNew[A](parent: Rep[Operator[A]], orderingFunc: Rep[((A, A) => Int)])(implicit val manifestA: Manifest[A]) extends FunctionDef[SortOp[A]](None, "new SortOp", List(List(parent), List(orderingFunc))) - case class SortOpForeach[A](self: Rep[SortOp[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) - case class SortOpFindFirst[A](self: Rep[SortOp[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) - case class SortOpNullDynamicRecord[A, D](self: Rep[SortOp[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) - case class SortOpOpen[A](self: Rep[SortOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) - case class SortOpNext[A](self: Rep[SortOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) - case class SortOpClose[A](self: Rep[SortOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) - case class SortOpReset[A](self: Rep[SortOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) - // method definitions - def sortOpNew[A](parent: Rep[Operator[A]], orderingFunc: Rep[((A, A) => Int)])(implicit manifestA: Manifest[A]): Rep[SortOp[A]] = SortOpNew[A](parent, orderingFunc) - def sortOpForeach[A](self: Rep[SortOp[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = SortOpForeach[A](self, f) - def sortOpFindFirst[A](self: Rep[SortOp[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = SortOpFindFirst[A](self, cond) - def sortOpNullDynamicRecord[A, D](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = SortOpNullDynamicRecord[A, D](self) - def sortOpOpen[A](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SortOpOpen[A](self) - def sortOpNext[A](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A]): Rep[A] = SortOpNext[A](self) - def sortOpClose[A](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SortOpClose[A](self) - def sortOpReset[A](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SortOpReset[A](self) - type SortOp[A] = ch.epfl.data.legobase.queryengine.volcano.SortOp[A] -} -trait SortOpImplicits { this: SortOpComponent => - // Add implicit conversions here! -} -trait SortOpComponent extends SortOpOps with SortOpImplicits { self: DeepDSL => } - -trait PrintOpOps extends Base { this: DeepDSL => - implicit class PrintOpRep[A](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A], evidence$9: Manifest[A]) { - def foreach(f: Rep[(A => Unit)]): Rep[Unit] = printOpForeach[A](self, f)(manifestA) - def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = printOpFindFirst[A](self, cond)(manifestA) - def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = printOpNullDynamicRecord[A, D](self)(manifestA, manifestD) - def open(): Rep[Unit] = printOpOpen[A](self)(manifestA) - def next(): Rep[A] = printOpNext[A](self)(manifestA) - def close(): Rep[Unit] = printOpClose[A](self)(manifestA) - def reset(): Rep[Unit] = printOpReset[A](self)(manifestA) - } - // constructors - def __newPrintOp[A](parent: Rep[Operator[A]])(printFunc: Rep[(A => Unit)], limit: Rep[(() => Boolean)])(implicit evidence$9: Manifest[A], manifestA: Manifest[A]): Rep[PrintOp[A]] = printOpNew[A](parent, printFunc, limit)(manifestA) - // case classes - case class PrintOpNew[A](parent: Rep[Operator[A]], printFunc: Rep[((A) => Unit)], limit: Rep[(() => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[PrintOp[A]](None, "new PrintOp", List(List(parent), List(printFunc, limit))) - case class PrintOpForeach[A](self: Rep[PrintOp[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) - case class PrintOpFindFirst[A](self: Rep[PrintOp[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) - case class PrintOpNullDynamicRecord[A, D](self: Rep[PrintOp[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) - case class PrintOpOpen[A](self: Rep[PrintOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) - case class PrintOpNext[A](self: Rep[PrintOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) - case class PrintOpClose[A](self: Rep[PrintOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) - case class PrintOpReset[A](self: Rep[PrintOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) - // method definitions - def printOpNew[A](parent: Rep[Operator[A]], printFunc: Rep[((A) => Unit)], limit: Rep[(() => Boolean)])(implicit manifestA: Manifest[A]): Rep[PrintOp[A]] = PrintOpNew[A](parent, printFunc, limit) - def printOpForeach[A](self: Rep[PrintOp[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = PrintOpForeach[A](self, f) - def printOpFindFirst[A](self: Rep[PrintOp[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = PrintOpFindFirst[A](self, cond) - def printOpNullDynamicRecord[A, D](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = PrintOpNullDynamicRecord[A, D](self) - def printOpOpen[A](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = PrintOpOpen[A](self) - def printOpNext[A](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A]): Rep[A] = PrintOpNext[A](self) - def printOpClose[A](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = PrintOpClose[A](self) - def printOpReset[A](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = PrintOpReset[A](self) - type PrintOp[A] = ch.epfl.data.legobase.queryengine.volcano.PrintOp[A] -} -trait PrintOpImplicits { this: PrintOpComponent => - // Add implicit conversions here! -} -trait PrintOpComponent extends PrintOpOps with PrintOpImplicits { self: DeepDSL => } - trait AGGRecordOps extends Base { this: DeepDSL => implicit class AGGRecordRep[B](self: Rep[AGGRecord[B]])(implicit manifestB: Manifest[B]) { @@ -252,43 +24,6 @@ trait AGGRecordImplicits { this: AGGRecordComponent => } trait AGGRecordComponent extends AGGRecordOps with AGGRecordImplicits { self: DeepDSL => } -trait OperatorOps extends Base { this: DeepDSL => - implicit class OperatorRep[A](self: Rep[Operator[A]])(implicit manifestA: Manifest[A], evidence$1: Manifest[A]) { - def open(): Rep[Unit] = operatorOpen[A](self)(manifestA) - def next(): Rep[A] = operatorNext[A](self)(manifestA) - def close(): Rep[Unit] = operatorClose[A](self)(manifestA) - def reset(): Rep[Unit] = operatorReset[A](self)(manifestA) - def foreach(f: Rep[(A => Unit)]): Rep[Unit] = operatorForeach[A](self, f)(manifestA) - def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = operatorFindFirst[A](self, cond)(manifestA) - def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = operatorNullDynamicRecord[A, D](self)(manifestA, manifestD) - } - // constructors - def __newOperator[A](implicit evidence$1: Manifest[A], manifestA: Manifest[A]): Rep[Operator[A]] = operatorNew[A](manifestA) - // case classes - case class OperatorNew[A]()(implicit val manifestA: Manifest[A]) extends FunctionDef[Operator[A]](None, "new Operator", List()) - case class OperatorOpen[A](self: Rep[Operator[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) - case class OperatorNext[A](self: Rep[Operator[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) - case class OperatorClose[A](self: Rep[Operator[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) - case class OperatorReset[A](self: Rep[Operator[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) - case class OperatorForeach[A](self: Rep[Operator[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) - case class OperatorFindFirst[A](self: Rep[Operator[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) - case class OperatorNullDynamicRecord[A, D](self: Rep[Operator[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) - // method definitions - def operatorNew[A](implicit manifestA: Manifest[A]): Rep[Operator[A]] = OperatorNew[A]() - def operatorOpen[A](self: Rep[Operator[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = OperatorOpen[A](self) - def operatorNext[A](self: Rep[Operator[A]])(implicit manifestA: Manifest[A]): Rep[A] = OperatorNext[A](self) - def operatorClose[A](self: Rep[Operator[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = OperatorClose[A](self) - def operatorReset[A](self: Rep[Operator[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = OperatorReset[A](self) - def operatorForeach[A](self: Rep[Operator[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = OperatorForeach[A](self, f) - def operatorFindFirst[A](self: Rep[Operator[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = OperatorFindFirst[A](self, cond) - def operatorNullDynamicRecord[A, D](self: Rep[Operator[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = OperatorNullDynamicRecord[A, D](self) - type Operator[A] = ch.epfl.data.legobase.queryengine.volcano.Operator[A] -} -trait OperatorImplicits { this: OperatorComponent => - // Add implicit conversions here! -} -trait OperatorComponent extends OperatorOps with OperatorImplicits { self: DeepDSL => } - trait LINEITEMRecordOps extends Base { this: DeepDSL => implicit class LINEITEMRecordRep(self: Rep[LINEITEMRecord]) { @@ -343,5 +78,9 @@ trait K2DBScannerImplicits { this: K2DBScannerComponent => } trait K2DBScannerComponent extends K2DBScannerOps with K2DBScannerImplicits { self: DeepDSL => } -trait DeepDSL extends SelectOpComponent with ScanOpComponent with AggOpComponent with MapOpComponent with SortOpComponent with AGGRecordComponent with OperatorComponent with CharacterComponent with DoubleComponent with IntComponent with LongComponent with ArrayComponent with LINEITEMRecordComponent with K2DBScannerComponent with IntegerComponent with BooleanComponent with HashMapComponent with SetComponent with TreeSetComponent with DefaultEntryComponent with ManualLiftedLegoBase with PrintOpComponent +trait DeepDSL extends OperatorsComponent with AGGRecordComponent with CharacterComponent + with DoubleComponent with IntComponent with LongComponent with ArrayComponent + with LINEITEMRecordComponent with K2DBScannerComponent with IntegerComponent + with BooleanComponent with HashMapComponent with SetComponent with TreeSetComponent + with DefaultEntryComponent with ManualLiftedLegoBase diff --git a/legocompiler/src/main/scala/ch/epfl/data/legobase/deep/Operators.scala b/legocompiler/src/main/scala/ch/epfl/data/legobase/deep/Operators.scala new file mode 100644 index 00000000..e97a272d --- /dev/null +++ b/legocompiler/src/main/scala/ch/epfl/data/legobase/deep/Operators.scala @@ -0,0 +1,266 @@ + +package ch.epfl.data +package legobase +package deep + +import scalalib._ +import pardis.ir._ +trait OperatorOps extends Base { this: OperatorsComponent => + implicit class OperatorRep[A](self: Rep[Operator[A]])(implicit manifestA: Manifest[A], evidence$1: Manifest[A]) { + def open(): Rep[Unit] = operatorOpen[A](self)(manifestA) + def next(): Rep[A] = operatorNext[A](self)(manifestA) + def close(): Rep[Unit] = operatorClose[A](self)(manifestA) + def reset(): Rep[Unit] = operatorReset[A](self)(manifestA) + def foreach(f: Rep[(A => Unit)]): Rep[Unit] = operatorForeach[A](self, f)(manifestA) + def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = operatorFindFirst[A](self, cond)(manifestA) + def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = operatorNullDynamicRecord[A, D](self)(manifestA, manifestD) + } + // constructors + def __newOperator[A](implicit evidence$1: Manifest[A], manifestA: Manifest[A]): Rep[Operator[A]] = operatorNew[A](manifestA) + // case classes + case class OperatorNew[A]()(implicit val manifestA: Manifest[A]) extends FunctionDef[Operator[A]](None, "new Operator", List()) + case class OperatorOpen[A](self: Rep[Operator[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) + case class OperatorNext[A](self: Rep[Operator[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) + case class OperatorClose[A](self: Rep[Operator[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) + case class OperatorReset[A](self: Rep[Operator[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) + case class OperatorForeach[A](self: Rep[Operator[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) + case class OperatorFindFirst[A](self: Rep[Operator[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) + case class OperatorNullDynamicRecord[A, D](self: Rep[Operator[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) + // method definitions + def operatorNew[A](implicit manifestA: Manifest[A]): Rep[Operator[A]] = OperatorNew[A]() + def operatorOpen[A](self: Rep[Operator[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = OperatorOpen[A](self) + def operatorNext[A](self: Rep[Operator[A]])(implicit manifestA: Manifest[A]): Rep[A] = OperatorNext[A](self) + def operatorClose[A](self: Rep[Operator[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = OperatorClose[A](self) + def operatorReset[A](self: Rep[Operator[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = OperatorReset[A](self) + def operatorForeach[A](self: Rep[Operator[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = OperatorForeach[A](self, f) + def operatorFindFirst[A](self: Rep[Operator[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = OperatorFindFirst[A](self, cond) + def operatorNullDynamicRecord[A, D](self: Rep[Operator[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = OperatorNullDynamicRecord[A, D](self) + type Operator[A] = ch.epfl.data.legobase.queryengine.volcano.Operator[A] +} +trait OperatorImplicits { this: OperatorComponent => + // Add implicit conversions here! +} +trait OperatorComponent extends OperatorOps with OperatorImplicits { self: OperatorsComponent => } +trait ScanOpOps extends Base { this: OperatorsComponent => + implicit class ScanOpRep[A](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A], evidence$3: Manifest[A]) { + def foreach(f: Rep[(A => Unit)]): Rep[Unit] = scanOpForeach[A](self, f)(manifestA) + def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = scanOpFindFirst[A](self, cond)(manifestA) + def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = scanOpNullDynamicRecord[A, D](self)(manifestA, manifestD) + def open(): Rep[Unit] = scanOpOpen[A](self)(manifestA) + def next(): Rep[A] = scanOpNext[A](self)(manifestA) + def close(): Rep[Unit] = scanOpClose[A](self)(manifestA) + def reset(): Rep[Unit] = scanOpReset[A](self)(manifestA) + } + // constructors + def __newScanOp[A](table: Rep[Array[A]])(implicit evidence$3: Manifest[A], manifestA: Manifest[A]): Rep[ScanOp[A]] = scanOpNew[A](table)(manifestA) + // case classes + case class ScanOpNew[A](table: Rep[Array[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[ScanOp[A]](None, "new ScanOp", List(List(table))) + case class ScanOpForeach[A](self: Rep[ScanOp[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) + case class ScanOpFindFirst[A](self: Rep[ScanOp[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) + case class ScanOpNullDynamicRecord[A, D](self: Rep[ScanOp[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) + case class ScanOpOpen[A](self: Rep[ScanOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) + case class ScanOpNext[A](self: Rep[ScanOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) + case class ScanOpClose[A](self: Rep[ScanOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) + case class ScanOpReset[A](self: Rep[ScanOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) + // method definitions + def scanOpNew[A](table: Rep[Array[A]])(implicit manifestA: Manifest[A]): Rep[ScanOp[A]] = ScanOpNew[A](table) + def scanOpForeach[A](self: Rep[ScanOp[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = ScanOpForeach[A](self, f) + def scanOpFindFirst[A](self: Rep[ScanOp[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = ScanOpFindFirst[A](self, cond) + def scanOpNullDynamicRecord[A, D](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = ScanOpNullDynamicRecord[A, D](self) + def scanOpOpen[A](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = ScanOpOpen[A](self) + def scanOpNext[A](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A]): Rep[A] = ScanOpNext[A](self) + def scanOpClose[A](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = ScanOpClose[A](self) + def scanOpReset[A](self: Rep[ScanOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = ScanOpReset[A](self) + type ScanOp[A] = ch.epfl.data.legobase.queryengine.volcano.ScanOp[A] +} +trait ScanOpImplicits { this: ScanOpComponent => + // Add implicit conversions here! +} +trait ScanOpComponent extends ScanOpOps with ScanOpImplicits { self: OperatorsComponent => } +trait SelectOpOps extends Base { this: OperatorsComponent => + implicit class SelectOpRep[A](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A], evidence$4: Manifest[A]) { + def foreach(f: Rep[(A => Unit)]): Rep[Unit] = selectOpForeach[A](self, f)(manifestA) + def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = selectOpFindFirst[A](self, cond)(manifestA) + def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = selectOpNullDynamicRecord[A, D](self)(manifestA, manifestD) + def open(): Rep[Unit] = selectOpOpen[A](self)(manifestA) + def next(): Rep[A] = selectOpNext[A](self)(manifestA) + def close(): Rep[Unit] = selectOpClose[A](self)(manifestA) + def reset(): Rep[Unit] = selectOpReset[A](self)(manifestA) + } + // constructors + def __newSelectOp[A](parent: Rep[Operator[A]])(selectPred: Rep[(A => Boolean)])(implicit evidence$4: Manifest[A], manifestA: Manifest[A]): Rep[SelectOp[A]] = selectOpNew[A](parent, selectPred)(manifestA) + // case classes + case class SelectOpNew[A](parent: Rep[Operator[A]], selectPred: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[SelectOp[A]](None, "new SelectOp", List(List(parent), List(selectPred))) + case class SelectOpForeach[A](self: Rep[SelectOp[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) + case class SelectOpFindFirst[A](self: Rep[SelectOp[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) + case class SelectOpNullDynamicRecord[A, D](self: Rep[SelectOp[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) + case class SelectOpOpen[A](self: Rep[SelectOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) + case class SelectOpNext[A](self: Rep[SelectOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) + case class SelectOpClose[A](self: Rep[SelectOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) + case class SelectOpReset[A](self: Rep[SelectOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) + // method definitions + def selectOpNew[A](parent: Rep[Operator[A]], selectPred: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[SelectOp[A]] = SelectOpNew[A](parent, selectPred) + def selectOpForeach[A](self: Rep[SelectOp[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = SelectOpForeach[A](self, f) + def selectOpFindFirst[A](self: Rep[SelectOp[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = SelectOpFindFirst[A](self, cond) + def selectOpNullDynamicRecord[A, D](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = SelectOpNullDynamicRecord[A, D](self) + def selectOpOpen[A](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SelectOpOpen[A](self) + def selectOpNext[A](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A]): Rep[A] = SelectOpNext[A](self) + def selectOpClose[A](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SelectOpClose[A](self) + def selectOpReset[A](self: Rep[SelectOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SelectOpReset[A](self) + type SelectOp[A] = ch.epfl.data.legobase.queryengine.volcano.SelectOp[A] +} +trait SelectOpImplicits { this: SelectOpComponent => + // Add implicit conversions here! +} +trait SelectOpComponent extends SelectOpOps with SelectOpImplicits { self: OperatorsComponent => } +trait AggOpOps extends Base { this: OperatorsComponent => + implicit class AggOpRep[A, B](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B], evidence$6: Manifest[B], evidence$5: Manifest[A]) { + def foreach(f: Rep[(A => Unit)]): Rep[Unit] = aggOpForeach[A, B](self, f)(manifestA, manifestB) + def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = aggOpFindFirst[A, B](self, cond)(manifestA, manifestB) + def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = aggOpNullDynamicRecord[A, B, D](self)(manifestA, manifestB, manifestD) + def open(): Rep[Unit] = aggOpOpen[A, B](self)(manifestA, manifestB) + def next(): Rep[AGGRecord[B]] = aggOpNext[A, B](self)(manifestA, manifestB) + def close(): Rep[Unit] = aggOpClose[A, B](self)(manifestA, manifestB) + def reset(): Rep[Unit] = aggOpReset[A, B](self)(manifestA, manifestB) + } + // constructors + def __newAggOp[A, B](parent: Rep[Operator[A]], numAggs: Rep[Int])(grp: Rep[(A => B)])(aggFuncs: Rep[((A, Double) => Double)]*)(implicit evidence$5: Manifest[A], evidence$6: Manifest[B], manifestA: Manifest[A], manifestB: Manifest[B]): Rep[AggOp[A, B]] = aggOpNew[A, B](parent, numAggs, grp, aggFuncs: _*)(manifestA, manifestB) + // case classes + case class AggOpNew[A, B](parent: Rep[Operator[A]], numAggs: Rep[Int], grp: Rep[((A) => B)], aggFuncsOutput: Rep[Seq[((A, Double) => Double)]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[AggOp[A, B]](None, "new AggOp", List(List(parent, numAggs), List(grp), List(__varArg(aggFuncsOutput)))) + case class AggOpForeach[A, B](self: Rep[AggOp[A, B]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) + case class AggOpFindFirst[A, B](self: Rep[AggOp[A, B]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) + case class AggOpNullDynamicRecord[A, B, D](self: Rep[AggOp[A, B]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) + case class AggOpOpen[A, B](self: Rep[AggOp[A, B]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[Unit](Some(self), "open", List()) + case class AggOpNext[A, B](self: Rep[AggOp[A, B]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[AGGRecord[B]](Some(self), "next", List()) + case class AggOpClose[A, B](self: Rep[AggOp[A, B]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[Unit](Some(self), "close", List()) + case class AggOpReset[A, B](self: Rep[AggOp[A, B]])(implicit val manifestA: Manifest[A], val manifestB: Manifest[B]) extends FunctionDef[Unit](Some(self), "reset", List()) + // method definitions + def aggOpNew[A, B](parent: Rep[Operator[A]], numAggs: Rep[Int], grp: Rep[((A) => B)], aggFuncs: Rep[((A, Double) => Double)]*)(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[AggOp[A, B]] = { + val aggFuncsOutput = __liftSeq(aggFuncs.toSeq) + AggOpNew[A, B](parent, numAggs, grp, aggFuncsOutput) + } + def aggOpForeach[A, B](self: Rep[AggOp[A, B]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[Unit] = AggOpForeach[A, B](self, f) + def aggOpFindFirst[A, B](self: Rep[AggOp[A, B]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[A] = AggOpFindFirst[A, B](self, cond) + def aggOpNullDynamicRecord[A, B, D](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B], manifestD: Manifest[D]): Rep[D] = AggOpNullDynamicRecord[A, B, D](self) + def aggOpOpen[A, B](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[Unit] = AggOpOpen[A, B](self) + def aggOpNext[A, B](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[AGGRecord[B]] = AggOpNext[A, B](self) + def aggOpClose[A, B](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[Unit] = AggOpClose[A, B](self) + def aggOpReset[A, B](self: Rep[AggOp[A, B]])(implicit manifestA: Manifest[A], manifestB: Manifest[B]): Rep[Unit] = AggOpReset[A, B](self) + type AggOp[A, B] = ch.epfl.data.legobase.queryengine.volcano.AggOp[A, B] +} +trait AggOpImplicits { this: AggOpComponent => + // Add implicit conversions here! +} +trait AggOpComponent extends AggOpOps with AggOpImplicits { self: OperatorsComponent => } +trait SortOpOps extends Base { this: OperatorsComponent => + implicit class SortOpRep[A](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A], evidence$7: Manifest[A]) { + def foreach(f: Rep[(A => Unit)]): Rep[Unit] = sortOpForeach[A](self, f)(manifestA) + def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = sortOpFindFirst[A](self, cond)(manifestA) + def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = sortOpNullDynamicRecord[A, D](self)(manifestA, manifestD) + def open(): Rep[Unit] = sortOpOpen[A](self)(manifestA) + def next(): Rep[A] = sortOpNext[A](self)(manifestA) + def close(): Rep[Unit] = sortOpClose[A](self)(manifestA) + def reset(): Rep[Unit] = sortOpReset[A](self)(manifestA) + } + // constructors + def __newSortOp[A](parent: Rep[Operator[A]])(orderingFunc: Rep[((A, A) => Int)])(implicit evidence$7: Manifest[A], manifestA: Manifest[A]): Rep[SortOp[A]] = sortOpNew[A](parent, orderingFunc)(manifestA) + // case classes + case class SortOpNew[A](parent: Rep[Operator[A]], orderingFunc: Rep[((A, A) => Int)])(implicit val manifestA: Manifest[A]) extends FunctionDef[SortOp[A]](None, "new SortOp", List(List(parent), List(orderingFunc))) + case class SortOpForeach[A](self: Rep[SortOp[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) + case class SortOpFindFirst[A](self: Rep[SortOp[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) + case class SortOpNullDynamicRecord[A, D](self: Rep[SortOp[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) + case class SortOpOpen[A](self: Rep[SortOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) + case class SortOpNext[A](self: Rep[SortOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) + case class SortOpClose[A](self: Rep[SortOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) + case class SortOpReset[A](self: Rep[SortOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) + // method definitions + def sortOpNew[A](parent: Rep[Operator[A]], orderingFunc: Rep[((A, A) => Int)])(implicit manifestA: Manifest[A]): Rep[SortOp[A]] = SortOpNew[A](parent, orderingFunc) + def sortOpForeach[A](self: Rep[SortOp[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = SortOpForeach[A](self, f) + def sortOpFindFirst[A](self: Rep[SortOp[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = SortOpFindFirst[A](self, cond) + def sortOpNullDynamicRecord[A, D](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = SortOpNullDynamicRecord[A, D](self) + def sortOpOpen[A](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SortOpOpen[A](self) + def sortOpNext[A](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A]): Rep[A] = SortOpNext[A](self) + def sortOpClose[A](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SortOpClose[A](self) + def sortOpReset[A](self: Rep[SortOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = SortOpReset[A](self) + type SortOp[A] = ch.epfl.data.legobase.queryengine.volcano.SortOp[A] +} +trait SortOpImplicits { this: SortOpComponent => + // Add implicit conversions here! +} +trait SortOpComponent extends SortOpOps with SortOpImplicits { self: OperatorsComponent => } +trait MapOpOps extends Base { this: OperatorsComponent => + implicit class MapOpRep[A](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A], evidence$8: Manifest[A]) { + def foreach(f: Rep[(A => Unit)]): Rep[Unit] = mapOpForeach[A](self, f)(manifestA) + def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = mapOpFindFirst[A](self, cond)(manifestA) + def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = mapOpNullDynamicRecord[A, D](self)(manifestA, manifestD) + def open(): Rep[Unit] = mapOpOpen[A](self)(manifestA) + def next(): Rep[A] = mapOpNext[A](self)(manifestA) + def close(): Rep[Unit] = mapOpClose[A](self)(manifestA) + def reset(): Rep[Unit] = mapOpReset[A](self)(manifestA) + } + // constructors + def __newMapOp[A](parent: Rep[Operator[A]])(aggFuncs: Rep[(A => Unit)]*)(implicit evidence$8: Manifest[A], manifestA: Manifest[A]): Rep[MapOp[A]] = mapOpNew[A](parent, aggFuncs: _*)(manifestA) + // case classes + case class MapOpNew[A](parent: Rep[Operator[A]], aggFuncsOutput: Rep[Seq[((A) => Unit)]])(implicit val manifestA: Manifest[A]) extends FunctionDef[MapOp[A]](None, "new MapOp", List(List(parent), List(__varArg(aggFuncsOutput)))) + case class MapOpForeach[A](self: Rep[MapOp[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) + case class MapOpFindFirst[A](self: Rep[MapOp[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) + case class MapOpNullDynamicRecord[A, D](self: Rep[MapOp[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) + case class MapOpOpen[A](self: Rep[MapOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) + case class MapOpNext[A](self: Rep[MapOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) + case class MapOpClose[A](self: Rep[MapOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) + case class MapOpReset[A](self: Rep[MapOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) + // method definitions + def mapOpNew[A](parent: Rep[Operator[A]], aggFuncs: Rep[((A) => Unit)]*)(implicit manifestA: Manifest[A]): Rep[MapOp[A]] = { + val aggFuncsOutput = __liftSeq(aggFuncs.toSeq) + MapOpNew[A](parent, aggFuncsOutput) + } + def mapOpForeach[A](self: Rep[MapOp[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = MapOpForeach[A](self, f) + def mapOpFindFirst[A](self: Rep[MapOp[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = MapOpFindFirst[A](self, cond) + def mapOpNullDynamicRecord[A, D](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = MapOpNullDynamicRecord[A, D](self) + def mapOpOpen[A](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = MapOpOpen[A](self) + def mapOpNext[A](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A]): Rep[A] = MapOpNext[A](self) + def mapOpClose[A](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = MapOpClose[A](self) + def mapOpReset[A](self: Rep[MapOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = MapOpReset[A](self) + type MapOp[A] = ch.epfl.data.legobase.queryengine.volcano.MapOp[A] +} +trait MapOpImplicits { this: MapOpComponent => + // Add implicit conversions here! +} +trait MapOpComponent extends MapOpOps with MapOpImplicits { self: OperatorsComponent => } +trait PrintOpOps extends Base { this: OperatorsComponent => + implicit class PrintOpRep[A](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A], evidence$9: Manifest[A]) { + def foreach(f: Rep[(A => Unit)]): Rep[Unit] = printOpForeach[A](self, f)(manifestA) + def findFirst(cond: Rep[(A => Boolean)]): Rep[A] = printOpFindFirst[A](self, cond)(manifestA) + def NullDynamicRecord[D](implicit manifestD: Manifest[D]): Rep[D] = printOpNullDynamicRecord[A, D](self)(manifestA, manifestD) + def open(): Rep[Unit] = printOpOpen[A](self)(manifestA) + def next(): Rep[A] = printOpNext[A](self)(manifestA) + def close(): Rep[Unit] = printOpClose[A](self)(manifestA) + def reset(): Rep[Unit] = printOpReset[A](self)(manifestA) + } + // constructors + def __newPrintOp[A](parent: Rep[Operator[A]])(printFunc: Rep[(A => Unit)], limit: Rep[(() => Boolean)])(implicit evidence$9: Manifest[A], manifestA: Manifest[A]): Rep[PrintOp[A]] = printOpNew[A](parent, printFunc, limit)(manifestA) + // case classes + case class PrintOpNew[A](parent: Rep[Operator[A]], printFunc: Rep[((A) => Unit)], limit: Rep[(() => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[PrintOp[A]](None, "new PrintOp", List(List(parent), List(printFunc, limit))) + case class PrintOpForeach[A](self: Rep[PrintOp[A]], f: Rep[((A) => Unit)])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "foreach", List(List(f))) + case class PrintOpFindFirst[A](self: Rep[PrintOp[A]], cond: Rep[((A) => Boolean)])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "findFirst", List(List(cond))) + case class PrintOpNullDynamicRecord[A, D](self: Rep[PrintOp[A]])(implicit val manifestA: Manifest[A], val manifestD: Manifest[D]) extends FunctionDef[D](Some(self), "NullDynamicRecord", List()) + case class PrintOpOpen[A](self: Rep[PrintOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "open", List()) + case class PrintOpNext[A](self: Rep[PrintOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[A](Some(self), "next", List()) + case class PrintOpClose[A](self: Rep[PrintOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "close", List()) + case class PrintOpReset[A](self: Rep[PrintOp[A]])(implicit val manifestA: Manifest[A]) extends FunctionDef[Unit](Some(self), "reset", List()) + // method definitions + def printOpNew[A](parent: Rep[Operator[A]], printFunc: Rep[((A) => Unit)], limit: Rep[(() => Boolean)])(implicit manifestA: Manifest[A]): Rep[PrintOp[A]] = PrintOpNew[A](parent, printFunc, limit) + def printOpForeach[A](self: Rep[PrintOp[A]], f: Rep[((A) => Unit)])(implicit manifestA: Manifest[A]): Rep[Unit] = PrintOpForeach[A](self, f) + def printOpFindFirst[A](self: Rep[PrintOp[A]], cond: Rep[((A) => Boolean)])(implicit manifestA: Manifest[A]): Rep[A] = PrintOpFindFirst[A](self, cond) + def printOpNullDynamicRecord[A, D](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A], manifestD: Manifest[D]): Rep[D] = PrintOpNullDynamicRecord[A, D](self) + def printOpOpen[A](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = PrintOpOpen[A](self) + def printOpNext[A](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A]): Rep[A] = PrintOpNext[A](self) + def printOpClose[A](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = PrintOpClose[A](self) + def printOpReset[A](self: Rep[PrintOp[A]])(implicit manifestA: Manifest[A]): Rep[Unit] = PrintOpReset[A](self) + type PrintOp[A] = ch.epfl.data.legobase.queryengine.volcano.PrintOp[A] +} +trait PrintOpImplicits { this: PrintOpComponent => + // Add implicit conversions here! +} +trait PrintOpComponent extends PrintOpOps with PrintOpImplicits { self: OperatorsComponent => } +trait OperatorsComponent extends OperatorComponent with ScanOpComponent with SelectOpComponent with AggOpComponent with SortOpComponent with MapOpComponent with PrintOpComponent with AGGRecordComponent with CharacterComponent with DoubleComponent with IntComponent with LongComponent with ArrayComponent with LINEITEMRecordComponent with K2DBScannerComponent with IntegerComponent with BooleanComponent with HashMapComponent with SetComponent with TreeSetComponent with DefaultEntryComponent with ManualLiftedLegoBase { self: DeepDSL => } \ No newline at end of file diff --git a/legolifter/src/main/scala/LiftLego.scala b/legolifter/src/main/scala/LiftLego.scala index 39ab9a6d..fff6018e 100644 --- a/legolifter/src/main/scala/LiftLego.scala +++ b/legolifter/src/main/scala/LiftLego.scala @@ -52,14 +52,8 @@ $liftedCode } def generateLegoBase(implicit al: AutoLifter) { - val liftedCodes = List(al.autoLift[SelectOp[Any]], - al.autoLift[ScanOp[Any]], - al.autoLift[AggOp[Any, Any]], - al.autoLift[MapOp[Any]], - al.autoLift[SortOp[Any]], - al.autoLift[PrintOp[Any]], + val liftedCodes = List( al.autoLift[queryengine.AGGRecord[Any]], - al.autoLift[Operator[Any]], al.autoLift[storagemanager.TPCHRelations.LINEITEMRecord], al.autoLift[storagemanager.K2DBScanner]) val liftedCode = liftedCodes.mkString("\n") @@ -75,7 +69,11 @@ import scalalib._ import pardis.ir._ $liftedCode -trait DeepDSL extends SelectOpComponent with ScanOpComponent with AggOpComponent with MapOpComponent with SortOpComponent with AGGRecordComponent with OperatorComponent with CharacterComponent with DoubleComponent with IntComponent with LongComponent with ArrayComponent with LINEITEMRecordComponent with K2DBScannerComponent with IntegerComponent with BooleanComponent with HashMapComponent with SetComponent with TreeSetComponent with DefaultEntryComponent with ManualLiftedLegoBase with PrintOpComponent +trait DeepDSL extends OperatorsComponent with AGGRecordComponent with CharacterComponent + with DoubleComponent with IntComponent with LongComponent with ArrayComponent + with LINEITEMRecordComponent with K2DBScannerComponent with IntegerComponent + with BooleanComponent with HashMapComponent with SetComponent with TreeSetComponent + with DefaultEntryComponent with ManualLiftedLegoBase """) } } diff --git a/project/Build.scala b/project/Build.scala index bafb2f43..4b1e3d12 100755 --- a/project/Build.scala +++ b/project/Build.scala @@ -45,7 +45,7 @@ object LegoBuild extends Build { .setPreference(AlignSingleLineCaseStatements, true) } - lazy val lego = Project(id = "root", base = file("."), settings = defaults) aggregate (lego_core, legolifter, legocompiler) + lazy val lego = Project(id = "root", base = file("."), settings = defaults) aggregate (lego_core, legolifter, legocompiler) lazy val lego_core = Project(id = "lego-core", base = file("lego") , settings = defaults ++ Seq(name := "lego-core", libraryDependencies += "ch.epfl.data" % "autolifter_2.11" % "0.1-SNAPSHOT")) // hack for being able to generate implementation