@Override
  public int deleteScheduledExecutions(int maxRetainSecs) {
    if (maxRetainSecs < 0) {
      LOG.debug("scheduled executions retention is disabled");
      return 0;
    }
    boolean committed = false;
    Query q = null;
    try {
      openTransaction();
      int maxCreateTime = (int) (System.currentTimeMillis() / 1000) - maxRetainSecs;
      q = pm.newQuery(MScheduledExecution.class);
      q.setFilter("startTime <= maxCreateTime");
      q.declareParameters("int maxCreateTime");
      long deleted = q.deletePersistentAll(maxCreateTime);
      committed = commitTransaction();
      return (int) deleted;
    } finally {
      rollbackAndCleanup(committed, q);
    }
  }
Abbreviates the error message to the given size.

There might be error messages which may also contain a stack trace.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java