You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/04/24 02:57:38 UTC

[GitHub] [pulsar] jianyun8023 opened a new pull request, #15287: [pulsar-io] Specify the database when getting the table definition

jianyun8023 opened a new pull request, #15287:
URL: https://github.com/apache/pulsar/pull/15287

   
   Fixes #15285 
   
   ### Motivation
   
   Fix the problem of getting `db1.tebble1` but getting `db2.tebble1`.
   
   ### Modifications
   
   Specify the current database when getting the table schema
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API: (yes / **no**)
     - The schema: (yes / **no** / don't know)
     - The default values of configurations: (yes / **no**)
     - The wire protocol: (yes / **no**)
     - The rest endpoints: (yes / **no**)
     - The admin cli options: (yes / **no**)
     - Anything that affects deployment: (yes / no / **don't know**)
   
   ### Documentation
   
   Check the box below or label this PR directly.
   
   Need to update docs? 
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
     
   - [x] `no-need-doc` 
   (Please explain why)
     
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-added`
   (Docs have been already added)


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] tisonkun commented on a diff in pull request #15287: [pulsar-io] Specify the database when getting the table definition

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #15287:
URL: https://github.com/apache/pulsar/pull/15287#discussion_r1041050451


##########
pulsar-io/jdbc/core/src/main/java/org/apache/pulsar/io/jdbc/JdbcUtils.java:
##########
@@ -94,7 +94,7 @@ public static TableDefinition of(TableId tableId, List<ColumnId> columns,
      */
     public static TableId getTableId(Connection connection, String tableName) throws Exception {
         DatabaseMetaData metadata = connection.getMetaData();
-        try (ResultSet rs = metadata.getTables(null, null, tableName, new String[]{"TABLE"})) {
+        try (ResultSet rs = metadata.getTables(connection.getCatalog(), null, tableName, new String[]{"TABLE"})) {

Review Comment:
   ```suggestion
           try (ResultSet rs = metadata.getTables(connection.getCatalog(), connection.getSchema(), tableName, new String[]{"TABLE"})) {
   ```
   
   ? I think this can be trivial to merge as long as all tests passed.



-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] github-actions[bot] commented on pull request #15287: [pulsar-io] Specify the database when getting the table definition

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #15287:
URL: https://github.com/apache/pulsar/pull/15287#issuecomment-1136638961

   The pr had no activity for 30 days, mark with Stale label.


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] tisonkun commented on pull request #15287: [pulsar-io] Specify the database when getting the table definition

Posted by GitBox <gi...@apache.org>.
tisonkun commented on PR #15287:
URL: https://github.com/apache/pulsar/pull/15287#issuecomment-1345273845

   Closed as stale and conflict. Please rebase and resubmit the patch if it's still relevant.


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] jianyun8023 commented on pull request #15287: [pulsar-io] Specify the database when getting the table definition

Posted by GitBox <gi...@apache.org>.
jianyun8023 commented on PR #15287:
URL: https://github.com/apache/pulsar/pull/15287#issuecomment-1107789281

   > Could you add some tests to verify it?
   
   No problem, I will find some time to write this verification.


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] tisonkun closed pull request #15287: [pulsar-io] Specify the database when getting the table definition

Posted by GitBox <gi...@apache.org>.
tisonkun closed pull request #15287: [pulsar-io] Specify the database when getting the table definition
URL: https://github.com/apache/pulsar/pull/15287


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] github-actions[bot] commented on pull request #15287: [pulsar-io] Specify the database when getting the table definition

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #15287:
URL: https://github.com/apache/pulsar/pull/15287#issuecomment-1165111631

   The pr had no activity for 30 days, mark with Stale label.


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] tisonkun commented on a diff in pull request #15287: [pulsar-io] Specify the database when getting the table definition

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #15287:
URL: https://github.com/apache/pulsar/pull/15287#discussion_r1041051362


##########
pulsar-io/jdbc/core/src/main/java/org/apache/pulsar/io/jdbc/JdbcUtils.java:
##########
@@ -94,7 +94,7 @@ public static TableDefinition of(TableId tableId, List<ColumnId> columns,
      */
     public static TableId getTableId(Connection connection, String tableName) throws Exception {
         DatabaseMetaData metadata = connection.getMetaData();
-        try (ResultSet rs = metadata.getTables(null, null, tableName, new String[]{"TABLE"})) {
+        try (ResultSet rs = metadata.getTables(connection.getCatalog(), null, tableName, new String[]{"TABLE"})) {

Review Comment:
   It's not quite easy to add test case without involving external db systems.



-- 
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@pulsar.apache.org

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