Search in sources :

Example 46 with DBManager

use of herddb.core.DBManager in project herddb by diennea.

the class RawSQLTest method simpleSumAvgTest.

@Test
public void simpleSumAvgTest() throws Exception {
    String nodeId = "localhost";
    try (DBManager manager = new DBManager("localhost", new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new MemoryCommitLogManager(), null, null)) {
        manager.start();
        CreateTableSpaceStatement st1 = new CreateTableSpaceStatement("tblspace1", Collections.singleton(nodeId), nodeId, 1, 0, 0);
        manager.executeStatement(st1, StatementEvaluationContext.DEFAULT_EVALUATION_CONTEXT(), TransactionContext.NO_TRANSACTION);
        manager.waitForTablespace("tblspace1", 10000);
        execute(manager, "CREATE TABLE tblspace1.tsql (k1 string primary key,n1 int,s1 string)", Collections.emptyList());
        assertEquals(1, executeUpdate(manager, "INSERT INTO tblspace1.tsql(k1,n1,s1) values(?,?,?)", Arrays.asList("mykey", Integer.valueOf(1), "a")).getUpdateCount());
        assertEquals(1, executeUpdate(manager, "INSERT INTO tblspace1.tsql(k1,n1,s1) values(?,?,?)", Arrays.asList("mykey2", Integer.valueOf(2), "a")).getUpdateCount());
        assertEquals(1, executeUpdate(manager, "INSERT INTO tblspace1.tsql(k1,n1,s1) values(?,?,?)", Arrays.asList("mykey3", Integer.valueOf(5), "b")).getUpdateCount());
        assertEquals(1, executeUpdate(manager, "INSERT INTO tblspace1.tsql(k1) values(?)", Arrays.asList("mykey4")).getUpdateCount());
        try (DataScanner scan1 = scan(manager, "SELECT SUM(n1) as cc FROM tblspace1.tsql", Collections.emptyList())) {
            List<DataAccessor> result = scan1.consume();
            assertEquals(1, result.size());
            assertEquals(Long.valueOf(8), result.get(0).get(0));
            assertEquals(Long.valueOf(8), result.get(0).get("cc"));
        }
        try (DataScanner scan1 = scan(manager, "SELECT AVG(n1) as cc,s1 FROM tblspace1.tsql GROUP BY s1 ORDER BY s1", Collections.emptyList())) {
            List<DataAccessor> result = scan1.consume();
            assertEquals(3, result.size());
            // AVG between integers is an integer, Calcite actually does SUM/COUNT cast to Integer
            // EnumerableProject(CC=[CAST(/(CASE(=($2, 0), null:INTEGER, $1), $2)):INTEGER], S1=[$0]): rowcount = 1.0, cumulative cost = {4.25 rows, 4.0 cpu, 0.0 io}, id = 241
            // EnumerableAggregate(group=[{0}], agg#0=[$SUM0($1)], agg#1=[COUNT($1)]): rowcount = 1.0, cumulative cost = {3.25 rows, 2.0 cpu, 0.0 io}, id = 240
            assertEquals(Integer.valueOf(1), result.get(0).get(0));
            assertEquals(Integer.valueOf(1), result.get(0).get("cc"));
            assertEquals(RawString.of("a"), result.get(0).get(1));
            assertEquals(RawString.of("a"), result.get(0).get("s1"));
            assertEquals(Integer.valueOf(5), result.get(1).get(0));
            assertEquals(Integer.valueOf(5), result.get(1).get("cc"));
            assertEquals(RawString.of("b"), result.get(1).get(1));
            assertEquals(RawString.of("b"), result.get(1).get("s1"));
            assertEquals(Integer.valueOf(0), result.get(2).get(0));
            assertEquals(Integer.valueOf(0), result.get(2).get("cc"));
            assertEquals(null, result.get(2).get(1));
            assertEquals(null, result.get(2).get("s1"));
        }
        try (DataScanner scan1 = scan(manager, "SELECT CAST(AVG(n1) as DOUBLE) as cc,s1 FROM tblspace1.tsql GROUP BY s1 ORDER BY s1", Collections.emptyList())) {
            List<DataAccessor> result = scan1.consume();
            assertEquals(3, result.size());
            // you can require it as DOUBLE, then Calcite uses real AVG aggregator
            // LogicalProject(CC=[CAST($1):DOUBLE], S1=[$0]): rowcount = 1.0, cumulative cost = {10.125 rows, 15.0 cpu, 0.0 io}, id = 254
            // LogicalAggregate(group=[{0}], agg#0=[AVG($1)]): rowcount = 1.0, cumulative cost = {9.125 rows, 13.0 cpu, 0.0 io}, id = 252
            assertEquals(Double.valueOf(1.5), result.get(0).get(0));
            assertEquals(Double.valueOf(1.5), result.get(0).get("cc"));
            assertEquals(RawString.of("a"), result.get(0).get(1));
            assertEquals(RawString.of("a"), result.get(0).get("s1"));
            assertEquals(Double.valueOf(5), result.get(1).get(0));
            assertEquals(Double.valueOf(5), result.get(1).get("cc"));
            assertEquals(RawString.of("b"), result.get(1).get(1));
            assertEquals(RawString.of("b"), result.get(1).get("s1"));
            assertEquals(Double.valueOf(0), result.get(2).get(0));
            assertEquals(Double.valueOf(0), result.get(2).get("cc"));
            assertEquals(null, result.get(2).get(1));
            assertEquals(null, result.get(2).get("s1"));
        }
        try (DataScanner scan1 = scan(manager, "SELECT AVG(n1) as cc FROM tblspace1.tsql ", Collections.emptyList())) {
            // AVG between integers is an integer
            List<DataAccessor> result = scan1.consume();
            assertEquals(1, result.size());
            assertEquals(Integer.valueOf(2), result.get(0).get(0));
            assertEquals(Integer.valueOf(2), result.get(0).get("cc"));
        }
        try (DataScanner scan1 = scan(manager, "SELECT AVG(CAST(n1 as DOUBLE)) as cc FROM tblspace1.tsql ", Collections.emptyList())) {
            List<DataAccessor> result = scan1.consume();
            assertEquals(1, result.size());
            assertEquals(Double.valueOf(2.0), result.get(0).get(0));
            assertEquals(Double.valueOf(2.0), result.get(0).get("cc"));
        }
        try (DataScanner scan1 = scan(manager, "SELECT SUM(n1) as asum,s1 FROM tblspace1.tsql GROUP BY s1 ORDER BY s1", Collections.emptyList())) {
            List<DataAccessor> result = scan1.consume();
            assertEquals(3, result.size());
            assertEquals(Long.valueOf(3), result.get(0).get(0));
            assertEquals(Long.valueOf(3), result.get(0).get("asum"));
            assertEquals(RawString.of("a"), result.get(0).get(1));
            assertEquals(RawString.of("a"), result.get(0).get("s1"));
            assertEquals(Long.valueOf(5), result.get(1).get(0));
            assertEquals(Long.valueOf(5), result.get(1).get("asum"));
            assertEquals(RawString.of("b"), result.get(1).get(1));
            assertEquals(RawString.of("b"), result.get(1).get("s1"));
            assertEquals(Long.valueOf(0), result.get(2).get(0));
            assertEquals(Long.valueOf(0), result.get(2).get("asum"));
            assertEquals(null, result.get(2).get(1));
            assertEquals(null, result.get(2).get("s1"));
        }
        try (DataScanner scan1 = scan(manager, "SELECT SUM(n1) as asum,s1 FROM tblspace1.tsql GROUP BY s1 ORDER BY asum", Collections.emptyList())) {
            List<DataAccessor> result = scan1.consume();
            assertEquals(3, result.size());
            assertEquals(Long.valueOf(0), result.get(0).get(0));
            assertEquals(Long.valueOf(0), result.get(0).get("asum"));
            assertEquals(null, result.get(0).get(1));
            assertEquals(null, result.get(0).get("s1"));
            assertEquals(Long.valueOf(3), result.get(1).get(0));
            assertEquals(Long.valueOf(3), result.get(1).get("asum"));
            assertEquals(RawString.of("a"), result.get(1).get(1));
            assertEquals(RawString.of("a"), result.get(1).get("s1"));
            assertEquals(Long.valueOf(5), result.get(2).get(0));
            assertEquals(Long.valueOf(5), result.get(2).get("asum"));
            assertEquals(RawString.of("b"), result.get(2).get(1));
            assertEquals(RawString.of("b"), result.get(2).get("s1"));
        }
        // test "modulo" operator
        try (DataScanner scan1 = scan(manager, "SELECT n1 % 4 as cc FROM tblspace1.tsql where n1 % 4 = 1 and k1='mykey3'", Collections.emptyList())) {
            List<DataAccessor> result = scan1.consume();
            assertEquals(1, result.size());
            assertEquals(Long.valueOf(1), result.get(0).get(0));
            assertEquals(Long.valueOf(1), result.get(0).get("cc"));
        }
        if (manager.isFullSQLSupportEnabled()) {
            try (DataScanner scan1 = scan(manager, "SELECT SUM(1) as cc FROM tblspace1.tsql", Collections.emptyList())) {
                List<DataAccessor> result = scan1.consume();
                assertEquals(1, result.size());
                assertEquals(Long.valueOf(4), result.get(0).get(0));
                assertEquals(Long.valueOf(4), result.get(0).get("cc"));
            }
        }
    }
}
Also used : CreateTableSpaceStatement(herddb.model.commands.CreateTableSpaceStatement) DBManager(herddb.core.DBManager) DataScanner(herddb.model.DataScanner) MemoryDataStorageManager(herddb.mem.MemoryDataStorageManager) RuntimeProjectedDataAccessor(herddb.model.planner.ProjectOp.ZeroCopyProjection.RuntimeProjectedDataAccessor) DataAccessor(herddb.utils.DataAccessor) MemoryCommitLogManager(herddb.mem.MemoryCommitLogManager) RawString(herddb.utils.RawString) MemoryMetadataStorageManager(herddb.mem.MemoryMetadataStorageManager) Test(org.junit.Test)

