use of com.pingcap.tikv.key.IntHandle in project tispark by pingcap.
the class TableCodecV1Test method makeValues.
private void makeValues() {
List<Object> values = new ArrayList<>();
values.add(new IntHandle(1L));
values.add(1L);
DateTime dateTime = DateTime.parse("1995-10-10");
// values.add(new Timestamp(dateTime.getMillis()));
// values.add(new Timestamp(dateTime.getMillis()));
values.add("abc");
values.add("δΈ");
this.values = values.toArray();
}
use of com.pingcap.tikv.key.IntHandle in project tispark by pingcap.
the class TableCodecV1Test method testRowCodec.
@Test
public void testRowCodec() {
// multiple test was added since encodeRow refuse its cdo
for (int i = 0; i < 4; i++) {
byte[] bytes = TableCodecV1.encodeRow(tblInfo.getColumns(), values, tblInfo.isPkHandle());
// testing the correctness via decodeRow
Row row = TableCodecV1.decodeRow(bytes, new IntHandle(1L), tblInfo);
for (int j = 0; j < tblInfo.getColumns().size(); j++) {
assertEquals(row.get(j, null), values[j]);
}
}
}
use of com.pingcap.tikv.key.IntHandle in project tispark by pingcap.
the class TableCodecV2Test method testLargeColID.
@Test
public void testLargeColID() {
TestCase testCase = TestCase.createNew(new int[] { 128, 1, 1, 0, 0, 0, 44, 1, 0, 0, 0, 0, 0, 0 }, MetaUtils.TableBuilder.newBuilder().name("t").addColumn("c1", StringType.CHAR, 300).build(), new IntHandle(300L), new Object[] { "" });
testCase.test();
}
Aggregations