Skip to content

Commit 476eb0b

Browse files
committed
move classes to package com.stephentu.sql
1 parent fa7d20d commit 476eb0b

File tree

12 files changed

+24
-0
lines changed

12 files changed

+24
-0
lines changed

src/main/scala/ast.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
trait Node extends PrettyPrinters {
24
val ctx: Context
35

src/main/scala/context.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
import scala.collection.mutable.{ArrayBuffer, HashMap}
24

35
abstract trait Symbol {

src/main/scala/datatypes.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
abstract trait DataType
24
case class IntType(size: Int) extends DataType
35
case class DecimalType(scale: Int, precision: Int) extends DataType

src/main/scala/parser.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
import scala.util.matching.Regex
24

35
import scala.util.parsing.combinator._

src/main/scala/resolver.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
trait Resolver extends Transformers with Traversals {
24
case class ResolutionException(msg: String) extends RuntimeException(msg)
35

src/main/scala/schema.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
import java.sql._
24
import java.util.Properties
35

src/main/scala/transformer.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
trait Transformers {
24

35
def topDownTransformation(n: Node)(f: Node => (Option[Node], Boolean)): Node =

src/main/scala/traversal.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
trait Traversals {
24

35
def wrapReturnTrue[A](f: Node => A): Node => Boolean = (n: Node) => { f(n); true }

src/main/scala/util.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
import java.sql._
24
import scala.collection.mutable.ArrayBuffer
35

src/test/scala/parser.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
import org.specs2.mutable._
24

35
object Queries {

src/test/scala/resolver.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
import org.specs2.mutable._
24

35
class ResolverSpec extends Specification {

src/test/scala/schema.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.stephentu.sql
2+
13
object TestSchema {
24
val definition = new Definitions(Map("nation" -> Seq(TableColumn("n_comment", VariableLenString(152)), TableColumn("n_regionkey", IntType(4)), TableColumn("n_name", FixedLenString(25)), TableColumn("n_nationkey", IntType(4))), "partsupp" -> Seq(TableColumn("ps_comment", VariableLenString(199)), TableColumn("ps_supplycost", DecimalType(15,2)), TableColumn("ps_availqty", IntType(4)), TableColumn("ps_suppkey", IntType(4)), TableColumn("ps_partkey", IntType(4))), "supplier" -> Seq(TableColumn("s_comment", VariableLenString(101)), TableColumn("s_acctbal", DecimalType(15,2)), TableColumn("s_phone", FixedLenString(15)), TableColumn("s_nationkey", IntType(4)), TableColumn("s_address", VariableLenString(40)), TableColumn("s_name", FixedLenString(25)), TableColumn("s_suppkey", IntType(4))), "customer" -> Seq(TableColumn("c_comment", VariableLenString(117)), TableColumn("c_mktsegment", FixedLenString(10)), TableColumn("c_acctbal", DecimalType(15,2)), TableColumn("c_phone", FixedLenString(15)), TableColumn("c_nationkey", IntType(4)), TableColumn("c_address", VariableLenString(40)), TableColumn("c_name", VariableLenString(25)), TableColumn("c_custkey", IntType(4))), "region" -> Seq(TableColumn("r_comment", VariableLenString(152)), TableColumn("r_name", FixedLenString(25)), TableColumn("r_regionkey", IntType(4))), "orders" -> Seq(TableColumn("o_comment", VariableLenString(79)), TableColumn("o_shippriority", IntType(4)), TableColumn("o_clerk", FixedLenString(15)), TableColumn("o_orderpriority", FixedLenString(15)), TableColumn("o_orderdate", DateType), TableColumn("o_totalprice", DecimalType(15,2)), TableColumn("o_orderstatus", FixedLenString(1)), TableColumn("o_custkey", IntType(4)), TableColumn("o_orderkey", IntType(4))), "lineitem" -> Seq(TableColumn("l_comment", VariableLenString(44)), TableColumn("l_shipmode", FixedLenString(10)), TableColumn("l_shipinstruct", FixedLenString(25)), TableColumn("l_receiptdate", DateType), TableColumn("l_commitdate", DateType), TableColumn("l_shipdate", DateType), TableColumn("l_linestatus", FixedLenString(1)), TableColumn("l_returnflag", FixedLenString(1)), TableColumn("l_tax", DecimalType(15,2)), TableColumn("l_discount", DecimalType(15,2)), TableColumn("l_extendedprice", DecimalType(15,2)), TableColumn("l_quantity", DecimalType(15,2)), TableColumn("l_linenumber", IntType(4)), TableColumn("l_suppkey", IntType(4)), TableColumn("l_partkey", IntType(4)), TableColumn("l_orderkey", IntType(4))), "part" -> Seq(TableColumn("p_comment", VariableLenString(23)), TableColumn("p_retailprice", DecimalType(15,2)), TableColumn("p_container", FixedLenString(10)), TableColumn("p_size", IntType(4)), TableColumn("p_type", VariableLenString(25)), TableColumn("p_brand", FixedLenString(10)), TableColumn("p_mfgr", FixedLenString(25)), TableColumn("p_name", VariableLenString(55)), TableColumn("p_partkey", IntType(4)))))
35
}

0 commit comments

Comments
 (0)