Example #1
0
 /**
  * @brief Visit the statement. This is the function that should be called in the first place.
  * @param statement A SQL statement.
  */
 public void visit(Statement statement) throws Exception {
   if (statement instanceof Select) {
     Select select = (Select) statement;
     if (select.getWithItemsList() != null) {
       for (WithItem withItem : ((Select) statement).getWithItemsList()) {
         withItem.accept(this);
       }
     }
     if (select.getSelectBody() != null) {
       select.getSelectBody().accept(this);
     }
   } else if (statement instanceof DescribeTable) {
     ((DescribeTable) statement).accept(this);
   }
   // TODO: Add more type support here.
 }