vnhive commented on a change in pull request #2037:
URL: https://github.com/apache/hive/pull/2037#discussion_r601428596



##########
File path: ql/src/test/queries/clientpositive/dataconnector.q
##########
@@ -0,0 +1,71 @@
+-- SORT_QUERY_RESULTS
+SHOW CONNECTORS;
+
+-- CREATE with comment
+CREATE CONNECTOR mysql_test
+TYPE 'mysql'
+URL 'jdbc:mysql://nightly1.apache.org:3306/hive1'
+COMMENT 'test connector'
+WITH DCPROPERTIES (
+"hive.sql.dbcp.username"="hive1",
+"hive.sql.dbcp.password"="hive1");
+SHOW CONNECTORS;
+
+-- CREATE INE already exists
+CREATE CONNECTOR IF NOT EXISTS mysql_test
+TYPE 'mysql'
+URL 'jdbc:mysql://nightly1.apache.org:3306/hive1'
+COMMENT 'test connector'
+WITH DCPROPERTIES (
+"hive.sql.dbcp.username"="hive1",
+"hive.sql.dbcp.password"="hive1");
+SHOW CONNECTORS;
+
+-- CREATE INE already exists
+CREATE CONNECTOR IF NOT EXISTS derby_test
+TYPE 'derby'
+URL 'jdbc:derby:./target/tmp/junit_metastore_db;create=true'
+COMMENT 'test derby connector'
+WITH DCPROPERTIES (
+"hive.sql.dbcp.username"="APP",
+"hive.sql.dbcp.password"="mine");
+
+-- DROP
+DROP CONNECTOR mysql_test;
+SHOW CONNECTORS;
+
+-- DROP IE exists
+DROP CONNECTOR IF EXISTS mysql_test;
+SHOW CONNECTORS;
+
+-- recreate with same name
+CREATE CONNECTOR mysql_test
+TYPE 'mysql'
+URL 'jdbc:mysql://nightly1.apache.org:3306/hive1'
+COMMENT 'test connector'
+WITH DCPROPERTIES (
+"hive.sql.dbcp.username"="hive1",
+"hive.sql.dbcp.password"="hive1");
+SHOW CONNECTORS;
+
+CREATE REMOTE DATABASE db_derby USING derby_test with 
DBPROPERTIES("connector.remoteDbName"="APP");

Review comment:
       I have verified that it works when the database is junit_metastore_db
   
   0: jdbc:hive2://> describe database db_derby;
   21/03/25 17:38:52 [347f40a4-cd35-4566-9e26-ae5c40c70db4 main]: WARN 
lazy.LazyStruct: Extra bytes detected at the end of the row! Ignoring similar 
problems.
   
+-----------+----------+-----------+------------------+-------------+-------------+-----------------+---------------------+
   |  db_name  | comment  | location  | managedlocation  | owner_name  | 
owner_type  | connector_name  |    remote_dbname    |
   
+-----------+----------+-----------+------------------+-------------+-------------+-----------------+---------------------+
   | db_derby  |          |           |                  | narayanan   | USER   
     | derby_test      | junit_metastore_db  |
   
+-----------+----------+-----------+------------------+-------------+-------------+-----------------+---------------------+
   1 row selected (0.7 seconds)
   0: jdbc:hive2://> use db_derby;
   
   0: jdbc:hive2://> use db_derby;
   No rows affected (0.033 seconds)
   
   0: jdbc:hive2://> show tables;
   +-----------+
   | tab_name  |
   +-----------+
   | TBL1      |
   | TBL2      |
   +-----------+
   2 rows selected (0.156 seconds)




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to