Example 47 with DBManager

use of herddb.core.DBManager in project herddb by diennea.

the class SimpleScanZeroCopyTest method testPkNotFirst.

@Test
public void testPkNotFirst() throws Exception {
    String nodeId = "localhost";
    try (DBManager manager = new DBManager("localhost", new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new MemoryCommitLogManager(), null, null)) {
        manager.start();
        CreateTableSpaceStatement st1 = new CreateTableSpaceStatement("tblspace1", Collections.singleton(nodeId), nodeId, 1, 0, 0);
        manager.executeStatement(st1, StatementEvaluationContext.DEFAULT_EVALUATION_CONTEXT(), TransactionContext.NO_TRANSACTION);
        manager.waitForTablespace("tblspace1", 10000);
        execute(manager, "CREATE TABLE tblspace1.tsql (n1 int,k1 string primary key, s1 string)", Collections.emptyList());
        execute(manager, "INSERT INTO tblspace1.tsql (k1,n1 ,s1) values (?,?,?)", Arrays.asList("a", 1, "b"));
        try (DataScanner scan = TestUtils.scan(manager, "SELECT * FROM tblspace1.tsql ", Collections.emptyList())) {
            List<DataAccessor> data = scan.consume();
            assertEquals(1, data.size());
            // read from the full record
            assertTrue(data.get(0) instanceof DataAccessorForFullRecord);
            assertEquals(1, data.get(0).get("n1"));
            assertEquals(1, data.get(0).get(0));
            assertEquals(RawString.of("a"), data.get(0).get("k1"));
            assertEquals(RawString.of("a"), data.get(0).get(1));
            assertEquals(RawString.of("b"), data.get(0).get("s1"));
            assertEquals(RawString.of("b"), data.get(0).get(2));
            String[] fieldNames = scan.getFieldNames();
            for (String fName : fieldNames) {
                Object value = data.get(0).get(fName);
                System.out.println("FIELD " + fName + " -> " + value + " (" + value.getClass() + ")");
            }
            IntHolder current = new IntHolder();
            data.get(0).forEach((fName, value) -> {
                System.out.println("FIELD2 " + fName + " -> " + value + " (" + value.getClass() + ")");
                assertEquals(fName, fieldNames[current.value++]);
            });
        }
        try (DataScanner scan = TestUtils.scan(manager, "SELECT k1 FROM tblspace1.tsql ", Collections.emptyList())) {
            List<DataAccessor> data = scan.consume();
            assertEquals(1, data.size());
            // read from the full record, keeping only some field
            assertTrue(data.get(0) instanceof ProjectedDataAccessor || data.get(0) instanceof ZeroCopyProjection.RuntimeProjectedDataAccessor);
            assertEquals(RawString.of("a"), data.get(0).get("k1"));
            assertEquals(RawString.of("a"), data.get(0).get(0));
            String[] fieldNames = scan.getFieldNames();
            for (String fName : fieldNames) {
                Object value = data.get(0).get(fName);
                System.out.println("FIELD " + fName + " -> " + value + " (" + value.getClass() + ")");
            }
            IntHolder current = new IntHolder();
            data.get(0).forEach((fName, value) -> {
                System.out.println("FIELD2 " + fName + " -> " + value + " (" + value.getClass() + ")");
                assertEquals(fName, fieldNames[current.value++]);
            });
        }
        try (DataScanner scan = TestUtils.scan(manager, "SELECT COUNT(*) FROM tblspace1.tsql ", Collections.emptyList())) {
            List<DataAccessor> data = scan.consume();
            assertEquals(1, data.size());
            assertTrue(data.get(0) instanceof Tuple);
        }
    }
}
Also used : MemoryDataStorageManager(herddb.mem.MemoryDataStorageManager) DataAccessor(herddb.utils.DataAccessor) ProjectedDataAccessor(herddb.utils.ProjectedDataAccessor) RawString(herddb.utils.RawString) ProjectedDataAccessor(herddb.utils.ProjectedDataAccessor) CreateTableSpaceStatement(herddb.model.commands.CreateTableSpaceStatement) DBManager(herddb.core.DBManager) DataScanner(herddb.model.DataScanner) MemoryCommitLogManager(herddb.mem.MemoryCommitLogManager) IntHolder(herddb.utils.IntHolder) DataAccessorForFullRecord(herddb.codec.DataAccessorForFullRecord) Tuple(herddb.model.Tuple) MemoryMetadataStorageManager(herddb.mem.MemoryMetadataStorageManager) Test(org.junit.Test)

