class HBaseFilterBuilder implements TreeVisitor {

    private ByteArrayComparable getComparator(int type, OperandNode data) {
        ByteArrayComparable result;
        switch (DataType.get(type)) {
            case TEXT:
                result = new BinaryComparator(Bytes.toBytes(data.toString()));
                break;
            case SMALLINT:
            case INTEGER:
                result = new HBaseIntegerComparator(Long.parseLong(data.toString()));
                break;
            case BIGINT:
            case REAL:

                // Check the operand's original data type
                switch (data.getDataType()) {
                    case BIGINT:
                    case INTEGER:
                    case SMALLINT:
                        result = new HBaseIntegerComparator(Long.parseLong(data.toString()));
                        break;
                    case REAL:
                        result = new HBaseFloatComparator(Float.parseFloat(data.toString()));
                        break;
                    case NUMERIC:
                    case FLOAT8:
                        result = new HBaseDoubleComparator(Double.parseDouble(data.toString()));
                        break;
                    default:
                        result = null;
                        break;
                }
                break;

            case FLOAT8:
                result = new HBaseDoubleComparator(Double.parseDouble(data.toString()));
                break;
            default:
                throw new IllegalArgumentException(String.format("unsupported column type for filtering %d", type));
        }

        return result;
    }

    public  HBaseFilterBuilder(HBaseTupleDescription tupleDescription);

}