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
98b54160
Commit
98b54160
authored
5 years ago
by
nixonrodrigues
Committed by
kevalbhatt
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3606 :- Missing HIVE_PROCESS attribute values in atlas.
parent
cc2e6af7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
AtlasHiveHookContext.java
...java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
+4
-0
HiveHook.java
...ge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
+7
-2
BaseHiveEvent.java
...java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java
+8
-0
No files found.
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
View file @
98b54160
...
...
@@ -236,6 +236,10 @@ public class AtlasHiveHookContext {
}
}
public
boolean
isHiveProcessPopulateDeprecatedAttributes
()
{
return
hook
.
isHiveProcessPopulateDeprecatedAttributes
();
}
private
void
init
()
{
String
operation
=
hiveOperation
.
getOperationName
();
...
...
This diff is collapsed.
Click to expand it.
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
View file @
98b54160
...
...
@@ -60,6 +60,7 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
public
static
final
String
HOOK_NAME_CACHE_DATABASE_COUNT
=
CONF_PREFIX
+
"name.cache.database.count"
;
public
static
final
String
HOOK_NAME_CACHE_TABLE_COUNT
=
CONF_PREFIX
+
"name.cache.table.count"
;
public
static
final
String
HOOK_NAME_CACHE_REBUID_INTERVAL_SEC
=
CONF_PREFIX
+
"name.cache.rebuild.interval.seconds"
;
public
static
final
String
HOOK_HIVE_PROCESS_POPULATE_DEPRECATED_ATTRIBUTES
=
CONF_PREFIX
+
"hive_process.populate.deprecated.attributes"
;
public
static
final
String
HOOK_SKIP_HIVE_COLUMN_LINEAGE_HIVE_20633
=
CONF_PREFIX
+
"skip.hive_column_lineage.hive-20633"
;
public
static
final
String
HOOK_SKIP_HIVE_COLUMN_LINEAGE_HIVE_20633_INPUTS_THRESHOLD
=
CONF_PREFIX
+
"skip.hive_column_lineage.hive-20633.inputs.threshold"
;
public
static
final
String
HOOK_HIVE_TABLE_IGNORE_PATTERN
=
CONF_PREFIX
+
"hive_table.ignore.pattern"
;
...
...
@@ -83,7 +84,7 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
private
static
final
List
ignoreDummyDatabaseName
;
private
static
final
List
ignoreDummyTableName
;
private
static
final
String
ignoreValuesTmpTableNamePrefix
;
private
static
final
boolean
hiveProcessPopulateDeprecatedAttributes
;
private
static
HiveHookObjectNamesCache
knownObjects
=
null
;
private
static
String
hostName
;
...
...
@@ -99,7 +100,7 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
nameCacheRebuildIntervalSeconds
=
atlasProperties
.
getInt
(
HOOK_NAME_CACHE_REBUID_INTERVAL_SEC
,
60
*
60
);
// 60 minutes default
skipHiveColumnLineageHive20633
=
atlasProperties
.
getBoolean
(
HOOK_SKIP_HIVE_COLUMN_LINEAGE_HIVE_20633
,
false
);
skipHiveColumnLineageHive20633InputsThreshold
=
atlasProperties
.
getInt
(
HOOK_SKIP_HIVE_COLUMN_LINEAGE_HIVE_20633_INPUTS_THRESHOLD
,
15
);
// skip if avg # of inputs is > 15
hiveProcessPopulateDeprecatedAttributes
=
atlasProperties
.
getBoolean
(
HOOK_HIVE_PROCESS_POPULATE_DEPRECATED_ATTRIBUTES
,
false
);
String
[]
patternHiveTablesToIgnore
=
atlasProperties
.
getStringArray
(
HOOK_HIVE_TABLE_IGNORE_PATTERN
);
String
[]
patternHiveTablesToPrune
=
atlasProperties
.
getStringArray
(
HOOK_HIVE_TABLE_PRUNE_PATTERN
);
...
...
@@ -272,6 +273,10 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
return
ignoreValuesTmpTableNamePrefix
;
}
public
boolean
isHiveProcessPopulateDeprecatedAttributes
()
{
return
hiveProcessPopulateDeprecatedAttributes
;
}
public
PreprocessAction
getPreprocessActionForHiveTable
(
String
qualifiedName
)
{
PreprocessAction
ret
=
PreprocessAction
.
NONE
;
...
...
This diff is collapsed.
Click to expand it.
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java
View file @
98b54160
...
...
@@ -669,11 +669,19 @@ public abstract class BaseHiveEvent {
// mandatory attributes for hive process entity type.
ret
.
setAttribute
(
ATTRIBUTE_START_TIME
,
System
.
currentTimeMillis
());
ret
.
setAttribute
(
ATTRIBUTE_END_TIME
,
System
.
currentTimeMillis
());
if
(
context
.
isHiveProcessPopulateDeprecatedAttributes
())
{
ret
.
setAttribute
(
ATTRIBUTE_USER_NAME
,
getUserName
());
ret
.
setAttribute
(
ATTRIBUTE_QUERY_TEXT
,
queryStr
);
ret
.
setAttribute
(
ATTRIBUTE_QUERY_ID
,
getQueryId
());
}
else
{
ret
.
setAttribute
(
ATTRIBUTE_USER_NAME
,
EMPTY_ATTRIBUTE_VALUE
);
ret
.
setAttribute
(
ATTRIBUTE_QUERY_TEXT
,
EMPTY_ATTRIBUTE_VALUE
);
ret
.
setAttribute
(
ATTRIBUTE_QUERY_ID
,
EMPTY_ATTRIBUTE_VALUE
);
}
ret
.
setAttribute
(
ATTRIBUTE_QUERY_PLAN
,
"Not Supported"
);
ret
.
setAttribute
(
ATTRIBUTE_RECENT_QUERIES
,
Collections
.
singletonList
(
queryStr
));
ret
.
setAttribute
(
ATTRIBUTE_CLUSTER_NAME
,
getMetadataNamespace
());
return
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
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