Example 48 with DBManager

use of herddb.core.DBManager in project herddb by diennea.

the class SimpleScanZeroCopyTest method testMultiPkFirst.

@Test
public void testMultiPkFirst() throws Exception {
    String nodeId = "localhost";
    try (DBManager manager = new DBManager("localhost", new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new MemoryCommitLogManager(), null, null)) {
        manager.start();
        CreateTableSpaceStatement st1 = new CreateTableSpaceStatement("tblspace1", Collections.singleton(nodeId), nodeId, 1, 0, 0);
        manager.executeStatement(st1, StatementEvaluationContext.DEFAULT_EVALUATION_CONTEXT(), TransactionContext.NO_TRANSACTION);
        manager.waitForTablespace("tblspace1", 10000);
        execute(manager, "CREATE TABLE tblspace1.tsql (n1 int primary key,k1 string primary key, s1 string)", Collections.emptyList());
        execute(manager, "INSERT INTO tblspace1.tsql (k1,n1 ,s1) values (?,?,?)", Arrays.asList("a", 1, "b"));
        try (DataScanner scan = TestUtils.scan(manager, "SELECT * FROM tblspace1.tsql ", Collections.emptyList())) {
            List<DataAccessor> data = scan.consume();
            assertEquals(1, data.size());
            // read from the full record
            assertTrue(data.get(0) instanceof DataAccessorForFullRecord);
            assertEquals(1, data.get(0).get("n1"));
            assertEquals(1, data.get(0).get(0));
            assertEquals(RawString.of("a"), data.get(0).get("k1"));
            assertEquals(RawString.of("a"), data.get(0).get(1));
            assertEquals(RawString.of("b"), data.get(0).get("s1"));
            assertEquals(RawString.of("b"), data.get(0).get(2));
            String[] fieldNames = scan.getFieldNames();
            for (String fName : fieldNames) {
                Object value = data.get(0).get(fName);
                System.out.println("FIELD " + fName + " -> " + value + " (" + value.getClass() + ")");
            }
            IntHolder current = new IntHolder();
            data.get(0).forEach((fName, value) -> {
                System.out.println("FIELD2 " + fName + " -> " + value + " (" + value.getClass() + ")");
                assertEquals(fName, fieldNames[current.value++]);
            });
        }
        try (DataScanner scan = TestUtils.scan(manager, "SELECT k1 FROM tblspace1.tsql ", Collections.emptyList())) {
            List<DataAccessor> data = scan.consume();
            assertEquals(1, data.size());
            // read from the full record, keeping only some field
            assertTrue(data.get(0) instanceof ProjectedDataAccessor || data.get(0) instanceof ZeroCopyProjection.RuntimeProjectedDataAccessor);
            assertEquals(RawString.of("a"), data.get(0).get("k1"));
            assertEquals(RawString.of("a"), data.get(0).get(0));
            String[] fieldNames = scan.getFieldNames();
            for (String fName : fieldNames) {
                Object value = data.get(0).get(fName);
                System.out.println("FIELD " + fName + " -> " + value + " (" + value.getClass() + ")");
            }
            IntHolder current = new IntHolder();
            data.get(0).forEach((fName, value) -> {
                System.out.println("FIELD2 " + fName + " -> " + value + " (" + value.getClass() + ")");
                assertEquals(fName, fieldNames[current.value++]);
            });
        }
        try (DataScanner scan = TestUtils.scan(manager, "SELECT COUNT(*) FROM tblspace1.tsql ", Collections.emptyList())) {
            List<DataAccessor> data = scan.consume();
            assertEquals(1, data.size());
            assertTrue(data.get(0) instanceof Tuple);
        }
    }
}
Also used : MemoryDataStorageManager(herddb.mem.MemoryDataStorageManager) DataAccessor(herddb.utils.DataAccessor) ProjectedDataAccessor(herddb.utils.ProjectedDataAccessor) RawString(herddb.utils.RawString) ProjectedDataAccessor(herddb.utils.ProjectedDataAccessor) CreateTableSpaceStatement(herddb.model.commands.CreateTableSpaceStatement) DBManager(herddb.core.DBManager) DataScanner(herddb.model.DataScanner) MemoryCommitLogManager(herddb.mem.MemoryCommitLogManager) IntHolder(herddb.utils.IntHolder) DataAccessorForFullRecord(herddb.codec.DataAccessorForFullRecord) Tuple(herddb.model.Tuple) MemoryMetadataStorageManager(herddb.mem.MemoryMetadataStorageManager) Test(org.junit.Test)

