presto-main/src/main/java/io/prestosql/sql/analyzer/StatementAnalyzer.java/Visitor/analyzeLimit
class Visitor:        private boolean analyzeLimit(Limit node)
        {
            if (node.getLimit().equalsIgnoreCase("all")) {
                analysis.setLimit(node, OptionalLong.empty());
            }
            else {
                long rowCount;
                try {
                    rowCount = Long.parseLong(node.getLimit());
                }
                catch (NumberFormatException e) {
                    throw semanticException(TYPE_MISMATCH, node, "Invalid LIMIT row count: %s", node.getLimit());
                }
                if (rowCount < 0) {
                    throw semanticException(NUMERIC_VALUE_OUT_OF_RANGE, node, "LIMIT row count must be greater or equal to 0 (actual value: %s)", rowCount);
                }
                analysis.setLimit(node, rowCount);
            }

            return false;
        }