You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/09/08 14:41:30 UTC

[GitHub] [shardingsphere] shinxi opened a new issue, #20891: Shardingsphere jdbc unsupported items

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

   Hello Shardingsphere team,
   
   We're currently evaluating using the ShardingSphere-JDBC for read-write splitting, and we believe it's a very cool framework.
   After a quick test, we have some questions and would like to confirm.
   1. Our DB is PostgreSQL, and it looks ShardingSphere-JDBC doesn't support query/select array elements (however, do not see it's listed at [unsupported page](https://shardingsphere.apache.org/document/5.1.2/en/user-manual/shardingsphere-jdbc/unsupported/)). E.g., if query the first element of an array field like the following:
   `template.queryForList("select bar[1] FROM foo limit 1")`
   it'll just throw NullPointException
   > Caused by: java.lang.NullPointerException: null? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitColumnref(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:433)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitColumnref(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:187)? at org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser$ColumnrefContext.accept(org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.java:16941)? at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(org/antlr/v4/runtime/tree/AbstractParseTreeVisitor.java:18)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitCExpr(org/apache/shardingsphere/sql/parser/postgresql/visitor/statemen
 t/impl/PostgreSQLStatementSQLVisitor.java:329)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitCExpr(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:187)? at org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser$CExprContext.accept(org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.java:16177)? at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(org/antlr/v4/runtime/tree/AbstractParseTreeVisitor.java:18)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitTargetEl(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:946)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitTargetEl(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/Post
 greSQLStatementSQLVisitor.java:187)? at org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser$TargetElContext.accept(org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.java:7882)? at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(org/antlr/v4/runtime/tree/AbstractParseTreeVisitor.java:18)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitTargetList(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:928)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitTargetList(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:187)? at org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser$TargetListContext.accept(org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.java:7801)? at org.antlr.
 v4.runtime.tree.AbstractParseTreeVisitor.visit(org/antlr/v4/runtime/tree/AbstractParseTreeVisitor.java:18)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitSimpleSelect(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:857)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitSimpleSelect(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:187)? at org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser$SimpleSelectContext.accept(org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.java:5159)? at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(org/antlr/v4/runtime/tree/AbstractParseTreeVisitor.java:18)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitSelectC
 lauseN(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:830)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitSelectClauseN(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:187)? at org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser$SelectClauseNContext.accept(org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.java:4980)? at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(org/antlr/v4/runtime/tree/AbstractParseTreeVisitor.java:18)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitSelectNoParens(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:798)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisit
 or.visitSelectNoParens(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:187)? at org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser$SelectNoParensContext.accept(org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.java:4773)? at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(org/antlr/v4/runtime/tree/AbstractParseTreeVisitor.java:18)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitSelect(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:790)? at org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.impl.PostgreSQLStatementSQLVisitor.visitSelect(org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:187)? at org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser$SelectContext.accept(org/
 apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.java:4650)? at org.apache.shardingsphere.sql.parser.api.SQLVisitorEngine.visit(org/apache/shardingsphere/sql/parser/api/SQLVisitorEngine.java:55)? at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserExecutor.parse(org/apache/shardingsphere/infra/parser/sql/SQLStatementParserExecutor.java:48)? at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(org/apache/shardingsphere/infra/parser/sql/SQLStatementParserEngine.java:47)? at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(org/apache/shardingsphere/infra/parser/ShardingSphereSQLParserEngine.java:58)? at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement.createLogicSQL(org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java:458)? at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement.executeQuery(org/apache/shardingsphere/driver/jdb
 c/core/statement/ShardingSphereStatement.java:150)? at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(org/springframework/jdbc/core/JdbcTemplate.java:439)? at org.springframework.jdbc.core.JdbcTemplate.execute(org/springframework/jdbc/core/JdbcTemplate.java:376)? at org.springframework.jdbc.core.JdbcTemplate.query(org/springframework/jdbc/core/JdbcTemplate.java:452)? at org.springframework.jdbc.core.JdbcTemplate.query(org/springframework/jdbc/core/JdbcTemplate.java:462)? at org.springframework.jdbc.core.JdbcTemplate.queryForList(org/springframework/jdbc/core/JdbcTemplate.java:490)?
   
   Not sure if any workaround to overcome this issue?
   2. From [unsupported page](https://shardingsphere.apache.org/document/5.1.2/en/user-manual/shardingsphere-jdbc/unsupported/), it's said stored procedure and function are not supported, but do we have any plan to support them in the future?
   3. For ShardingSphere-Proxy, does it support query array element, and stored procedure and function? Can't find an unsupported page for ShardingSphere-Proxy...
   
   Thanks in advance.


-- 
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] shinxi commented on issue #20891: Shardingsphere jdbc unsupported items

Posted by GitBox <gi...@apache.org>.
shinxi commented on issue #20891:
URL: https://github.com/apache/shardingsphere/issues/20891#issuecomment-1244874711

   @linghengqian thanks for the response. Didn't understand what you meant by `non-mandatory hint`, but the issue does exist for a single dimension array, i.e., from your example
   ```sql
   insert into t values (2, array[1]);
   ```
   ```java
   template.queryForList("select i1[1] from t where i0=2");
   ```
   will fail as well.


-- 
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] linghengqian commented on issue #20891: Shardingsphere jdbc unsupported items

Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #20891:
URL: https://github.com/apache/shardingsphere/issues/20891#issuecomment-1244068575

   - It looks like postgresql's array is just a non-mandatory hint?
   
   - ![20220913_012517.jpg](https://user-images.githubusercontent.com/20187731/189718454-b4e28921-e219-4d63-9abd-41f2d9ecf455.jpg)
   
   - I'm not a postgresql expert, I just found a strange setting in postgresql.


-- 
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 #20891: Shardingsphere jdbc unsupported items

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #20891:
URL: https://github.com/apache/shardingsphere/issues/20891#issuecomment-1272348497

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


-- 
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] linghengqian commented on issue #20891: Shardingsphere jdbc unsupported items

Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #20891:
URL: https://github.com/apache/shardingsphere/issues/20891#issuecomment-1245501719

   - It is indeed unsupported sql.  Can you start by mentioning a PR related to the documentation?  
   
   - Or fix it directly?  However, it seems that the decision logic of postgresql's multidimensional array is not easy to write.


-- 
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] closed issue #20891: Shardingsphere jdbc unsupported items

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #20891: Shardingsphere jdbc unsupported items
URL: https://github.com/apache/shardingsphere/issues/20891


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