Example 49 with DBManager

use of herddb.core.DBManager in project herddb by diennea.

the class SimplerPlannerTest method plannerUpdateTest.

@Test
public void plannerUpdateTest() throws Exception {
    String nodeId = "localhost";
    try (DBManager manager = new DBManager("localhost", new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new MemoryCommitLogManager(), null, null)) {
        manager.start();
        CreateTableSpaceStatement st1 = new CreateTableSpaceStatement("tblspace1", Collections.singleton(nodeId), nodeId, 1, 0, 0);
        manager.executeStatement(st1, StatementEvaluationContext.DEFAULT_EVALUATION_CONTEXT(), TransactionContext.NO_TRANSACTION);
        manager.waitForTablespace("tblspace1", 10000);
        execute(manager, "CREATE TABLE tblspace1.tsql (k1 string primary key,n1 int,s1 string)", Collections.emptyList());
        assertEquals(1, executeUpdate(manager, "INSERT INTO tblspace1.tsql(k1,n1) values(?,?)", Arrays.asList("mykey", Integer.valueOf(1234))).getUpdateCount());
        assertEquals(1, executeUpdate(manager, "UPDATE tblspace1.tsql set n1=1111", Collections.emptyList()).getUpdateCount());
        try (DataScanner scan = scan(manager, "SELECT * FROM tblspace1.tsql where n1=1111", Collections.emptyList())) {
            List<DataAccessor> results = scan.consume();
            assertEquals(1, results.size());
        }
        assertEquals(1, executeUpdate(manager, "UPDATE tblspace1.tsql set n1=1112 where k1='mykey'", Collections.emptyList()).getUpdateCount());
        try (DataScanner scan = scan(manager, "SELECT * FROM tblspace1.tsql where n1=1112", Collections.emptyList())) {
            List<DataAccessor> results = scan.consume();
            assertEquals(1, results.size());
        }
        assertEquals(0, executeUpdate(manager, "UPDATE tblspace1.tsql set n1=1112 where k1='no'", Collections.emptyList()).getUpdateCount());
        assertEquals(1, executeUpdate(manager, "UPDATE tblspace1.tsql set n1=n1+1 where k1='mykey'", Collections.emptyList()).getUpdateCount());
        try (DataScanner scan = scan(manager, "SELECT * FROM tblspace1.tsql where n1=1113", Collections.emptyList())) {
            List<DataAccessor> results = scan.consume();
            assertEquals(1, results.size());
        }
        assertEquals(1, executeUpdate(manager, "UPDATE tblspace1.tsql set n1=? where k1=?", Arrays.asList(1114, "mykey")).getUpdateCount());
        try (DataScanner scan = scan(manager, "SELECT * FROM tblspace1.tsql where n1=1114", Collections.emptyList())) {
            List<DataAccessor> results = scan.consume();
            assertEquals(1, results.size());
        }
    }
}
Also used : CreateTableSpaceStatement(herddb.model.commands.CreateTableSpaceStatement) DBManager(herddb.core.DBManager) DataScanner(herddb.model.DataScanner) MemoryDataStorageManager(herddb.mem.MemoryDataStorageManager) DataAccessor(herddb.utils.DataAccessor) MemoryCommitLogManager(herddb.mem.MemoryCommitLogManager) RawString(herddb.utils.RawString) MemoryMetadataStorageManager(herddb.mem.MemoryMetadataStorageManager) Test(org.junit.Test)

