Package org.apache.hadoop.hbase.hbql.client

Examples of org.apache.hadoop.hbase.hbql.client.HBqlException


    }

    @Test
    public void testInvalidPredicate1() throws HBqlException {

        HBqlException hBqlException = null;
        try {
            connection.execute("DROP TABLE nosuchtable IF tableexists(nosuchtable)");
        }
        catch (HBqlException e) {
            e.printStackTrace();
View Full Code Here


    }

    @Test
    public void testInvalidPredicate2() throws HBqlException {

        HBqlException hBqlException = null;
        try {
            connection.execute("DROP TABLE nosuchtable IF tableexists(3)");
        }
        catch (HBqlException e) {
            e.printStackTrace();
View Full Code Here

            return expressionTree;
        }
        catch (RecognitionException e) {
            e.printStackTrace();
            throw new HBqlException("Error parsing: " + str);
        }
    }
View Full Code Here

                                                                                    ResultMissingColumnException,
                                                                                    NullColumnValueException {
        final String val = (String)this.getExprArg(0).getValue(conn, object);

        if (val == null)
            throw new HBqlException("Null string for value in " + this.asString());

        final boolean patternConstant = this.getExprArg(1).isAConstant();

        if (!patternConstant || this.getPattern() == null) {

            final String pvalue = (String)this.getExprArg(1).getValue(conn, object);

            if (pvalue == null)
                throw new HBqlException("Null string for pattern in " + this.asString());

            this.pattern = Pattern.compile(pvalue);
        }

        final Matcher m = this.getPattern().matcher(val);
View Full Code Here

        final String val0 = (String)this.getExprArg(0).getValue(conn, object);
        final String val1 = (String)this.getExprArg(1).getValue(conn, object);

        if (val0 == null)
            throw new HBqlException("Null string for value in " + this.asString());

        if (val1 == null)
            throw new HBqlException("Null string for pattern in " + this.asString());

        final boolean retval = val0.contains(val1);

        return (this.isNot()) ? !retval : retval;
    }
View Full Code Here

    }

    private FamilyProperty validateProperty(final FamilyProperty assignee,
                                            final FamilyProperty value) throws HBqlException {
        if (assignee != null)
            throw new HBqlException("Multiple " + value.getPropertyType().getDescription()
                                    + " values for " + this.getFamilyName() + " not allowed");
        return value;
    }
View Full Code Here

            try {
                this.setMapping(conn.getMapping(this.getMappingName()));
            }
            catch (HBqlException e) {
                e.printStackTrace();
                throw new HBqlException("Unknown mapping name: " + this.getMappingName());
            }
        }

        this.validateMatchingNames(this.getResultAccessor());
    }
View Full Code Here

    private void validateMatchingNames(final ResultAccessor accessor) throws HBqlException {
        if (accessor != null && accessor instanceof AnnotationResultAccessor) {
            final String mappingName = accessor.getMapping().getMappingName();
            final String selectName = this.getMapping().getMappingName();
            if (!mappingName.equals(selectName))
                throw new HBqlException("Class " + mappingName + " instead of " + selectName);
        }
    }
View Full Code Here

        final String annoname = "@ColumnVersionMap annotation";

        // Check if type is a Map
        if (!TypeSupport.isParentClass(Map.class, field.getType()))
            throw new HBqlException(getObjectQualifiedName(field) + "has a " + annoname + " so it "
                                    + "must implement the Map interface");

        // Look up type of map value
        final ParameterizedType ptype = (ParameterizedType)field.getGenericType();
        final Type[] typeargs = ptype.getActualTypeArguments();
View Full Code Here

        // Make sure there is an empty constructor declared
        try {
            this.getClazz().getConstructor();
        }
        catch (NoSuchMethodException e) {
            throw new HBqlException("Class " + this + " is missing a null constructor");
        }

        for (final Field field : clazz.getDeclaredFields()) {
            if (field.getAnnotation(Column.class) != null)
                this.processColumnAnnotation(field);

            if (field.getAnnotation(ColumnVersionMap.class) != null)
                this.processColumnVersionAnnotation(field);
        }

        if (!this.getColumnMap().containsKey(this.getKeyAttrib().getFamilyQualifiedName()))
            throw new HBqlException(this.getClazz().getName() + " must contain a mapping to key attribute "
                                    + this.getKeyAttrib().getFamilyQualifiedName());
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.hbql.client.HBqlException

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.