class ROdps {

  public List<String> runSqlTask(String sql) throws ROdpsException {

    // If the client forget to end with a semi-colon, append it.
    if (!sql.contains(";")) {
      sql += ";";
    }

    LOG.debug("sql: " + sql);

    try {
      Instance instance = SQLTask.run(odps, odps.getDefaultProject(), sql, "rodps_sql_task", settings, null);
      LogView logView = new LogView(odps);
      if (LOGVIEW_HOST != null) {
        logView.setLogViewHost(LOGVIEW_HOST);
      }
      String logViewUrl = logView.generateLogView(instance, 7 * 24);
      System.err.println(logViewUrl);
      LOG.info(logViewUrl);
      instance.waitForSuccess();
      Map<String, String> results = instance.getTaskResults();
      String result = results.get("rodps_sql_task");
      if (result == null||result.isEmpty()) {
        return new ArrayList<String>();
      }
      return Arrays.asList(results.get("rodps_sql_task").split("\n"));
    }

    catch (Exception e) {
      LOG.error("runSqlTask error,sql=" + sql, e);
      throw new ROdpsException(e);
    }
  }

  public  ROdps(String projectName, String accessID, String accessKey, String endPoint,
      String dtEndpoint, String logviewHost, String log4j_properties);

}