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
a2a739a5
Commit
a2a739a5
authored
9 years ago
by
Shwetha GS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed multiplicity in hive model
parent
fed7af93
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
HiveDataModelGenerator.java
...he/hadoop/metadata/hive/model/HiveDataModelGenerator.java
+3
-2
HiveHookIT.java
...java/org/apache/hadoop/metadata/hive/hook/HiveHookIT.java
+6
-6
No files found.
addons/hive-bridge/src/main/java/org/apache/hadoop/metadata/hive/model/HiveDataModelGenerator.java
View file @
a2a739a5
...
@@ -452,8 +452,9 @@ public class HiveDataModelGenerator {
...
@@ -452,8 +452,9 @@ public class HiveDataModelGenerator {
Multiplicity
.
REQUIRED
,
false
,
null
),
Multiplicity
.
REQUIRED
,
false
,
null
),
new
AttributeDefinition
(
"functionType"
,
HiveDataTypes
.
HIVE_FUNCTION_TYPE
.
getName
(),
new
AttributeDefinition
(
"functionType"
,
HiveDataTypes
.
HIVE_FUNCTION_TYPE
.
getName
(),
Multiplicity
.
REQUIRED
,
false
,
null
),
Multiplicity
.
REQUIRED
,
false
,
null
),
new
AttributeDefinition
(
"resourceUris"
,
HiveDataTypes
.
HIVE_RESOURCEURI
.
getName
(),
new
AttributeDefinition
(
"resourceUris"
,
Multiplicity
.
COLLECTION
,
false
,
null
),
DataTypes
.
arrayTypeName
(
HiveDataTypes
.
HIVE_RESOURCEURI
.
getName
()),
Multiplicity
.
OPTIONAL
,
false
,
null
),
};
};
HierarchicalTypeDefinition
<
ClassType
>
definition
=
new
HierarchicalTypeDefinition
<>(
HierarchicalTypeDefinition
<
ClassType
>
definition
=
new
HierarchicalTypeDefinition
<>(
...
...
This diff is collapsed.
Click to expand it.
addons/hive-bridge/src/test/java/org/apache/hadoop/metadata/hive/hook/HiveHookIT.java
View file @
a2a739a5
...
@@ -62,8 +62,8 @@ public class HiveHookIT {
...
@@ -62,8 +62,8 @@ public class HiveHookIT {
hiveConf
.
set
(
"javax.jdo.option.ConnectionURL"
,
"jdbc:derby:./target/metastore_db;create=true"
);
hiveConf
.
set
(
"javax.jdo.option.ConnectionURL"
,
"jdbc:derby:./target/metastore_db;create=true"
);
hiveConf
.
set
(
"hive.hook.dgi.synchronous"
,
"true"
);
hiveConf
.
set
(
"hive.hook.dgi.synchronous"
,
"true"
);
hiveConf
.
set
(
HiveMetaStoreBridge
.
HIVE_CLUSTER_NAME
,
CLUSTER_NAME
);
hiveConf
.
set
(
HiveMetaStoreBridge
.
HIVE_CLUSTER_NAME
,
CLUSTER_NAME
);
//weird, hive prepends test_ to table name
hiveConf
.
setBoolVar
(
HiveConf
.
ConfVars
.
HIVETESTMODE
,
true
);
//to not use hdfs
hiveConf
.
set
(
"hive.test.mode"
,
"true
"
);
hiveConf
.
set
Var
(
HiveConf
.
ConfVars
.
HIVETESTMODEPREFIX
,
"
"
);
hiveConf
.
set
(
"fs.pfile.impl"
,
"org.apache.hadoop.fs.ProxyLocalFileSystem"
);
hiveConf
.
set
(
"fs.pfile.impl"
,
"org.apache.hadoop.fs.ProxyLocalFileSystem"
);
return
hiveConf
;
return
hiveConf
;
}
}
...
@@ -127,7 +127,7 @@ public class HiveHookIT {
...
@@ -127,7 +127,7 @@ public class HiveHookIT {
@Test
@Test
public
void
testLoadData
()
throws
Exception
{
public
void
testLoadData
()
throws
Exception
{
String
tableName
=
"table"
+
random
();
String
tableName
=
"table"
+
random
();
runCommand
(
"create table
test_
"
+
tableName
+
"(id int, name string)"
);
runCommand
(
"create table "
+
tableName
+
"(id int, name string)"
);
String
loadFile
=
file
(
"load"
);
String
loadFile
=
file
(
"load"
);
String
query
=
"load data local inpath 'file://"
+
loadFile
+
"' into table "
+
tableName
;
String
query
=
"load data local inpath 'file://"
+
loadFile
+
"' into table "
+
tableName
;
...
@@ -142,14 +142,14 @@ public class HiveHookIT {
...
@@ -142,14 +142,14 @@ public class HiveHookIT {
runCommand
(
"create table "
+
tableName
+
"(id int, name string) partitioned by(dt string)"
);
runCommand
(
"create table "
+
tableName
+
"(id int, name string) partitioned by(dt string)"
);
String
insertTableName
=
"table"
+
random
();
String
insertTableName
=
"table"
+
random
();
runCommand
(
"create table
test_
"
+
insertTableName
+
"(name string) partitioned by(dt string)"
);
runCommand
(
"create table "
+
insertTableName
+
"(name string) partitioned by(dt string)"
);
String
query
=
"insert into "
+
insertTableName
+
" partition(dt = '2015-01-01') select name from "
String
query
=
"insert into "
+
insertTableName
+
" partition(dt = '2015-01-01') select name from "
+
tableName
+
" where dt = '2015-01-01'"
;
+
tableName
+
" where dt = '2015-01-01'"
;
runCommand
(
query
);
runCommand
(
query
);
assertProcessIsRegistered
(
query
);
assertProcessIsRegistered
(
query
);
assertPartitionIsRegistered
(
"default"
,
"test_"
+
insertTableName
,
"2015-01-01"
);
assertPartitionIsRegistered
(
"default"
,
insertTableName
,
"2015-01-01"
);
}
}
private
String
random
()
{
private
String
random
()
{
...
@@ -173,7 +173,7 @@ public class HiveHookIT {
...
@@ -173,7 +173,7 @@ public class HiveHookIT {
@Test
@Test
public
void
testExportImport
()
throws
Exception
{
public
void
testExportImport
()
throws
Exception
{
String
tableName
=
"table"
+
random
();
String
tableName
=
"table"
+
random
();
runCommand
(
"create table
test_
"
+
tableName
+
"(name string)"
);
runCommand
(
"create table "
+
tableName
+
"(name string)"
);
String
filename
=
"pfile://"
+
mkdir
(
"export"
);
String
filename
=
"pfile://"
+
mkdir
(
"export"
);
String
query
=
"export table "
+
tableName
+
" to '"
+
filename
+
"'"
;
String
query
=
"export table "
+
tableName
+
" to '"
+
filename
+
"'"
;
...
...
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