Example 50 with DBManager

use of herddb.core.DBManager in project herddb by diennea.

the class TruncateTableSQLTest method truncateTableTransactionTest.

@Test
public void truncateTableTransactionTest() throws Exception {
    String nodeId = "localhost";
    try (DBManager manager = new DBManager("localhost", new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new MemoryCommitLogManager(), null, null)) {
        manager.start();
        CreateTableSpaceStatement st1 = new CreateTableSpaceStatement("tblspace1", Collections.singleton(nodeId), nodeId, 1, 0, 0);
        manager.executeStatement(st1, StatementEvaluationContext.DEFAULT_EVALUATION_CONTEXT(), TransactionContext.NO_TRANSACTION);
        manager.waitForTablespace("tblspace1", 10000);
        execute(manager, "CREATE TABLE tblspace1.tsql (k1 string primary key,n1 int,s1 string)", Collections.emptyList());
        execute(manager, "CREATE BRIN INDEX test1 ON tblspace1.tsql (k1)", Collections.emptyList());
        execute(manager, "CREATE HASH INDEX test2 ON tblspace1.tsql (k1)", Collections.emptyList());
        long tx1 = TestUtils.beginTransaction(manager, "tblspace1");
        try {
            // forbidden, transactions not allowed
            execute(manager, "truncate TABLE tblspace1.tsql", Collections.emptyList(), new TransactionContext(tx1));
            fail();
        } catch (StatementExecutionException ok) {
            assertEquals("TRUNCATE TABLE cannot be executed within the context of a Transaction", ok.getMessage());
        }
        long txId = execute(manager, "INSERT INTO tblspace1.tsql (k1) values('a')", Collections.emptyList(), TransactionContext.AUTOTRANSACTION_TRANSACTION).transactionId;
        try (DataScanner scan = scan(manager, "SELECT * FROM tblspace1.tsql ", Collections.emptyList(), new TransactionContext(txId))) {
            assertEquals(1, scan.consume().size());
        }
        try {
            // forbidden, a transaction is running on table
            execute(manager, "TRUNCATE TABLE tblspace1.tsql", Collections.emptyList(), TransactionContext.NO_TRANSACTION);
            fail();
        } catch (StatementExecutionException ok) {
            assertEquals("TRUNCATE TABLE cannot be executed table tblspace1.tsql: at least one transaction is pending on it", ok.getCause().getMessage());
        }
        TestUtils.commitTransaction(manager, "tblspace1", txId);
        execute(manager, "TRUNCATE TABLE tblspace1.tsql", Collections.emptyList(), TransactionContext.NO_TRANSACTION);
        try (DataScanner scan = scan(manager, "SELECT * FROM tblspace1.tsql ", Collections.emptyList())) {
            assertEquals(0, scan.consume().size());
        }
    }
}
Also used : CreateTableSpaceStatement(herddb.model.commands.CreateTableSpaceStatement) DBManager(herddb.core.DBManager) DataScanner(herddb.model.DataScanner) MemoryDataStorageManager(herddb.mem.MemoryDataStorageManager) TransactionContext(herddb.model.TransactionContext) MemoryCommitLogManager(herddb.mem.MemoryCommitLogManager) StatementExecutionException(herddb.model.StatementExecutionException) MemoryMetadataStorageManager(herddb.mem.MemoryMetadataStorageManager) Test(org.junit.Test)

