Package io.crate.exceptions

Examples of io.crate.exceptions.SQLParseException


    protected Symbol visitQuerySpecification(QuerySpecification node, SelectAnalysis context) {
        // visit the from first, since this qualifies the select
        int numTables = node.getFrom() == null ? 0 : node.getFrom().size();
        if (numTables != 1) {
            throw new SQLParseException(
                    "Only exactly one table is allowed in the from clause, got: " + numTables
            );
        }
        process(node.getFrom().get(0), context);
View Full Code Here


            try {
                sSource = XContentHelper.convertToJson(source, false);
            } catch (Throwable e1) {
                // ignore
            }
            throw new SQLParseException("Failed to parse source [" + sSource + "]", e);
        } finally {
            if (parser != null) {
                parser.close();
            }
        }
View Full Code Here

            if (token == XContentParser.Token.FIELD_NAME) {
                String fieldName = parser.currentName();
                parser.nextToken();
                SQLParseElement element = elementParsers.get(fieldName);
                if (element == null) {
                    throw new SQLParseException("No parser for element [" + fieldName + "]");
                }
                element.parse(parser, context);
            } else if (token == null) {
                break;
            }
View Full Code Here

    @Override
    public FacetExecutor parse(String facetName, XContentParser parser,
            SearchContext searchContext) throws IOException {
        Map<String, Object> payload = parser.mapOrderedAndClose();
        if (!payload.containsKey("doc")) {
            throw new SQLParseException("update doc missing");
        }
        Map<String, Object> doc;
        Optional<Long> version;
        try {
            doc = (Map<String, Object>)payload.get("doc");
            Number versionNumber = (Number)payload.get("version");
            if (versionNumber == null) {
                version = Optional.absent();
            } else {
                version = Optional.of(versionNumber.longValue());
            }
        } catch (ClassCastException e) {
            throw new SQLParseException("invalid update doc");
        }
        return new UpdateFacetExecutor(doc, version, searchContext, updateAction);
    }
View Full Code Here

TOP

Related Classes of io.crate.exceptions.SQLParseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.