You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/04/27 09:19:18 UTC

[GitHub] [hive] zhangbutao opened a new pull request, #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

zhangbutao opened a new pull request, #3250:
URL: https://github.com/apache/hive/pull/3250

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   Change MySQLConnectorProvider driver from mariadb to mysql
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   mariadb driver may bring problem when getting native tables.
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   No
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   Local hive cluster and mysql cluster, and metastore use mysql to store metadata.
   Also test with `dataconnector_mysql.q`:
   mvn test -Dtest.output.overwrite  -Dtest=TestMiniLlapLocalCliDriver -Dqfile=dataconnector_mysql.q -pl itests/qtest -Pitests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] nrg4878 commented on a diff in pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
nrg4878 commented on code in PR #3250:
URL: https://github.com/apache/hive/pull/3250#discussion_r859911506


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/MySQLConnectorProvider.java:
##########
@@ -31,7 +31,7 @@
 public class MySQLConnectorProvider extends AbstractJDBCConnectorProvider {
   private static Logger LOG = LoggerFactory.getLogger(MySQLConnectorProvider.class);
 
-  private static final String DRIVER_CLASS = "org.mariadb.jdbc.Driver";
+  private static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";

Review Comment:
   Sounds good.
   
   Are you using this data connector feature? can you please drop me a few lines on how you use it or plan to use this? Thank you



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zhangbutao commented on a diff in pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
zhangbutao commented on code in PR #3250:
URL: https://github.com/apache/hive/pull/3250#discussion_r860391399


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/MySQLConnectorProvider.java:
##########
@@ -31,7 +31,7 @@
 public class MySQLConnectorProvider extends AbstractJDBCConnectorProvider {
   private static Logger LOG = LoggerFactory.getLogger(MySQLConnectorProvider.class);
 
-  private static final String DRIVER_CLASS = "org.mariadb.jdbc.Driver";
+  private static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";

Review Comment:
   > Are there any new connectors you plan on adding or have added that can be contributed back to the hive community? or any bug fixes you may have made? (I recently opened a bug for the any documentation enhancements in the Apache docs would be very helpful as well.
   
   @nrg4878 Currently  we mostly use existing mysql jdbc data connectors. If we add a new data connecotr, I'm more than happy to contribute it to the community.  I will explore storage handler and data connector in depth, and i will fire pr if finding related bugs. :)
   
   >  Given your extensive work with MySQL, would you be able to look at https://issues.apache.org/jira/browse/HIVE-26046 ? its about mapping bit datatypes from mysql to hive.
   
   Sure, I'd be happy to look into HIVE-26046. I will give a fix as soon as possible if i can solve it.
   Thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] nrg4878 commented on a diff in pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
nrg4878 commented on code in PR #3250:
URL: https://github.com/apache/hive/pull/3250#discussion_r859876764


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/MySQLConnectorProvider.java:
##########
@@ -31,7 +31,7 @@
 public class MySQLConnectorProvider extends AbstractJDBCConnectorProvider {
   private static Logger LOG = LoggerFactory.getLogger(MySQLConnectorProvider.class);
 
-  private static final String DRIVER_CLASS = "org.mariadb.jdbc.Driver";
+  private static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";

Review Comment:
   I noticed this too yesterday and was wondering about this. This was change in https://issues.apache.org/jira/browse/HIVE-25423. I am wondering if this change back would break the test infra. Have you given it a try? Thanks 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zhangbutao commented on pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
zhangbutao commented on PR #3250:
URL: https://github.com/apache/hive/pull/3250#issuecomment-1111065909

   @zabetak @nrg4878 Would you like to take a look? thx


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] nrg4878 commented on pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
nrg4878 commented on PR #3250:
URL: https://github.com/apache/hive/pull/3250#issuecomment-1111720956

   merged. Thank you


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] nrg4878 commented on a diff in pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
nrg4878 commented on code in PR #3250:
URL: https://github.com/apache/hive/pull/3250#discussion_r860112893


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/MySQLConnectorProvider.java:
##########
@@ -31,7 +31,7 @@
 public class MySQLConnectorProvider extends AbstractJDBCConnectorProvider {
   private static Logger LOG = LoggerFactory.getLogger(MySQLConnectorProvider.class);
 
-  private static final String DRIVER_CLASS = "org.mariadb.jdbc.Driver";
+  private static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";

Review Comment:
   Thats was the exact goal for this framework as well. 
   
   Are there any new connectors you plan on adding or have added that can be contributed back to the hive community? or any bug fixes you may have made? (I recently opened a bug for the any documentation enhancements in the Apache docs would be very helpful as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zhangbutao commented on a diff in pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
zhangbutao commented on code in PR #3250:
URL: https://github.com/apache/hive/pull/3250#discussion_r859898289


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/MySQLConnectorProvider.java:
##########
@@ -31,7 +31,7 @@
 public class MySQLConnectorProvider extends AbstractJDBCConnectorProvider {
   private static Logger LOG = LoggerFactory.getLogger(MySQLConnectorProvider.class);
 
-  private static final String DRIVER_CLASS = "org.mariadb.jdbc.Driver";
+  private static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";

Review Comment:
   Yes, I have tested the pr with local hive cluster and mysql.  I also have  run qtest `dataconnector_mysql.q` which was added in HIVE-25423.
   I'm not sure why would HIVE-25423 change DRIVER_CLASS to mariadb. Anyway, if i change it back to mysql driver, my hive cluster will be ok.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] nrg4878 merged pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
nrg4878 merged PR #3250:
URL: https://github.com/apache/hive/pull/3250


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] nrg4878 commented on a diff in pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
nrg4878 commented on code in PR #3250:
URL: https://github.com/apache/hive/pull/3250#discussion_r860118784


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/MySQLConnectorProvider.java:
##########
@@ -31,7 +31,7 @@
 public class MySQLConnectorProvider extends AbstractJDBCConnectorProvider {
   private static Logger LOG = LoggerFactory.getLogger(MySQLConnectorProvider.class);
 
-  private static final String DRIVER_CLASS = "org.mariadb.jdbc.Driver";
+  private static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";

Review Comment:
   @zhangbutao Given your extensive work with MySQL, would you be able to look at https://issues.apache.org/jira/browse/HIVE-26046 ? its about mapping bit datatypes from mysql to hive.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zhangbutao commented on pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
zhangbutao commented on PR #3250:
URL: https://github.com/apache/hive/pull/3250#issuecomment-1111665196

   The failed test(`Generate javadoc`) does not appear to be related to this change.  I've seen subsequent new pr tests failed at this stage.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zhangbutao commented on a diff in pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
zhangbutao commented on code in PR #3250:
URL: https://github.com/apache/hive/pull/3250#discussion_r859964669


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/MySQLConnectorProvider.java:
##########
@@ -31,7 +31,7 @@
 public class MySQLConnectorProvider extends AbstractJDBCConnectorProvider {
   private static Logger LOG = LoggerFactory.getLogger(MySQLConnectorProvider.class);
 
-  private static final String DRIVER_CLASS = "org.mariadb.jdbc.Driver";
+  private static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";

Review Comment:
   Sure. We plan to build a centralized metadata management based on metastore4.0 and other engines like spark and presto can get metadata from it. With the help of data connector we can easily map different metadata (primarily mysql) to the centralized metastore, and we can do some authorization to data connector metadata based on metastore-ranger feature. 
   
    In the future, we hope to quickly get all kinds of metadata based on data connector, eg. hbase or another hive. 
   
   I've been watching HIVE-24396.  Thank you for developing this feature!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zabetak commented on a diff in pull request #3250: HIVE-26180: Change MySQLConnectorProvider driver from mariadb to mysql

Posted by GitBox <gi...@apache.org>.
zabetak commented on code in PR #3250:
URL: https://github.com/apache/hive/pull/3250#discussion_r860067577


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/MySQLConnectorProvider.java:
##########
@@ -31,7 +31,7 @@
 public class MySQLConnectorProvider extends AbstractJDBCConnectorProvider {
   private static Logger LOG = LoggerFactory.getLogger(MySQLConnectorProvider.class);
 
-  private static final String DRIVER_CLASS = "org.mariadb.jdbc.Driver";
+  private static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";

Review Comment:
   I am not sure why HIVE-25423 changed the driver to use mariadb but maybe it has to do with the fact that the added test (dataconnector_mysql.q) was also using a docker image of MariaDB (even though the respective class was implying that it was MySQL) before I fix it on HIVE-25594.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org