You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "imbls (via GitHub)" <gi...@apache.org> on 2024/03/17 14:00:32 UTC

[PR] [fix](jdbc catalog) fix npe when use only_specified_database config and jdbc_url has schema [doris]

imbls opened a new pull request, #32350:
URL: https://github.com/apache/doris/pull/32350

   ## Proposed changes
   
   Issue Number: close #xxx
   
   set dbname mapping when use only_specified_database config and jdbc_url has schema
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc catalog) fix npe when use only_specified_database config and jdbc_url has schema [doris]

Posted by "zy-kkk (via GitHub)" <gi...@apache.org>.
zy-kkk commented on code in PR #32350:
URL: https://github.com/apache/doris/pull/32350#discussion_r1528791025


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcMySQLClient.java:
##########
@@ -77,7 +77,7 @@ protected List<String> getSpecifiedDatabase(Connection conn) {
         } finally {
             close(conn);
         }
-        return databaseNames;
+        return jdbcLowerCaseMetaMatching.setDatabaseNameMapping(databaseNames);

Review Comment:
       @Override
       protected List<String> getSpecifiedDatabase(Connection conn) {
           List<String> remoteDatabaseNames = Lists.newArrayList();
           try {
               remoteDatabaseNames.add(conn.getCatalog());
           } catch (SQLException e) {
               throw new JdbcClientException("failed to get specified database name from jdbc", e);
           } finally {
               close(conn);
           }
           return filterDatabaseNames(remoteDatabaseNames);
       }



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc catalog) fix npe when use only_specified_database config and jdbc_url has schema [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #32350:
URL: https://github.com/apache/doris/pull/32350#issuecomment-2002497662

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 38372 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit e017f2b4e70885c92cf213cbfc55411153155113, data reload: false
   
   ------ Round 1 ----------------------------------
   q1	17656	4204	4089	4089
   q2	2015	156	151	151
   q3	10594	1108	881	881
   q4	8129	760	754	754
   q5	7461	2741	2729	2729
   q6	185	122	122	122
   q7	1171	811	787	787
   q8	9419	2008	2007	2007
   q9	7213	6452	6382	6382
   q10	8522	3533	3604	3533
   q11	430	223	226	223
   q12	703	306	297	297
   q13	17843	2873	2871	2871
   q14	292	242	247	242
   q15	505	463	459	459
   q16	507	410	382	382
   q17	939	547	540	540
   q18	7052	6497	6395	6395
   q19	1563	1462	1371	1371
   q20	560	280	278	278
   q21	6305	3573	3601	3573
   q22	350	306	309	306
   Total cold run time: 109414 ms
   Total hot run time: 38372 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   q1	4059	4082	4059	4059
   q2	323	229	219	219
   q3	2943	2823	2857	2823
   q4	1878	1552	1574	1552
   q5	5220	5250	5240	5240
   q6	194	117	118	117
   q7	2238	1868	1870	1868
   q8	3135	3266	3250	3250
   q9	8557	8489	8529	8489
   q10	3653	3672	3672	3672
   q11	538	444	437	437
   q12	729	548	541	541
   q13	16920	2848	2873	2848
   q14	276	245	256	245
   q15	480	440	440	440
   q16	454	407	404	404
   q17	1710	1492	1462	1462
   q18	7584	7242	7149	7149
   q19	1619	1522	1514	1514
   q20	1892	1720	1716	1716
   q21	5017	4711	4718	4711
   q22	528	449	452	449
   Total cold run time: 69947 ms
   Total hot run time: 53205 ms
   ```
   </details>
   


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc catalog) fix npe when use only_specified_database config and jdbc_url has schema [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #32350:
URL: https://github.com/apache/doris/pull/32350#issuecomment-2002481881

   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR)


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc catalog) fix npe when use only_specified_database config and jdbc_url has schema [doris]

Posted by "imbls (via GitHub)" <gi...@apache.org>.
imbls commented on code in PR #32350:
URL: https://github.com/apache/doris/pull/32350#discussion_r1529631235


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcClient.java:
##########
@@ -221,7 +221,7 @@ public List<String> getDatabaseNameList() {
         Statement stmt = null;
         ResultSet rs = null;
         if (isOnlySpecifiedDatabase && includeDatabaseMap.isEmpty() && excludeDatabaseMap.isEmpty()) {
-            return getSpecifiedDatabase(conn);
+            return filterDatabaseNames(getSpecifiedDatabase(conn));

Review Comment:
   ok, it’s my mistake, i will modify in tonight



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc catalog) fix npe when use only_specified_database config and jdbc_url has schema [doris]

Posted by "imbls (via GitHub)" <gi...@apache.org>.
imbls closed pull request #32350: [fix](jdbc catalog) fix npe when use only_specified_database config and jdbc_url has schema
URL: https://github.com/apache/doris/pull/32350


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc catalog) fix npe when use only_specified_database config and jdbc_url has schema [doris]

Posted by "zy-kkk (via GitHub)" <gi...@apache.org>.
zy-kkk commented on code in PR #32350:
URL: https://github.com/apache/doris/pull/32350#discussion_r1529611796


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcClient.java:
##########
@@ -221,7 +221,7 @@ public List<String> getDatabaseNameList() {
         Statement stmt = null;
         ResultSet rs = null;
         if (isOnlySpecifiedDatabase && includeDatabaseMap.isEmpty() && excludeDatabaseMap.isEmpty()) {
-            return getSpecifiedDatabase(conn);
+            return filterDatabaseNames(getSpecifiedDatabase(conn));

Review Comment:
   You should also apply this modification where you override getDatabaseNameList()



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc catalog) fix npe when use only_specified_database config and jdbc_url has schema [doris]

Posted by "zy-kkk (via GitHub)" <gi...@apache.org>.
zy-kkk commented on code in PR #32350:
URL: https://github.com/apache/doris/pull/32350#discussion_r1528790344


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcClient.java:
##########
@@ -363,7 +363,7 @@ protected List<String> getSpecifiedDatabase(Connection conn) {
         } finally {
             close(conn);
         }
-        return databaseNames;
+        return jdbcLowerCaseMetaMatching.setDatabaseNameMapping(databaseNames);

Review Comment:
       protected List<String> getSpecifiedDatabase(Connection conn) {
           List<String> remoteDatabaseNames = Lists.newArrayList();
           try {
               remoteDatabaseNames.add(conn.getSchema());
           } catch (SQLException e) {
               throw new JdbcClientException("failed to get specified database name from jdbc", e);
           } finally {
               close(conn);
           }
           return filterDatabaseNames(remoteDatabaseNames);
       }



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc catalog) fix npe when use only_specified_database config and jdbc_url has schema [doris]

Posted by "imbls (via GitHub)" <gi...@apache.org>.
imbls commented on PR #32350:
URL: https://github.com/apache/doris/pull/32350#issuecomment-2002484268

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org