You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "PeiMouRen (via GitHub)" <gi...@apache.org> on 2023/06/25 06:58:38 UTC

[GitHub] [shardingsphere] PeiMouRen opened a new issue, #26537: How do I query a single table

PeiMouRen opened a new issue, #26537:
URL: https://github.com/apache/shardingsphere/issues/26537

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   5.3.2
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   proxy routing data source error when I query single table.
   ### Actual behavior
   The proxy routes correctly to the data source where the single table exist.
   ### Reason analyze (If you can)
   I don't known.
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   **single table cofig**
   ```sql
   > SHOW DEFAULT SINGLE TABLE STORAGE UNIT;
    storage_unit_name 
   -------------------
    RANDOM
   
   > SHOW SINGLE TABLES LIKE 't_test%';
    table_name | storage_unit_name 
   ------------+-------------------
    t_test     | ds_4
    t_test1    | ds_4
   ```
   
   **query a single table**
   ```sql
   > select * from t_test;
   ERROR:  relation "t_test" does not exist
   LINE 1: select * from t_test;
   ```
   
   **proxy log**
   ```
   2023-06-25 14:55:03,854 [Connection-2-ThreadExecutor] INFO  ShardingSphere-SQL - Logic SQL: select * from t_test; 
   2023-06-25 14:55:03,855 [Connection-2-ThreadExecutor] INFO  ShardingSphere-SQL - Actual SQL: ds_0 ::: select * from t_test; 
   2023-06-25 14:55:03,855 [Connection-2-ThreadExecutor] ERROR o.a.s.p.f.c.CommandExecutorTask - Exception occur:  
   org.postgresql.util.PSQLException: ERROR: relation "t_test" does not exist
     位置:15
           at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
           at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
           at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
           at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:490)
           at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:408)
           at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:329)
           at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:315)
           at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:291)
           at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:286)
           at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:1256)
           at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:102)
           at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
           at org.apache.shardingsphere.proxy.backend.connector.jdbc.executor.callback.impl.ProxyStatementExecutorCallback.execute(ProxyStatementExecutorCallback.java:42)
           at org.apache.shardingsphere.proxy.backend.connector.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:76)
           at org.apache.shardingsphere.proxy.backend.connector.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:69)
           at org.apache.shardingsphere.proxy.backend.connector.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:46)
           at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:86)
           at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:65)
           at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.syncExecute(ExecutorEngine.java:133)
           at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.parallelExecute(ExecutorEngine.java:129)
           at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.execute(ExecutorEngine.java:114)
           at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:67)
           at org.apache.shardingsphere.proxy.backend.connector.jdbc.executor.ProxyJDBCExecutor.execute(ProxyJDBCExecutor.java:74)
           at org.apache.shardingsphere.proxy.backend.connector.ProxySQLExecutor.useDriverToExecute(ProxySQLExecutor.java:195)
           at org.apache.shardingsphere.proxy.backend.connector.ProxySQLExecutor.execute(ProxySQLExecutor.java:156)
           at org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.doExecute(DatabaseConnector.java:263)
           at org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.doExecute(DatabaseConnector.java:249)
           at org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.execute(DatabaseConnector.java:209)
           at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.simple.PostgreSQLComQueryExecutor.execute(PostgreSQLComQueryExecutor.java:77)
           at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.doExecuteCommand(CommandExecutorTask.java:114)
           at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:109)
           at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:77)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:748)
   ```
   
   As shown above, the proxy did not route to the correct data source when querying a single table.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

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


[GitHub] [shardingsphere] RaigorJiang commented on issue #26537: How do I query a single table

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #26537:
URL: https://github.com/apache/shardingsphere/issues/26537#issuecomment-1606072009

   Hi @peixingzhe 
   ShardingSphere currently does not support partition tables, and `public` schema is used by default in PG.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] github-actions[bot] commented on issue #26537: How do I query a single table

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #26537:
URL: https://github.com/apache/shardingsphere/issues/26537#issuecomment-1652870802

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] peixingzhe commented on issue #26537: How do I query a single table

Posted by "peixingzhe (via GitHub)" <gi...@apache.org>.
peixingzhe commented on issue #26537:
URL: https://github.com/apache/shardingsphere/issues/26537#issuecomment-1606363026

   > Hi @peixingzhe ShardingSphere currently does not support partition tables, and `public` schema is used by default in PG.
   
   But why can I query a single table(in custom schema and is a partitioned table) without specifying a schema when I put it in a `ds_0` data source?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] RaigorJiang commented on issue #26537: How do I query a single table

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #26537:
URL: https://github.com/apache/shardingsphere/issues/26537#issuecomment-1608737110

   I think it needs to be investigated.
   Hi @strongduanmu , do you have some info?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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