use of org.apache.cassandra.cql3.QueryProcessor.executeInternal in project cassandra by apache.
the class TriggersTest method assertUpdateIsAugmented.
private void assertUpdateIsAugmented(int key) {
UntypedResultSet rs = QueryProcessor.executeInternal(String.format("SELECT * FROM %s.%s WHERE k=%s", ksName, cfName, key));
assertTrue(String.format("Expected value (%s) for augmented cell v2 was not found", key), rs.one().has("v2"));
assertEquals(999, rs.one().getInt("v2"));
}
use of org.apache.cassandra.cql3.QueryProcessor.executeInternal in project cassandra by apache.
the class TriggersTest method assertUpdateNotExecuted.
private void assertUpdateNotExecuted(String cf, int key) {
UntypedResultSet rs = QueryProcessor.executeInternal(String.format("SELECT * FROM %s.%s WHERE k=%s", ksName, cf, key));
assertTrue(rs.isEmpty());
}
use of org.apache.cassandra.cql3.QueryProcessor.executeInternal in project cassandra by apache.
the class LegacySSTableTest method readSimpleCounterTable.
private static void readSimpleCounterTable(String legacyVersion, String compactSuffix, String pkValue) {
logger.debug("Read legacy_{}_simple_counter{}", legacyVersion, compactSuffix);
UntypedResultSet rs;
rs = QueryProcessor.executeInternal(String.format("SELECT val FROM legacy_tables.legacy_%s_simple_counter%s WHERE pk=?", legacyVersion, compactSuffix), pkValue);
Assert.assertNotNull(rs);
Assert.assertEquals(1, rs.size());
Assert.assertEquals(1L, rs.one().getLong("val"));
}
use of org.apache.cassandra.cql3.QueryProcessor.executeInternal in project cassandra by apache.
the class LegacySSTableTest method readClusteringCounterTable.
private static void readClusteringCounterTable(String legacyVersion, String compactSuffix, String ckValue, String pkValue) {
logger.debug("Read legacy_{}_clust_counter{}", legacyVersion, compactSuffix);
UntypedResultSet rs;
rs = QueryProcessor.executeInternal(String.format("SELECT val FROM legacy_tables.legacy_%s_clust_counter%s WHERE pk=? AND ck=?", legacyVersion, compactSuffix), pkValue, ckValue);
Assert.assertNotNull(rs);
Assert.assertEquals(1, rs.size());
Assert.assertEquals(1L, rs.one().getLong("val"));
}
use of org.apache.cassandra.cql3.QueryProcessor.executeInternal in project cassandra by apache.
the class LegacySSTableTest method readClusteringTable.
private static void readClusteringTable(String legacyVersion, String compactSuffix, int ck, String ckValue, String pkValue) {
logger.debug("Read legacy_{}_clust{}", legacyVersion, compactSuffix);
UntypedResultSet rs;
rs = QueryProcessor.executeInternal(String.format("SELECT val FROM legacy_tables.legacy_%s_clust%s WHERE pk=? AND ck=?", legacyVersion, compactSuffix), pkValue, ckValue);
assertLegacyClustRows(1, rs);
String ckValue2 = Integer.toString(ck < 10 ? 40 : ck - 1) + longString;
String ckValue3 = Integer.toString(ck > 39 ? 10 : ck + 1) + longString;
rs = QueryProcessor.executeInternal(String.format("SELECT val FROM legacy_tables.legacy_%s_clust%s WHERE pk=? AND ck IN (?, ?, ?)", legacyVersion, compactSuffix), pkValue, ckValue, ckValue2, ckValue3);
assertLegacyClustRows(3, rs);
}
Aggregations