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
9f5b7861
Commit
9f5b7861
authored
Nov 27, 2019
by
mayanknj
Committed by
Madhan Neethiraj
Nov 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3590: fix HiveHook to avoid incorrect alter-table-property notifications
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
c6661ff1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
HiveMetastoreHookImpl.java
...ava/org/apache/atlas/hive/hook/HiveMetastoreHookImpl.java
+18
-1
No files found.
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveMetastoreHookImpl.java
View file @
9f5b7861
...
@@ -94,7 +94,7 @@ public class HiveMetastoreHookImpl extends MetaStoreEventListener {
...
@@ -94,7 +94,7 @@ public class HiveMetastoreHookImpl extends MetaStoreEventListener {
context
.
setOperation
(
ALTERTABLE_RENAME
);
context
.
setOperation
(
ALTERTABLE_RENAME
);
}
else
if
(
isColumnRename
(
oldTable
,
newTable
,
context
))
{
}
else
if
(
isColumnRename
(
oldTable
,
newTable
,
context
))
{
context
.
setOperation
(
ALTERTABLE_RENAMECOL
);
context
.
setOperation
(
ALTERTABLE_RENAMECOL
);
}
else
{
}
else
if
(
isAlterTableProperty
(
tableEvent
))
{
context
.
setOperation
(
ALTERTABLE_PROPERTIES
);
// map other alter table operations to ALTERTABLE_PROPERTIES
context
.
setOperation
(
ALTERTABLE_PROPERTIES
);
// map other alter table operations to ALTERTABLE_PROPERTIES
}
}
...
@@ -190,4 +190,20 @@ public class HiveMetastoreHookImpl extends MetaStoreEventListener {
...
@@ -190,4 +190,20 @@ public class HiveMetastoreHookImpl extends MetaStoreEventListener {
return
isColumnRename
;
return
isColumnRename
;
}
}
private
boolean
isAlterTableProperty
(
AlterTableEvent
tableEvent
)
{
final
boolean
ret
;
String
oldTableModifiedTime
=
tableEvent
.
getOldTable
().
getParameters
().
get
(
"last_modified_time"
);
String
newTableModifiedTime
=
tableEvent
.
getNewTable
().
getParameters
().
get
(
"last_modified_time"
);
if
(
oldTableModifiedTime
==
null
)
{
ret
=
newTableModifiedTime
!=
null
;
}
else
{
ret
=
!
oldTableModifiedTime
.
equals
(
newTableModifiedTime
);
}
return
ret
;
}
}
}
\ 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