@Test
public void testDecimalColumnSlice() throws UnsupportedEncodingException {
if (FactorySingleton.getServerType() == DbTypeEnum.HBASE )
return; // This testcase is not supported for Hbase
NoSqlSession session = mgr.getSession();
String colFamily = "float_indexes";
DboDatabaseMeta meta = mgr.find(DboDatabaseMeta.class, DboDatabaseMeta.META_DB_ROWKEY);
DboTableMeta tableMeta = new DboTableMeta();
tableMeta.setup(null, colFamily, false, false);
tableMeta.setColNameType(double.class);
DboColumnIdMeta idMeta = new DboColumnIdMeta();
idMeta.setup(tableMeta, "id", String.class, false);
mgr.put(idMeta);
mgr.put(tableMeta);
meta.addMetaClassDbo(tableMeta);
mgr.put(meta);
mgr.flush();
byte[] rowKey = StandardConverters.convertToBytes("myone_index");
List<Column> columns = new ArrayList<Column>();
columns.add(new Column(toDecBytes(5000.5), new byte[0]));
columns.add(new Column(toDecBytes(20.333), new byte[0]));
columns.add(new Column(toDecBytes(200.1111111111111), new byte[0]));
columns.add(new Column(toDecBytes(10.9999999999999999999999999), new byte[0]));
columns.add(new Column(toDecBytes(60.5), new byte[0]));
columns.add(new Column(toDecBytes(700), new byte[0]));
columns.add(new Column(toDecBytes(500023432430.44), new byte[0]));
columns.add(new Column(toDecBytes(550.32), new byte[0]));
columns.add(new Column(toDecBytes(340), new byte[0]));
columns.add(new Column(toDecBytes(40.5), new byte[0]));
columns.add(new Column(toDecBytes(-40.8888888888888888), new byte[0]));
columns.add(new Column(toDecBytes(-200.23), new byte[0]));
columns.add(new Column(toDecBytes(-500), new byte[0]));
columns.add(new Column(toDecBytes(new BigDecimal("123000111222333444555666.66666666")), new byte[0]));
columns.add(new Column(toDecBytes(new BigDecimal("-123000111222333444555666.888888")), new byte[0]));
columns.add(new Column(toDecBytes(new BigDecimal("3")), new byte[0]));
columns.add(new Column(toDecBytes(new BigDecimal("-3")), new byte[0]));
session.put(tableMeta, rowKey, columns);
session.flush();
byte[] from = toDecBytes(-250);
byte[] to = toDecBytes(12);
Cursor<Column> results = session.columnSlice(tableMeta, rowKey, from, to, 2, BigDecimal.class);//(scanInfo, from, to, 2);
int counter = 0;
while(results.next()) {
Column col = results.getCurrent();
if(counter == 0) {