boolean executeStatement(TerminalSession session, String statement, int lineNo) {
      executionResult.appendLog(" ");
      executionResult.appendLog("prepare execute statement, line:" + lineNo);
      executionResult.appendLog(statement);

      TerminalSession.ResultSet rs = null;
      long begin = System.currentTimeMillis();
      try {
        rs = session.executeStatement(catalog, statement);
        executionResult.appendLogs(session.logs());
      } catch (Throwable t) {
        executionResult.appendLogs(session.logs());
        executionResult.appendLog("meet exception during execution.");
        executionResult.appendLog(getStackTraceAsString(t));
        return false;
      }

      if (rs.empty()) {
        long cost = System.currentTimeMillis() - begin;
        executionResult.appendLog(
            "statement execute down, result is empty, execution cost: " + cost + "ms");
        return true;
      } else {
        StatementResult sr = fetchResults(rs, statement, lineNo);
        long cost = System.currentTimeMillis() - begin;
        executionResult.appendResult(sr);
        executionResult.appendLog(
            "statement execute down, fetch rows:"
                + sr.getDatas().size()
                + ", execution cost: "
                + cost
                + "ms");
        return sr.isSuccess();
      }
    }
@return - false if any exception happened.
amoro-ams/src/main/java/org/apache/amoro/server/terminal/TerminalSessionContext.java