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
f9b48317
Commit
f9b48317
authored
Oct 17, 2019
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3475: Invalid instance creation/updation parameters passed : hive_process.qualifiedName
parent
b064d8c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
CreateTable.java
...n/java/org/apache/atlas/hive/hook/events/CreateTable.java
+14
-9
No files found.
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateTable.java
View file @
f9b48317
...
...
@@ -24,6 +24,7 @@ import org.apache.atlas.model.instance.AtlasEntity.AtlasEntitiesWithExtInfo;
import
org.apache.atlas.model.notification.HookNotification
;
import
org.apache.atlas.model.notification.HookNotification.EntityCreateRequestV2
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.hadoop.hive.metastore.TableType
;
import
org.apache.hadoop.hive.metastore.events.AlterTableEvent
;
import
org.apache.hadoop.hive.metastore.events.CreateTableEvent
;
import
org.apache.hadoop.hive.metastore.events.ListenerEvent
;
...
...
@@ -149,24 +150,22 @@ public class CreateTable extends BaseHiveEvent {
if
(
context
.
isMetastoreHook
())
{
//it is running in the context of HiveMetastore
//not a hive metastore hook
if
(
EXTERNAL_TABLE
.
equals
(
table
.
getTableType
()))
{
AtlasEntity
hdfsPathEntity
=
getPathEntity
(
table
.
getDataLocation
(),
ret
);
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Creating a dummy process with lineage from hdfs path to table"
);
if
(
isCreateExtTableOperation
(
table
))
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Creating a dummy process with lineage from hdfs path to hive table"
);
}
AtlasEntity
processEntity
=
getHiveProcessEntity
(
Collections
.
singletonList
(
hdfsPathEntity
),
Collections
.
singletonList
(
tblEntity
));
AtlasEntity
hdfsPathEntity
=
getPathEntity
(
table
.
getDataLocation
(),
ret
);
AtlasEntity
processEntity
=
getHiveProcessEntity
(
Collections
.
singletonList
(
hdfsPathEntity
),
Collections
.
singletonList
(
tblEntity
));
ret
.
addEntity
(
processEntity
);
ret
.
addReferredEntity
(
hdfsPathEntity
);
//hive process entity will be created by hiveserver hook.
}
}
else
{
//not a hive metastore hook
//it is running in the context of HiveServer2
if
(
EXTERNAL_TABLE
.
equals
(
table
.
getTableType
()))
{
AtlasEntity
hdfsPathEntity
=
getPathEntity
(
table
.
getDataLocation
(),
ret
);
AtlasEntity
processEntity
=
getHiveProcessEntity
(
Collections
.
singletonList
(
hdfsPathEntity
),
Collections
.
singletonList
(
tblEntity
));
AtlasEntity
processEntity
=
getHiveProcessEntity
(
Collections
.
singletonList
(
hdfsPathEntity
),
Collections
.
singletonList
(
tblEntity
));
ret
.
addEntity
(
processEntity
);
ret
.
addReferredEntity
(
hdfsPathEntity
);
...
...
@@ -175,7 +174,6 @@ public class CreateTable extends BaseHiveEvent {
ret
.
addEntity
(
processExecution
);
}
}
}
if
(!
context
.
isMetastoreHook
())
{
...
...
@@ -197,4 +195,11 @@ public class CreateTable extends BaseHiveEvent {
// If its an external table, even though the temp table skip flag is on, we create the table since we need the HDFS path to temp table lineage.
return
table
!=
null
&&
skipTempTables
&&
table
.
isTemporary
()
&&
!
EXTERNAL_TABLE
.
equals
(
table
.
getTableType
());
}
private
boolean
isCreateExtTableOperation
(
Table
table
)
{
HiveOperation
oper
=
context
.
getHiveOperation
();
TableType
tableType
=
table
.
getTableType
();
return
EXTERNAL_TABLE
.
equals
(
tableType
)
&&
(
oper
==
CREATETABLE
||
oper
==
CREATETABLE_AS_SELECT
);
}
}
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