cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ZhaoYang (JIRA)" <>
Subject [jira] [Created] (CASSANDRA-14100) proper value skipping when only pk columns are selected
Date Thu, 07 Dec 2017 02:10:00 GMT
ZhaoYang created CASSANDRA-14100:

             Summary: proper value skipping when only pk columns are selected
                 Key: CASSANDRA-14100
             Project: Cassandra
          Issue Type: Bug
          Components: Local Write-Read Paths
            Reporter: ZhaoYang
            Priority: Minor
             Fix For: 4.x

In CASSANDRA-10657, value skipping is re-enabled to avoid reading unselected columns from
disk to reduce heap pressure.

In 3.11, ColumnFilter.builder#addAll() will initialize {{queriedBuilder}} as {{empty}} even
if the parameter is empty list.

In trunk, CASSANDRA-7396 made some changes on ColumnFilter.builder#addAll() that ColumnFilter-queried
will no longer be {{empty}} when no regular column is selected, it's now {{null}} instead.

There is subtle difference between {{empty}} and {{null}} in ColumnFilter.

So {{ColumnFilter.fetchedColumnIsQueried}} will return true and  {{SerializationHeader.canSkipValue()}}
will return {{false}} in trunk.

Probably we need to refactor ColumnFilter...

// passed on 3.11, failed on trunk
createTable("CREATE TABLE %s (k1 int, v1 int, v2 int, PRIMARY KEY (k1))");
execute("INSERT INTO %s(k1,v1,v2) VALUES(1,1,1)  USING TIMESTAMP 5");

Prepared prepared = QueryProcessor.prepareInternal("SELECT k1 FROM " + keyspace() + "." +
currentTable() + " WHERE k1=1");
CQLStatement cqlStatement = prepared.statement;
SelectStatement selectStatement = (SelectStatement) cqlStatement;
ColumnFilter columnFilter = selectStatement.queriedColumns();

// v1/v2 are fetched but not queried, so no need to read them from disk in Cell.Serializer#deserialize()
by checking
// SerializationHeader.canSkipValue()
assertFalse(columnFilter.fetchedColumnIsQueried(ColumnMetadata.regularColumn(keyspace(), currentTable(),
"v1", Int32Type.instance)));

assertFalse(columnFilter.fetchedColumnIsQueried(ColumnMetadata.regularColumn(keyspace(), currentTable(),
"v2", Int32Type.instance)));

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message