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: 
[email protected]

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

Reply via email to