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

   ### Which version of ShardingSphere did you use?
   we find java version: java17, full_version=17.0.1
   ShardingSphere-5.2.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   The insert statement is normal.
   
   ### Actual behavior
   The insert statement is abnormal.
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   ```
   drop table customer;                                                  
   CREATE TABLE CUSTOMER ( C_CUSTKEY INTEGER NOT NULL,
   C_NAME VARCHAR(25) NOT NULL,
   C_ADDRESS VARCHAR(40) NOT NULL,
   C_NATIONKEY INTEGER NOT NULL,
   C_PHONE CHAR(15) NOT NULL,
   C_ACCTBAL DECIMAL(15,2)   NOT NULL,
   C_MKTSEGMENT CHAR(10) NOT NULL,
   C_COMMENT VARCHAR(117) NOT NULL);
   
   INSERT INTO customer (c_custkey, c_name, c_address, c_nationkey, c_phone, 
c_acctbal, c_mktsegment, c_comment) VALUES (107451, 'Customer#000107451', 
'jZiY8FZz1pESpfE0ZvicC4f9evS1lrF', 24, '34-474-838-7669', -709.94, 'FURNITURE 
', 'ans. furiously final theodolites are carefully. carefully final theodolites 
alongside of the');   --abnormal
   
   INSERT INTO customer (c_custkey, c_name, c_address, c_nationkey, c_phone, 
c_acctbal, c_mktsegment, c_comment) VALUES (720, 'Customer#000000720', 
'8shFEL7J9sq1NJXR8dixBqaTO,kbSx', 22, '32-575-838-4260', 5357.32, 'HOUSEHOLD ', 
'furiously above the furiously ironic c'); --normal
   ```
   **background log**
   ```
   [ERROR] 2022-09-24 10:10:28.595 [epollEventLoopGroup-3-7] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur:
   java.lang.NullPointerException: Cannot invoke 
"org.antlr.v4.runtime.tree.ParseTree.accept(org.antlr.v4.runtime.tree.ParseTreeVisitor)"
 because "tree" is null
           at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
           at 
org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.impl.OpenGaussStatementSQLVisitor.createCommonBinaryOperationSegment(OpenGaussStatementSQLVisitor.java:348)
           at 
org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.impl.OpenGaussStatementSQLVisitor.visitAExpr(OpenGaussStatementSQLVisitor.java:303)
           at 
org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.impl.OpenGaussStatementSQLVisitor.visitAExpr(OpenGaussStatementSQLVisitor.java:194)
           at 
org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser$AExprContext.accept(OpenGaussStatementParser.java:14788)
           at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
           at 
org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.impl.OpenGaussStatementSQLVisitor.createInsertValuesSegments(OpenGaussStatementSQLVisitor.java:770)
           at 
org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.impl.OpenGaussStatementSQLVisitor.createInsertValuesSegments(OpenGaussStatementSQLVisitor.java:767)
           at 
org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.impl.OpenGaussStatementSQLVisitor.createInsertValuesSegments(OpenGaussStatementSQLVisitor.java:767)
           at 
org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.impl.OpenGaussStatementSQLVisitor.createInsertValuesSegments(OpenGaussStatementSQLVisitor.java:758)
           at 
org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.impl.OpenGaussStatementSQLVisitor.visitInsertRest(OpenGaussStatementSQLVisitor.java:696)
           at 
org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.impl.OpenGaussStatementSQLVisitor.visitInsertRest(OpenGaussStatementSQLVisitor.java:194)
           at 
org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser$InsertRestContext.accept(OpenGaussStatementParser.java:3231)
           at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
           at 
org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.impl.OpenGaussStatementSQLVisitor.visitInsert(OpenGaussStatementSQLVisitor.java:632)
           at 
org.apache.shardingsphere.sql.parser.opengauss.visitor.statement.impl.OpenGaussStatementSQLVisitor.visitInsert(OpenGaussStatementSQLVisitor.java:194)
           at 
org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser$InsertContext.accept(OpenGaussStatementParser.java:3089)
           at 
org.apache.shardingsphere.sql.parser.api.SQLVisitorEngine.visit(SQLVisitorEngine.java:54)
           at 
org.apache.shardingsphere.infra.parser.sql.SQLStatementParserExecutor.parse(SQLStatementParserExecutor.java:48)
           at 
org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:47)
           at 
org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:58)
           at 
org.apache.shardingsphere.proxy.backend.handler.ProxyBackendHandlerFactory.newInstance(ProxyBackendHandlerFactory.java:86)
           at 
org.apache.shardingsphere.proxy.frontend.opengauss.command.query.simple.OpenGaussComQueryExecutor.<init>(OpenGaussComQueryExecutor.java:72)
           at 
org.apache.shardingsphere.proxy.frontend.opengauss.command.OpenGaussCommandExecutorFactory.getCommandExecutor(OpenGaussCommandExecutorFactory.java:114)
           at 
org.apache.shardingsphere.proxy.frontend.opengauss.command.OpenGaussCommandExecutorFactory.newInstance(OpenGaussCommandExecutorFactory.java:76)
           at 
org.apache.shardingsphere.proxy.frontend.opengauss.command.OpenGaussCommandExecuteEngine.getCommandExecutor(OpenGaussCommandExecuteEngine.java:62)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:108)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:77)
           at 
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
           at 
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
           at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384)
           at 
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
           at 
io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
           at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
           at java.base/java.lang.Thread.run(Thread.java:833)
   ```
   
   
   
   ### Example codes for reproduce this issue (such as a github link).
   ```
   rules:
   - !SHARDING
     tables:
       lineitem:
         actualDataNodes: ds_${0..1}.lineitem_${0..1}
         databaseStrategy:
           standard:
             shardingColumn: l_partkey
             shardingAlgorithmName: lineitem-database-inline
         tableStrategy:
           standard:
             shardingColumn: l_orderkey
             shardingAlgorithmName: lineitem-table-inline
       customer:
         actualDataNodes: ds_${0..1}.customer_${0..1}
         databaseStrategy:
           standard:
             shardingColumn: c_custkey
             shardingAlgorithmName: customer-database-inline
         tableStrategy:
           standard:
             shardingColumn: c_nationkey
             shardingAlgorithmName: customer-table-inline
       nation:
         actualDataNodes: ds_${0..1}.nation_${0..1}
         databaseStrategy:
           standard:
             shardingColumn: n_nationkey
             shardingAlgorithmName: nation-database-inline
         tableStrategy:
           standard:
             shardingColumn: n_regionkey
             shardingAlgorithmName: nation-table-inline
       orders:
         actualDataNodes: ds_${0..1}.orders_${0..1}
         databaseStrategy:
           standard:
             shardingColumn: o_orderkey
             shardingAlgorithmName: orders-database-inline
         tableStrategy:
           standard:
             shardingColumn: o_custkey
             shardingAlgorithmName: orders-table-inline
       part:
         actualDataNodes: ds_${0..1}.part_${0..1}
         databaseStrategy:
           standard:
             shardingColumn: p_partkey
             shardingAlgorithmName: part-database-inline
         tableStrategy:
           standard:
             shardingColumn: p_size
             shardingAlgorithmName: part-table-inline
       partsupp:
         actualDataNodes: ds_${0..1}.partsupp_${0..1}
         databaseStrategy:
           standard:
             shardingColumn: ps_partkey
             shardingAlgorithmName: partsupp-database-inline
         tableStrategy:
           standard:
             shardingColumn: ps_suppkey
             shardingAlgorithmName: partsupp-table-inline
       region:
         actualDataNodes: ds_${0..1}.region
         databaseStrategy:
           standard:
             shardingColumn: r_regionkey
             shardingAlgorithmName: region-database-inline
       supplier:
         actualDataNodes: ds_${0..1}.supplier_${0..1}
         databaseStrategy:
           standard:
             shardingColumn: s_suppkey
             shardingAlgorithmName: supplier-database-inline
         tableStrategy:
           standard:
             shardingColumn: s_nationkey
             shardingAlgorithmName: supplier-table-inline
     defaultDatabaseStrategy:
       none:
     defaultTableStrategy:
       none:
   
     shardingAlgorithms:
       lineitem-database-inline:
         type: INLINE
         props:
           algorithm-expression: ds_${l_partkey % 2}
       lineitem-table-inline:
         type: INLINE
         props:
           algorithm-expression: lineitem_${l_orderkey % 2}
       customer-database-inline:
         type: INLINE
         props:
           algorithm-expression: ds_${c_custkey % 2}
       customer-table-inline:
         type: INLINE
         props:
           algorithm-expression: customer_${c_nationkey % 2}
       nation-database-inline:
         type: INLINE
         props:
           algorithm-expression: ds_${n_nationkey % 2}
       nation-table-inline:
         type: INLINE
         props:
           algorithm-expression: nation_${n_regionkey % 2}
       orders-database-inline:
         type: INLINE
         props:
           algorithm-expression: ds_${o_orderkey % 2}
       orders-table-inline:
         type: INLINE
         props:
           algorithm-expression: orders_${o_custkey % 2}
       part-database-inline:
         type: INLINE
         props:
           algorithm-expression: ds_${p_partkey % 2}
       part-table-inline:
         type: INLINE
         props:
           algorithm-expression: part_${p_size % 2}
       partsupp-database-inline:
         type: INLINE
         props:
           algorithm-expression: ds_${ps_partkey % 2}
       partsupp-table-inline:
         type: INLINE
         props:
           algorithm-expression: partsupp_${ps_suppkey % 2}
       region-database-inline:
         type: INLINE
         props:
           algorithm-expression: ds_${r_regionkey % 2}
       supplier-database-inline:
         type: INLINE
         props:
           algorithm-expression: ds_${s_suppkey % 2}
       supplier-table-inline:
         type: INLINE
         props:
           algorithm-expression: supplier_${s_nationkey % 2}
   schemaName: tpch_db_2
   ```
   


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