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
58e1d188
Commit
58e1d188
authored
May 27, 2015
by
Venkatesh Seetharam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG-37873 Lineage graph for outputs returns only paths but not graph
parent
a2a739a5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
1 deletion
+102
-1
HiveLineageServiceTest.java
...che/hadoop/metadata/discovery/HiveLineageServiceTest.java
+33
-0
HiveLineageResource.java
...he/hadoop/metadata/web/resources/HiveLineageResource.java
+1
-1
HiveLineageJerseyResourceIT.java
...p/metadata/web/resources/HiveLineageJerseyResourceIT.java
+68
-0
No files found.
repository/src/test/java/org/apache/hadoop/metadata/discovery/HiveLineageServiceTest.java
View file @
58e1d188
...
...
@@ -166,6 +166,23 @@ public class HiveLineageServiceTest {
}
@Test
public
void
testGetInputsGraph
()
throws
Exception
{
JSONObject
results
=
new
JSONObject
(
hiveLineageService
.
getInputsGraph
(
"sales_fact_monthly_mv"
));
Assert
.
assertNotNull
(
results
);
System
.
out
.
println
(
"inputs graph = "
+
results
);
JSONObject
values
=
results
.
getJSONObject
(
"values"
);
Assert
.
assertNotNull
(
values
);
final
JSONObject
vertices
=
values
.
getJSONObject
(
"vertices"
);
Assert
.
assertEquals
(
vertices
.
length
(),
4
);
final
JSONObject
edges
=
values
.
getJSONObject
(
"edges"
);
Assert
.
assertEquals
(
edges
.
length
(),
4
);
}
@Test
public
void
testGetOutputs
()
throws
Exception
{
JSONObject
results
=
new
JSONObject
(
hiveLineageService
.
getOutputs
(
"sales_fact"
));
Assert
.
assertNotNull
(
results
);
...
...
@@ -179,6 +196,22 @@ public class HiveLineageServiceTest {
Assert
.
assertTrue
(
paths
.
length
()
>
0
);
}
@Test
public
void
testGetOutputsGraph
()
throws
Exception
{
JSONObject
results
=
new
JSONObject
(
hiveLineageService
.
getOutputsGraph
(
"sales_fact"
));
Assert
.
assertNotNull
(
results
);
System
.
out
.
println
(
"outputs graph = "
+
results
);
JSONObject
values
=
results
.
getJSONObject
(
"values"
);
Assert
.
assertNotNull
(
values
);
final
JSONObject
vertices
=
values
.
getJSONObject
(
"vertices"
);
Assert
.
assertEquals
(
vertices
.
length
(),
3
);
final
JSONObject
edges
=
values
.
getJSONObject
(
"edges"
);
Assert
.
assertEquals
(
edges
.
length
(),
4
);
}
@DataProvider
(
name
=
"tableNamesProvider"
)
private
Object
[][]
tableNames
()
{
return
new
String
[][]
{
...
...
webapp/src/main/java/org/apache/hadoop/metadata/web/resources/HiveLineageResource.java
View file @
58e1d188
...
...
@@ -176,7 +176,7 @@ public class HiveLineageResource {
LOG
.
info
(
"Fetching lineage outputs graph for tableName={}"
,
tableName
);
try
{
final
String
jsonResult
=
lineageService
.
getOutputs
(
tableName
);
final
String
jsonResult
=
lineageService
.
getOutputs
Graph
(
tableName
);
JSONObject
response
=
new
JSONObject
();
response
.
put
(
MetadataServiceClient
.
REQUEST_ID
,
Servlets
.
getRequestId
());
...
...
webapp/src/test/java/org/apache/hadoop/metadata/web/resources/HiveLineageJerseyResourceIT.java
View file @
58e1d188
...
...
@@ -95,6 +95,40 @@ public class HiveLineageJerseyResourceIT extends BaseResourceIT {
}
@Test
public
void
testInputsGraph
()
throws
Exception
{
WebResource
resource
=
service
.
path
(
BASE_URI
)
.
path
(
"sales_fact_monthly_mv"
)
.
path
(
"inputs"
)
.
path
(
"graph"
);
ClientResponse
clientResponse
=
resource
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
type
(
MediaType
.
APPLICATION_JSON
)
.
method
(
HttpMethod
.
GET
,
ClientResponse
.
class
);
Assert
.
assertEquals
(
clientResponse
.
getStatus
(),
Response
.
Status
.
OK
.
getStatusCode
());
String
responseAsString
=
clientResponse
.
getEntity
(
String
.
class
);
Assert
.
assertNotNull
(
responseAsString
);
System
.
out
.
println
(
"inputs graph = "
+
responseAsString
);
JSONObject
response
=
new
JSONObject
(
responseAsString
);
Assert
.
assertNotNull
(
response
.
get
(
MetadataServiceClient
.
REQUEST_ID
));
JSONObject
results
=
response
.
getJSONObject
(
MetadataServiceClient
.
RESULTS
);
Assert
.
assertNotNull
(
results
);
JSONObject
values
=
results
.
getJSONObject
(
"values"
);
Assert
.
assertNotNull
(
values
);
final
JSONObject
vertices
=
values
.
getJSONObject
(
"vertices"
);
Assert
.
assertEquals
(
vertices
.
length
(),
4
);
final
JSONObject
edges
=
values
.
getJSONObject
(
"edges"
);
Assert
.
assertEquals
(
edges
.
length
(),
4
);
}
@Test
public
void
testOutputs
()
throws
Exception
{
WebResource
resource
=
service
.
path
(
BASE_URI
)
...
...
@@ -126,6 +160,40 @@ public class HiveLineageJerseyResourceIT extends BaseResourceIT {
}
@Test
public
void
testOutputsGraph
()
throws
Exception
{
WebResource
resource
=
service
.
path
(
BASE_URI
)
.
path
(
"sales_fact"
)
.
path
(
"outputs"
)
.
path
(
"graph"
);
ClientResponse
clientResponse
=
resource
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
type
(
MediaType
.
APPLICATION_JSON
)
.
method
(
HttpMethod
.
GET
,
ClientResponse
.
class
);
Assert
.
assertEquals
(
clientResponse
.
getStatus
(),
Response
.
Status
.
OK
.
getStatusCode
());
String
responseAsString
=
clientResponse
.
getEntity
(
String
.
class
);
Assert
.
assertNotNull
(
responseAsString
);
System
.
out
.
println
(
"outputs graph= "
+
responseAsString
);
JSONObject
response
=
new
JSONObject
(
responseAsString
);
Assert
.
assertNotNull
(
response
.
get
(
MetadataServiceClient
.
REQUEST_ID
));
JSONObject
results
=
response
.
getJSONObject
(
MetadataServiceClient
.
RESULTS
);
Assert
.
assertNotNull
(
results
);
JSONObject
values
=
results
.
getJSONObject
(
"values"
);
Assert
.
assertNotNull
(
values
);
final
JSONObject
vertices
=
values
.
getJSONObject
(
"vertices"
);
Assert
.
assertEquals
(
vertices
.
length
(),
3
);
final
JSONObject
edges
=
values
.
getJSONObject
(
"edges"
);
Assert
.
assertEquals
(
edges
.
length
(),
4
);
}
@Test
public
void
testSchema
()
throws
Exception
{
WebResource
resource
=
service
.
path
(
BASE_URI
)
...
...
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