Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
fca624df
Commit
fca624df
authored
Feb 04, 2015
by
Harish Butani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lineage fixed depth test
parent
b06e45b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
2 deletions
+117
-2
Expressions.scala
.../scala/org/apache/hadoop/metadata/query/Expressions.scala
+2
-2
LineageQueryTest.scala
...a/org/apache/hadoop/metadata/query/LineageQueryTest.scala
+115
-0
No files found.
typesystem/src/main/scala/org/apache/hadoop/metadata/query/Expressions.scala
View file @
fca624df
...
...
@@ -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
[
Int
eger
])
=
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
[
Int
eger
]])
extends
Expression
{
val
children
=
List
(
input
,
loopingExpression
)
lazy
val
dataType
=
{
if
(!
resolved
)
{
...
...
typesystem/src/test/scala/org/apache/hadoop/metadata/query/LineageQueryTest.scala
View file @
fca624df
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment