cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wangpei (Peter)" <>
Subject Re: result of get_indexed_slices() seems wrong
Date Thu, 24 Mar 2011 11:03:39 GMT
Thanks aaron.
Maybe we need to do more check at ThriftValidation.validateIndexClauses(), add this:
        Map<ByteBuffer, ColumnDefinition> colDefs = DatabaseDescriptor.getTableDefinition(keyspace).cfMetaData().get(columnFamily).getColumn_metadata();
        for (IndexExpression expression : index_clause.expressions)
            if (!colDefs.containsKey(expression.column_name))
                throw new InvalidRequestException("No column definition for " + expression.column_name);

发件人: aaron morton []
发送时间: 2011年3月24日 12:24
主题: Re: result of get_indexed_slices() seems wrong

Looks like this

From this discussion


On 24 Mar 2011, at 17:17, Wangpei (Peter) wrote:


This problem occurs when the clause has multi expression and a expression with operator other
than EQ.
Is anyone meet the same problem?

I trace the code, and seen this at ColumnFamilyStore.satisfies() method:
            int v = data.getComparator().compare(column.value(), expression.value);
It seems when I need the type of column value here, it use the type of my column names which
is UTF8Type, so give the wrong result.
To fix it, the expression needs a optional “comparator_type” attribute, then satisfies()
can get the correct type to compare.
pls point out if I am wrong.

View raw message