Commit fca624df by Harish Butani

lineage fixed depth test

parent b06e45b8
......@@ -300,7 +300,7 @@ object Expressions {
def select(selectList: Expression*) = new SelectExpression(this, selectList.toList)
def loop(loopingExpr : Expression) = new LoopExpression(this, loopingExpr, None)
def loop(loopingExpr : Expression, times : Literal[Int]) =
def loop(loopingExpr : Expression, times : Literal[Integer]) =
new LoopExpression(this, loopingExpr, Some(times))
}
......@@ -628,7 +628,7 @@ object Expressions {
}
case class LoopExpression(val input: Expression, val loopingExpression: Expression,
val times : Option[Literal[Int]]) extends Expression {
val times : Option[Literal[Integer]]) extends Expression {
val children = List(input, loopingExpression)
lazy val dataType = {
if (!resolved) {
......
......@@ -382,4 +382,118 @@ class LineageQueryTest extends FunSuite with BeforeAndAfterAll {
}""")
}
test("testLineageFixedDepth") {
val r = QueryProcessor.evaluate(_class("Table").loop(id("LoadProcess").field("outputTable"), int(1)), g)
validateJson(r, """{
"query":"Table as _loop0 loop (LoadProcess outputTable) times 1",
"dataType":{
"superTypes":[
],
"hierarchicalMetaTypeName":"org.apache.hadoop.metadata.types.ClassType",
"typeName":"Table",
"attributeDefinitions":[
{
"name":"name",
"dataTypeName":"string",
"multiplicity":{
"lower":0,
"upper":1,
"isUnique":false
},
"isComposite":false,
"isUnique":false,
"isIndexable":true,
"reverseAttributeName":null
},
{
"name":"db",
"dataTypeName":"DB",
"multiplicity":{
"lower":1,
"upper":1,
"isUnique":false
},
"isComposite":false,
"isUnique":false,
"isIndexable":true,
"reverseAttributeName":null
},
{
"name":"sd",
"dataTypeName":"StorageDesc",
"multiplicity":{
"lower":1,
"upper":1,
"isUnique":false
},
"isComposite":false,
"isUnique":false,
"isIndexable":true,
"reverseAttributeName":null
}
]
},
"rows":[
{
"$typeName$":"Table",
"$id$":{
"id":"8960",
"$typeName$":"Table",
"version":0
},
"sd":{
"id":"7424",
"$typeName$":"StorageDesc",
"version":0
},
"db":{
"id":"7168",
"$typeName$":"DB",
"version":0
},
"name":"sales_fact_daily_mv"
},
{
"$typeName$":"Table",
"$id$":{
"id":"8960",
"$typeName$":"Table",
"version":0
},
"sd":{
"id":"7424",
"$typeName$":"StorageDesc",
"version":0
},
"db":{
"id":"7168",
"$typeName$":"DB",
"version":0
},
"name":"sales_fact_daily_mv"
},
{
"$typeName$":"Table",
"$id$":{
"id":"12800",
"$typeName$":"Table",
"version":0
},
"sd":{
"id":"11264",
"$typeName$":"StorageDesc",
"version":0
},
"db":{
"id":"7168",
"$typeName$":"DB",
"version":0
},
"name":"sales_fact_monthly_mv"
}
]
}""")
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment