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
b1e6c379
Commit
b1e6c379
authored
Apr 07, 2015
by
Venkatesh Seetharam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bugs in gremlin translator to use persistence strategy for select attributes
parent
6edfdb77
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
+6
-4
HiveLineageService.java
.../apache/hadoop/metadata/discovery/HiveLineageService.java
+2
-1
GremlinQuery.scala
...scala/org/apache/hadoop/metadata/query/GremlinQuery.scala
+3
-2
HiveLineageServiceTest.java
...che/hadoop/metadata/discovery/HiveLineageServiceTest.java
+0
-0
QuickStart.java
.../java/org/apache/hadoop/metadata/examples/QuickStart.java
+1
-1
No files found.
repository/src/main/java/org/apache/hadoop/metadata/discovery/HiveLineageService.java
View file @
b1e6c379
...
...
@@ -31,6 +31,7 @@ import org.apache.hadoop.metadata.repository.graph.GraphProvider;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
scala.Option
;
import
scala.Some
;
import
scala.collection.immutable.List
;
import
javax.inject.Inject
;
...
...
@@ -51,7 +52,7 @@ public class HiveLineageService implements LineageService {
private
static
final
String
HIVE_PROCESS_OUTPUT_ATTRIBUTE_NAME
=
"outputTables"
;
private
static
final
Option
<
List
<
String
>>
SELECT_ATTRIBUTES
=
Option
.<
List
<
String
>>
apply
(
List
.<
String
>
fromArray
(
new
String
[]{
"name"
}));
Some
.<
List
<
String
>>
apply
(
List
.<
String
>
fromArray
(
new
String
[]{
"name"
}));
private
final
TitanGraph
titanGraph
;
private
final
DefaultGraphPersistenceStrategy
graphPersistenceStrategy
;
...
...
repository/src/main/scala/org/apache/hadoop/metadata/query/GremlinQuery.scala
View file @
b1e6c379
...
...
@@ -187,9 +187,10 @@ class GremlinTranslator(expr: Expression,
case
ClassExpression
(
clsName
)
=>
s
"""has("${gPersistenceBehavior.typeAttributeName}","$clsName")"""
case
TraitExpression
(
clsName
)
=>
s
"""has("${gPersistenceBehavior.typeAttributeName}","$clsName")"""
case
fe
@FieldExpression
(
fieldName
,
fInfo
,
child
)
if
fe
.
dataType
.
getTypeCategory
==
TypeCategory
.
PRIMITIVE
=>
{
val
fN
=
"\""
+
gPersistenceBehavior
.
fieldNameInVertex
(
fInfo
.
dataType
,
fInfo
.
attrInfo
)
+
"\""
child
match
{
case
Some
(
e
)
=>
s
"${genQuery(e, inSelect)}.$f
ieldName
"
case
None
=>
fieldName
case
Some
(
e
)
=>
s
"${genQuery(e, inSelect)}.$f
N
"
case
None
=>
s
"$fN"
}
}
case
fe
@FieldExpression
(
fieldName
,
fInfo
,
child
)
...
...
repository/src/test/java/org/apache/hadoop/metadata/discovery/HiveLineageServiceTest.java
0 → 100644
View file @
b1e6c379
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/hadoop/metadata/examples/QuickStart.java
View file @
b1e6c379
...
...
@@ -464,7 +464,7 @@ public class QuickStart {
"Table as _loop0 loop (hive_process outputTables) withPath",
"Table as src loop (hive_process outputTables) as dest select src.name as srcTable, dest.name as destTable withPath",
*/
"Table
as t, columns where t.name=\"sales_fact\"
"
,
"Table
where name=\"sales_fact\", columns as column select column.name, column.dataType, column.comment
"
,
};
}
...
...
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