Skip to content

Commit

Permalink
Merge pull request #3 from rxin/packagename
Browse files Browse the repository at this point in the history
Rename shark2 package to execution.
  • Loading branch information
rxin committed Jan 3, 2014
2 parents 0892153 + 72426ed commit da16e45
Show file tree
Hide file tree
Showing 27 changed files with 47 additions and 47 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $ sbt/sbt
> test:compile
[info] Compiling 10 Scala sources to catalyst/target/scala-2.10/test-classes...
[success] Total time: 15 s, completed Dec 20, 2013 12:00:06 PM
> test-only catalyst.shark2.DslQueryTests
> test-only catalyst.execution.DslQueryTests
```

Any command that is prefixed with a `~` (e.g. `~compile`) will be run automatically in a loop each time any dependent files have changed.
Expand Down Expand Up @@ -54,13 +54,13 @@ import catalyst.plans.logical._
import catalyst.rules._
import catalyst.types._
import catalyst.util._
import catalyst.shark2.TestShark._
import catalyst.execution.TestShark._
Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_45).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val query = "SELECT * FROM (SELECT * FROM src) a".q
query: catalyst.shark2.TestShark.SharkSqlQuery =
query: catalyst.execution.TestShark.SharkSqlQuery =
SELECT * FROM (SELECT * FROM src) a
== Logical Plan ==
Project {key#0,value#1}
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import catalyst.plans.logical._
import catalyst.rules._
import catalyst.types._
import catalyst.util._
import catalyst.shark2.TestShark._"""
import catalyst.execution.TestShark._"""

site.settings

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/catalyst/examples/SchemaRddExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package examples

import plans.logical.LocalRelation

import shark2.TestShark._
import execution.TestShark._
import dsl._

object SchemaRddExample {
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/catalyst/examples/ViewsExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import catalyst.plans.logical._

/* Implicit Conversions */
import dsl._
import shark2.TestShark._ // For .toRdd execution using locally running test Shark.
import execution.TestShark._ // For .toRdd execution using locally running test Shark.

object ViewsExample {
def main(args: Array[String]): Unit = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import org.apache.hadoop.hive.ql.exec.{FunctionInfo, FunctionRegistry}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import org.apache.hadoop.hive.conf.HiveConf
import org.apache.hadoop.hive.metastore.api.{FieldSchema, Partition, Table, StorageDescriptor, SerDeInfo}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import java.io.File

Expand Down Expand Up @@ -40,7 +40,7 @@ abstract class SharkInstance extends Logging {
lazy val sc = createContext()

protected def createContext() = {
SharkEnv.initWithSharkContext("catalyst.shark2", master)
SharkEnv.initWithSharkContext("catalyst.execution", master)
}

/** Sets up the system initially or after a RESET command */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import catalyst.plans.QueryPlan
import org.apache.spark.rdd.RDD
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import java.io.File
import scala.collection.mutable
Expand Down Expand Up @@ -56,7 +56,7 @@ object TestShark extends SharkInstance {
System.clearProperty("spark.driver.port")
System.clearProperty("spark.hostPort")

SharkEnv.initWithSharkContext("catalyst.shark2.TestShark", master)
SharkEnv.initWithSharkContext("catalyst.execution.TestShark", master)
}

/** The location of the compiled hive distribution */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import catalyst.expressions._
import shark.SharkContext
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import catalyst.errors._
import catalyst.expressions._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import org.apache.hadoop.hive.ql.plan.{FileSinkDesc, TableDesc}
import org.apache.hadoop.hive.serde2.objectinspector.{PrimitiveObjectInspector, StructObjectInspector}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

object DebugQuery {
def apply(plan: SharkPlan): SharkPlan = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import org.apache.hadoop.fs.Path
import org.apache.hadoop.hive.ql.io.HiveFileFormatUtils
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import org.apache.spark.rdd.RDD

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import types._
* Currently functions that are not supported by this implementation are passed back to the original Shark
* implementation for execution.
*/
package object shark2 {
package object execution {
type Row = catalyst.expressions.Row

implicit class typeInfoConversions(dt: DataType) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import shark.SharkContext

Expand All @@ -25,9 +25,9 @@ abstract trait PlanningStrategies {
def apply(plan: LogicalPlan): Seq[SharkPlan] = plan match {
// Push attributes into table scan when possible.
case p @ logical.Project(projectList, m: MetastoreRelation) if isSimpleProject(projectList) =>
shark2.HiveTableScan(projectList.asInstanceOf[Seq[Attribute]], m) :: Nil
execution.HiveTableScan(projectList.asInstanceOf[Seq[Attribute]], m) :: Nil
case m: MetastoreRelation =>
shark2.HiveTableScan(m.output, m) :: Nil
execution.HiveTableScan(m.output, m) :: Nil
case _ => Nil
}

Expand Down Expand Up @@ -59,7 +59,7 @@ abstract trait PlanningStrategies {

def apply(plan: LogicalPlan): Seq[SharkPlan] = plan match {
case logical.Aggregate(Nil, agg, child) if onlyAllowedAggregates(agg) =>
shark2.SparkAggregate(agg, planLater(child))(sc) :: Nil
execution.SparkAggregate(agg, planLater(child))(sc) :: Nil
case _ => Nil
}
}
Expand Down Expand Up @@ -87,11 +87,11 @@ abstract trait PlanningStrategies {
val leftKeys = joinKeys.map(_._1)
val rightKeys = joinKeys.map(_._2)

val joinOp = shark2.SparkEquiInnerJoin(leftKeys, rightKeys, planLater(left), planLater(right))
val joinOp = execution.SparkEquiInnerJoin(leftKeys, rightKeys, planLater(left), planLater(right))

// Make sure other conditions are met if present.
if(otherPredicates.nonEmpty)
shark2.Filter(combineConjunctivePredicates(otherPredicates), joinOp) :: Nil
execution.Filter(combineConjunctivePredicates(otherPredicates), joinOp) :: Nil
else
joinOp :: Nil
} else {
Expand All @@ -112,17 +112,17 @@ abstract trait PlanningStrategies {
object BroadcastNestedLoopJoin extends Strategy {
def apply(plan: LogicalPlan): Seq[SharkPlan] = plan match {
case logical.Join(left, right, joinType, condition) =>
shark2.BroadcastNestedLoopJoin(planLater(left), planLater(right), joinType, condition)(sc) :: Nil
execution.BroadcastNestedLoopJoin(planLater(left), planLater(right), joinType, condition)(sc) :: Nil
case _ => Nil
}
}

object CartesianProduct extends Strategy {
def apply(plan: LogicalPlan): Seq[SharkPlan] = plan match {
case logical.Join(left, right, _, None) => shark2.CartesianProduct(planLater(left), planLater(right)) :: Nil
case logical.Join(left, right, _, None) => execution.CartesianProduct(planLater(left), planLater(right)) :: Nil
case logical.Join(left, right, Inner, Some(condition)) =>
shark2.Filter(condition,
shark2.CartesianProduct(planLater(left), planLater(right))) :: Nil
execution.Filter(condition,
execution.CartesianProduct(planLater(left), planLater(right))) :: Nil
case _ => Nil
}
}
Expand All @@ -131,21 +131,21 @@ abstract trait PlanningStrategies {
object BasicOperators extends Strategy {
def apply(plan: LogicalPlan): Seq[SharkPlan] = plan match {
case logical.Sort(sortExprs, child) =>
shark2.Sort(sortExprs, planLater(child)) :: Nil
execution.Sort(sortExprs, planLater(child)) :: Nil
case logical.Project(projectList, child) =>
shark2.Project(projectList, planLater(child)) :: Nil
execution.Project(projectList, planLater(child)) :: Nil
case logical.Filter(condition, child) =>
shark2.Filter(condition, planLater(child)) :: Nil
execution.Filter(condition, planLater(child)) :: Nil
case logical.Aggregate(group, agg, child) =>
shark2.Aggregate(group, agg, planLater(child)) :: Nil
execution.Aggregate(group, agg, planLater(child)) :: Nil
case logical.LocalRelation(output, data) =>
shark2.LocalRelation(output, data.map(_.productIterator.toVector))(sc) :: Nil
execution.LocalRelation(output, data.map(_.productIterator.toVector))(sc) :: Nil
case logical.StopAfter(limit, child) =>
shark2.StopAfter(Evaluate(limit, Nil).asInstanceOf[Int], planLater(child))(sc) :: Nil
execution.StopAfter(Evaluate(limit, Nil).asInstanceOf[Int], planLater(child))(sc) :: Nil
case logical.Union(left, right) =>
shark2.Union(planLater(left), planLater(right))(sc) :: Nil
execution.Union(planLater(left), planLater(right))(sc) :: Nil
case logical.Transform(input, script, output, child) =>
shark2.Transform(input, script, output, planLater(child))(sc) :: Nil
execution.Transform(input, script, output, planLater(child))(sc) :: Nil
case _ => Nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/catalyst/expressions/BoundAttribute.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package expressions
import rules._
import errors._

import shark2.SharkPlan
import execution.SharkPlan

/**
* A bound reference points to a specific slot in the input tuple, allowing the actual value to be retrieved more
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import java.io.File

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import org.scalatest.{BeforeAndAfterAll, FunSuite}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import shark.{SharkContext, SharkEnv}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import java.io._

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

import java.io._

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

/**
* A set of test cases expressed in Hive QL that are not covered by the tests included in the hive distribution.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

/**
* A set of test cases expressed in Hive QL that are not covered by the tests included in the hive distribution.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package catalyst
package shark2
package execution

/**
* A set of tests that validate type promotion rules.
Expand Down

0 comments on commit da16e45

Please sign in to comment.