[ 
https://issues.apache.org/jira/browse/HIVE-26180?focusedWorklogId=763248&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-763248
 ]

ASF GitHub Bot logged work on HIVE-26180:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Apr/22 02:07
            Start Date: 28/Apr/22 02:07
    Worklog Time Spent: 10m 
      Work Description: 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!





Issue Time Tracking
-------------------

    Worklog Id:     (was: 763248)
    Time Spent: 1h 40m  (was: 1.5h)

> Change MySQLConnectorProvider driver from mariadb to mysql
> ----------------------------------------------------------
>
>                 Key: HIVE-26180
>                 URL: https://issues.apache.org/jira/browse/HIVE-26180
>             Project: Hive
>          Issue Type: Bug
>          Components: StorageHandler
>    Affects Versions: 4.0.0-alpha-1, 4.0.0-alpha-2
>            Reporter: zhangbutao
>            Assignee: zhangbutao
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0-alpha-2
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> I test with example  {_}dataconnector_mysql.q{_}. When I execute  _show 
> tables_ from remote database, it failed with WARN log:
>  
> {code:java}
> 2022-04-27T16:52:34,696  WARN [Metastore-Handler-Pool: Thread-48] 
> jdbc.AbstractJDBCConnectorProvider: Driver class not found in 
> classpath:org.mariadb.jdbc.Driver
> 2022-04-27T16:52:34,698  WARN [Metastore-Handler-Pool: Thread-48] 
> metastore.HMSHandler: Unexpected exception while getting table(s) in remote 
> database db_mysql
> org.apache.hadoop.hive.metastore.api.MetaException: Could not instantiate a 
> provider for database db_mysql{code}
>  
> And so I add _mariadb-java-client-2.5.0.jar_ to hive lib, It is ok to show 
> tables from remote database, but this leads to failure on native database:
> {code:java}
> 2022-04-27T17:01:38,763 ERROR [Metastore-Handler-Pool: Thread-43] 
> Datastore.Schema: An exception was thrown while adding/validating class(es) : 
> Table "columns_v2" has been specified with a primary-key to include column 
> "CD_ID" but this column is not found in the table. Please check your 
> <primary-key> column specification.
> Table "columns_v2" has been specified with a primary-key to include column 
> "CD_ID" but this column is not found in the table. Please check your 
> <primary-key> column specification.
> org.datanucleus.exceptions.NucleusUserException: Table "columns_v2" has been 
> specified with a primary-key to include column "CD_ID" but this column is not 
> found in the table. Please check your <primary-key> column specification.
>         at 
> org.datanucleus.store.rdbms.table.ElementContainerTable.applyUserPrimaryKeySpecification(ElementContainerTable.java:225)
>         at 
> org.datanucleus.store.rdbms.table.CollectionTable.initialize(CollectionTable.java:235)
>         at 
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.initializeClassTables(RDBMSStoreManager.java:3318)
>         at 
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2938)
>         at 
> org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:118)
>  {code}
>  
> If I change MySQLConnectorProvider driver from mariadb to mysql,  It's good 
> to both remote mysql database and native database.
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to