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
1ddf3137
Commit
1ddf3137
authored
May 09, 2016
by
Shwetha GS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-747 Hive CTAS entity registration fails because userName is null (shwethags)
parent
53bbebcb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
6 deletions
+11
-6
HiveHook.java
...ge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
+3
-5
HiveHookIT.java
.../src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java
+3
-1
AtlasHook.java
...cation/src/main/java/org/apache/atlas/hook/AtlasHook.java
+4
-0
release-log.txt
release-log.txt
+1
-0
No files found.
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
View file @
1ddf3137
...
...
@@ -33,7 +33,6 @@ import org.apache.hadoop.fs.Path;
import
org.apache.hadoop.hive.conf.HiveConf
;
import
org.apache.hadoop.hive.metastore.TableType
;
import
org.apache.hadoop.hive.metastore.api.Database
;
import
org.apache.hadoop.hive.metastore.api.FieldSchema
;
import
org.apache.hadoop.hive.ql.QueryPlan
;
import
org.apache.hadoop.hive.ql.exec.ExplainTask
;
import
org.apache.hadoop.hive.ql.exec.Task
;
...
...
@@ -262,7 +261,7 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
event
.
setJsonPlan
(
getQueryPlan
(
hookContext
.
getConf
(),
hookContext
.
getQueryPlan
()));
event
.
setHookType
(
hookContext
.
getHookType
());
event
.
setUgi
(
hookContext
.
getUgi
());
event
.
setUser
(
hookContext
.
getUserName
(
));
event
.
setUser
(
getUser
(
hookContext
.
getUserName
()
));
event
.
setOperation
(
OPERATION_MAP
.
get
(
hookContext
.
getOperationName
()));
event
.
setQueryId
(
hookContext
.
getQueryPlan
().
getQueryId
());
event
.
setQueryStr
(
hookContext
.
getQueryPlan
().
getQueryStr
());
...
...
@@ -306,6 +305,7 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
break
;
case
CREATETABLE_AS_SELECT:
case
CREATEVIEW:
case
ALTERVIEW_AS:
case
LOAD:
...
...
@@ -619,7 +619,7 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
explain
.
initialize
(
hiveConf
,
queryPlan
,
null
);
List
<
Task
<?>>
rootTasks
=
queryPlan
.
getRootTasks
();
return
explain
.
getJSONPlan
(
null
,
null
,
rootTasks
,
queryPlan
.
getFetchTask
(),
true
,
false
,
false
);
}
catch
(
Exception
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
info
(
"Failed to get queryplan"
,
e
);
return
new
JSONObject
();
}
...
...
@@ -627,8 +627,6 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
private
boolean
isSelectQuery
(
HiveEventContext
event
)
{
if
(
event
.
getOperation
()
==
HiveOperation
.
QUERY
)
{
Set
<
WriteEntity
>
outputs
=
event
.
getOutputs
();
//Select query has only one output
if
(
event
.
getOutputs
().
size
()
==
1
)
{
WriteEntity
output
=
event
.
getOutputs
().
iterator
().
next
();
...
...
addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java
View file @
1ddf3137
...
...
@@ -46,6 +46,7 @@ import org.apache.hadoop.hive.ql.hooks.Entity;
import
org.apache.hadoop.hive.ql.metadata.Table
;
import
org.apache.hadoop.hive.ql.processors.CommandProcessorResponse
;
import
org.apache.hadoop.hive.ql.session.SessionState
;
import
org.apache.hadoop.security.UserGroupInformation
;
import
org.codehaus.jettison.json.JSONException
;
import
org.codehaus.jettison.json.JSONObject
;
import
org.slf4j.Logger
;
...
...
@@ -88,7 +89,7 @@ public class HiveHookIT {
conf
.
set
(
"fs.default.name"
,
"file:///'"
);
conf
.
setClassLoader
(
Thread
.
currentThread
().
getContextClassLoader
());
driver
=
new
Driver
(
conf
);
ss
=
new
SessionState
(
conf
,
System
.
getProperty
(
"user.name"
)
);
ss
=
new
SessionState
(
conf
);
ss
=
SessionState
.
start
(
ss
);
SessionState
.
setCurrentSessionState
(
ss
);
...
...
@@ -238,6 +239,7 @@ public class HiveHookIT {
String
tableId
=
assertTableIsRegistered
(
dbName
,
tableName
);
Referenceable
processReference
=
validateProcess
(
query
,
1
,
1
);
assertEquals
(
processReference
.
get
(
"userName"
),
UserGroupInformation
.
getCurrentUser
().
getShortUserName
());
verifyTimestamps
(
processReference
,
"startTime"
);
verifyTimestamps
(
processReference
,
"endTime"
);
...
...
notification/src/main/java/org/apache/atlas/hook/AtlasHook.java
View file @
1ddf3137
...
...
@@ -130,6 +130,10 @@ public abstract class AtlasHook {
return
getUser
(
null
,
null
);
}
public
static
String
getUser
(
String
userName
)
{
return
getUser
(
userName
,
null
);
}
/**
* Returns the user. Order of preference:
* 1. Given userName
...
...
release-log.txt
View file @
1ddf3137
...
...
@@ -18,6 +18,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES:
ATLAS-747 Hive CTAS entity registration fails because userName is null (shwethags)
ATLAS-759 HiveHookIT.testAlterTableChangeColumn is consistently failing on master (yhemanth)
ATLAS-690 Read timed out exceptions when tables are imported into Atlas (yhemanth via shwethags)
ATLAS-585 NotificationHookConsumer creates new AtlasClient for every message (shwethags)
...
...
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