Package org.apache.hadoop.hbase.hbql.statement

Examples of org.apache.hadoop.hbase.hbql.statement.HBqlStatement


    public static void parseSQL(final String sql, final int reps, final long maxTime) throws HBqlException {

        long start = System.currentTimeMillis();

        for (int i = 0; i < reps; i++) {
            HBqlStatement stmt = Utils.parseHBqlStatement(sql);

            assertTrue(stmt != null);
        }

        long end = System.currentTimeMillis();
View Full Code Here


public class Utils {

    public static HBqlStatement parseHBqlStatement(final String sql) throws HBqlException {

        try {
            final HBqlStatement stmt = ParserUtil.parseHBqlStatement(sql);

            if (!Utils.isSelectStatement(stmt)
                && !(stmt instanceof ConnectionStatement)
                && !(stmt instanceof NonConnectionStatement))
                throw new HBqlException("Unsupported statement type: " + stmt.getClass().getSimpleName() + " - " + sql);

            if (stmt instanceof MappingContext) {
                final MappingContext mappingContext = (MappingContext)stmt;
                mappingContext.setResultAccessor(new HRecordResultAccessor(mappingContext));
            }
View Full Code Here

    }

    public static HBqlStatement parseHBqlStatement(final String sql) throws HBqlException {
        try {
            final HBqlParser parser = ParserUtil.newHBqlParser(sql + ";");
            final HBqlStatement stmt = parser.hbqlStatement();
            stmt.validate();
            return stmt;
        }
        catch (LexerRecognitionException e) {
            throw new ParseException(e.getRecognitionExecption(), sql);
        }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.hbql.statement.HBqlStatement

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.