terrymanu commented on a change in pull request #4477: Parse mysql variable 
value for SET statement
URL: 
https://github.com/apache/incubator-shardingsphere/pull/4477#discussion_r386194675
 
 

 ##########
 File path: 
shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDALVisitor.java
 ##########
 @@ -33,26 +42,50 @@
  * DAL visitor for PostgreSQL.
  */
 public final class PostgreSQLDALVisitor extends PostgreSQLVisitor implements 
DALVisitor {
-    
+
     @Override
     public ASTNode visitShow(final ShowContext ctx) {
         return new ShowStatement();
     }
-    
+
     @Override
-    public ASTNode visitSet(final SetContext ctx) {
+    public ASTNode visitSetVariable(final SetVariableContext ctx) {
         SetStatement result = new SetStatement();
-        if (null != ctx.configurationParameterClause()) {
-            result.setVariable((VariableSegment) 
visit(ctx.configurationParameterClause()));
+        if (null != ctx.variableExpr()) {
+            List<VariableExpr> variableExprList = new 
ArrayList<VariableExpr>(1);
 
 Review comment:
   If the size of ArrayList is 1, why we need create a list?
   How about return the element directly?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to