-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration hive 3 pr #219
Migration hive 3 pr #219
Conversation
# Conflicts: # pom.xml # waggle-dance-api/pom.xml # waggle-dance-boot/pom.xml # waggle-dance-core/pom.xml # waggle-dance-integration-tests/pom.xml # waggle-dance-rest/pom.xml # waggle-dance-rpm/pom.xml # waggle-dance/pom.xml
Thanks for raising this @rtotarocuebiq . We will try take a look and give some comments later this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a really good start, I've added a round of comments and I know @patduin is also going to try take a look, hopefully this week.
@@ -29,21 +29,21 @@ | |||
<module>waggle-dance-boot</module> | |||
<module>waggle-dance-integration-tests</module> | |||
<module>waggle-dance</module> | |||
<module>waggle-dance-rpm</module> | |||
<!-- <module>waggle-dance-rpm</module>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing you're having some problem building this? What's not working for you?
<junit.version>4.13.1</junit.version> | ||
<mockito.version>3.5.15</mockito.version> | ||
<dropwizard.metrics.version>3.1.5</dropwizard.metrics.version> | ||
<aspectj-maven-plugin.version>1.9</aspectj-maven-plugin.version> | ||
<aspectj.version>1.8.9</aspectj.version> | ||
<beeju.version>4.0.0</beeju.version> | ||
<beeju.version>5.0.0</beeju.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge the current state of hive-3.x
into your branch as this change (and some others) have been made there now.
@@ -91,6 +92,16 @@ public static PrimaryMetaStore newPrimaryInstance(String name, String remoteMeta | |||
return new PrimaryMetaStore(name, remoteMetaStoreUris, AccessControlType.READ_ONLY); | |||
} | |||
|
|||
public String getCatalog() | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please get the formatting to match the rest of the classes (applies to the whole PR).
@@ -43,6 +43,7 @@ | |||
@Type(value = PrimaryMetaStore.class, name = "PRIMARY"), | |||
@Type(value = FederatedMetaStore.class, name = "FEDERATED") }) | |||
public abstract class AbstractMetaStore { | |||
private String catalog = "hive"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is hive
the default catalog name if one doesn't specifically set one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -15,6 +15,8 @@ | |||
*/ | |||
package com.hotels.bdp.waggledance.mapping.model; | |||
|
|||
import static org.apache.hadoop.hive.metastore.utils.MetaStoreUtils.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please expand to fully qualified imports instead of *
.
@@ -58,9 +58,9 @@ | |||
|
|||
@Before | |||
public void init() { | |||
metaStoreMapping = new MetaStoreMappingImpl(DATABASE_PREFIX, NAME, client, accessControlHandler, DIRECT, LATENCY, | |||
metaStoreMapping = new MetaStoreMappingImpl(DATABASE_PREFIX, NAME,"hive", client, accessControlHandler, DIRECT, LATENCY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metaStoreMapping = new MetaStoreMappingImpl(DATABASE_PREFIX, NAME,"hive", client, accessControlHandler, DIRECT, LATENCY, | |
metaStoreMapping = new MetaStoreMappingImpl(DATABASE_PREFIX, NAME, "hive", client, accessControlHandler, DIRECT, LATENCY, |
new DefaultMetaStoreFilterHookImpl(new HiveConf())); | ||
tunneledMetaStoreMapping = new MetaStoreMappingImpl(DATABASE_PREFIX, NAME, client, accessControlHandler, TUNNELED, | ||
tunneledMetaStoreMapping = new MetaStoreMappingImpl(DATABASE_PREFIX, NAME,"hive", client, accessControlHandler, TUNNELED, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tunneledMetaStoreMapping = new MetaStoreMappingImpl(DATABASE_PREFIX, NAME,"hive", client, accessControlHandler, TUNNELED, | |
tunneledMetaStoreMapping = new MetaStoreMappingImpl(DATABASE_PREFIX, NAME, "hive", client, accessControlHandler, TUNNELED, |
@@ -27,7 +27,7 @@ | |||
@SuppressWarnings("resource") | |||
public class PrefixMappingTest { | |||
|
|||
private final MetaStoreMapping metaStoreMapping = new MetaStoreMappingImpl("prefix_", "mapping", null, null, DIRECT, | |||
private final MetaStoreMapping metaStoreMapping = new MetaStoreMappingImpl("prefix_", "mapping","hive", null, null, DIRECT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private final MetaStoreMapping metaStoreMapping = new MetaStoreMappingImpl("prefix_", "mapping","hive", null, null, DIRECT, | |
private final MetaStoreMapping metaStoreMapping = new MetaStoreMappingImpl("prefix_", "mapping", "hive", null, null, DIRECT, |
@@ -38,6 +36,7 @@ | |||
import org.apache.commons.vfs2.FileSystemException; | |||
import org.apache.commons.vfs2.FileSystemManager; | |||
import org.apache.commons.vfs2.VFS; | |||
import org.apache.logging.log4j.util.Strings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be using this Strings
util class but rather one from guava
or apache-commons
public @Rule ThriftHiveMetaStoreJUnitRule localServer = new ThriftHiveMetaStoreJUnitRule(LOCAL_DATABASE); | ||
public @Rule ThriftHiveMetaStoreJUnitRule remoteServer = new ThriftHiveMetaStoreJUnitRule(REMOTE_DATABASE); | ||
public @Rule ThriftHiveMetaStoreJUnitRule newRemoteServer = new ThriftHiveMetaStoreJUnitRule(); | ||
public static Map<String,String> hiveConfig = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the move to BeeJU 5.x which supports Hive-3.x I'm not sure we need to do this, it should be doing this itself?
{ | ||
try { | ||
String internalName = parseDbName(dbName, null)[DB_NAME]; | ||
return internalName!=null ? internalName : "*"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if defaulting to * is correct here, depends on what called this perhaps just return what was given, if null it's null the caller should deal with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice, made some comments as well, please have a look, thank you for contributing!
There has been many changes and this go out of date. Closed. |
Description
The PR is a proposal for migrating to Hive3. I kept the same configurations file adding the information about the catalog in the database configuration (if missed = "hive"). I did not implement the new Hive3 methods that i collected in the class FederatedHMSHandlerHive3 that can be merged with FederatedHMSHandlerHive when done.
I used the following approach with the internal mapping unchanged:
Any feedback is welcome, in particurlar I need a suggestion on the new methods to forward (i'm not sure that it make sense fot all of them)
Related Issues #197