public Integer execBoolUnarySql(HplsqlParser.Bool_expr_unaryContext ctx) {
    StringBuilder sql = new StringBuilder();
    if (ctx.T_IS() != null) {
      sql.append(evalPop(ctx.expr(0)).toString());
      sql.append(" " + exec.getText(ctx, ctx.T_IS().getSymbol(), ctx.T_NULL().getSymbol()));
    }    
    else if (ctx.T_BETWEEN() != null) {
      sql.append(evalPop(ctx.expr(0)).toString());
      sql.append(" " + ctx.T_BETWEEN().getText() + " ");
      sql.append(evalPop(ctx.expr(1)).toString());
      sql.append(" " + ctx.T_AND().getText() + " ");
      sql.append(evalPop(ctx.expr(2)).toString());
    }
    else if (ctx.T_EXISTS() != null) {
      exec.append(sql, exec.nvl(ctx.T_NOT(), ctx.T_EXISTS()), ctx.T_OPEN_P());
      exec.append(sql, evalPop(ctx.select_stmt()).toString(), ctx.T_OPEN_P().getSymbol(), ctx.select_stmt().getStart());
      exec.append(sql, ctx.T_CLOSE_P().getText(), ctx.select_stmt().stop, ctx.T_CLOSE_P().getSymbol());
    }
    else if (ctx.bool_expr_single_in() != null) {
      singleInClauseSql(ctx.bool_expr_single_in(), sql);
    }
    else if (ctx.bool_expr_multi_in() != null) {
      multiInClauseSql(ctx.bool_expr_multi_in(), sql);
    }
    exec.stackPush(sql);
    return 0; 
  }
Unary boolean expression in executable SQL statement
hplsql/src/main/java/org/apache/hive/hplsql/Expression.java