Forum: Building VoltDB Applications

Post: The query result is not complete

The query result is not complete
guotong1988
Aug 14, 2015
I run voltDB in Eclipse in this way:

	public static void main(String[] args) throws IOException {

		String simpleSchema = "CREATE TABLE testtable0 (id integer not null primary key," + "name0 varchar(100));"
				+ "partition table testtable0 on column id;";

		VoltProjectBuilder builder = new VoltProjectBuilder();
		builder.addLiteralSchema(simpleSchema);

		LocalCluster cluster = new LocalCluster("crash.jar", 1, 2, 0, BackendTarget.HSQLDB_BACKEND);
		cluster.setHasLocalServer(true);
		boolean success = cluster.compile(builder);
		assert(success);
		cluster.startUp(true);

	}



I use sqlcmd to insert some data:


 ./sqlcmd --port=21312



1> insert into testtable0 values(1,'aaaa');
(Returned 1 rows in 0.25s)
2> insert into testtable0 values(2,'aaaa');
(Returned 1 rows in 0.06s)
3> insert into testtable0 values(3,'aaaa');
(Returned 1 rows in 0.00s)
4> insert into testtable0 values(4,'aaaa');
(Returned 1 rows in 0.00s)
5> insert into testtable0 values(-2,'aaaa');
(Returned 1 rows in 0.00s)
6> insert into testtable0 values(-4,'aaaa');




But when I query:

7> select * from testtable0 order by id
8> ;
ID  NAME0 
--- ------
 -2 aaaa  
  1 aaaa  
  3 aaaa  

(Returned 3 rows in 0.13s)
9> select * from testtable0 ;
ID  NAME0 
--- ------
 -2 aaaa  
  1 aaaa  
  3 aaaa 
(Returned 3 rows in 0.01s)
 
I connect to the peer host, it also return the same result
guotong1988
Aug 14, 2015

./sqlcmd --port=21313

1> select * from testtable0;
ID  NAME0 
--- ------
 -2 aaaa  
  1 aaaa  
  3 aaaa  
guotong1988
Aug 17, 2015
someone help...
jhugg
Aug 17, 2015
You're using BackendTarget.HSQLDB_BACKEND. That's something we use for internal testing, and not designed to work with more than one partition. Either run with a single partition, or switch to the native backend.