presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/util/DatabaseUtil.java/DatabaseUtil/isMySQLException
class DatabaseUtil:    private static Predicate<StackTraceElement[]> isMySQLException()
    {
        // check if the exception is a mysql exception by matching the package name in the stack trace
        return s -> Arrays.stream(s)
                .map(StackTraceElement::getClassName)
                .anyMatch(t -> t.startsWith("com.mysql.jdbc."));
    }