Aggregations

DBManager (herddb.core.DBManager)153 Test (org.junit.Test)143 MemoryCommitLogManager (herddb.mem.MemoryCommitLogManager)133 MemoryMetadataStorageManager (herddb.mem.MemoryMetadataStorageManager)133 MemoryDataStorageManager (herddb.mem.MemoryDataStorageManager)132 CreateTableSpaceStatement (herddb.model.commands.CreateTableSpaceStatement)126 DataScanner (herddb.model.DataScanner)92 RawString (herddb.utils.RawString)82 Table (herddb.model.Table)53 DataAccessor (herddb.utils.DataAccessor)53 CreateTableStatement (herddb.model.commands.CreateTableStatement)34 ScanStatement (herddb.model.commands.ScanStatement)34 RuntimeProjectedDataAccessor (herddb.model.planner.ProjectOp.ZeroCopyProjection.RuntimeProjectedDataAccessor)28 List (java.util.List)28 TransactionContext (herddb.model.TransactionContext)27 Index (herddb.model.Index)25 TranslatedQuery (herddb.sql.TranslatedQuery)23 CreateIndexStatement (herddb.model.commands.CreateIndexStatement)21 SecondaryIndexSeek (herddb.index.SecondaryIndexSeek)18 Timestamp (java.sql.Timestamp)15