Skip to content
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

Closed

Conversation

rodolfototaro
Copy link

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:

  • if the dbname embed the catalog name in the call i extract it as internal_name
  • I use it for the mapping
  • but I use the complete name for forwarding the request

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

rtotaro added 3 commits April 22, 2021 06:51
# 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
@massdosage
Copy link
Contributor

massdosage commented Apr 27, 2021

Thanks for raising this @rtotarocuebiq . We will try take a look and give some comments later this week.

Copy link
Contributor

@massdosage massdosage left a 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>-->
Copy link
Contributor

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>
Copy link
Contributor

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()
{
Copy link
Contributor

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";
Copy link
Contributor

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?

Copy link
Contributor

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.*;
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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;
Copy link
Contributor

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<>();
Copy link
Contributor

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 : "*";
Copy link
Contributor

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.

Copy link
Contributor

@patduin patduin left a 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!

@patduin patduin closed this Oct 2, 2023
@patduin
Copy link
Contributor

patduin commented Oct 2, 2023

There has been many changes and this go out of date. Closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants