use of com.questdb.std.ObjIntHashMap in project questdb by bluestreak01.
the class TableReaderMetadataTest method testColumnIndex.
@Test
public void testColumnIndex() {
ObjIntHashMap<String> expected = new ObjIntHashMap<>();
expected.put("int", 0);
expected.put("byte", 2);
expected.put("bin", 9);
expected.put("short", 1);
expected.put("float", 4);
expected.put("long", 5);
expected.put("xyz", -1);
expected.put("str", 6);
expected.put("double", 3);
expected.put("sym", 7);
expected.put("bool", 8);
expected.put("all.int", 0);
expected.put("all.byte", 2);
expected.put("all.bin", 9);
expected.put("all.short", 1);
expected.put("all.float", 4);
expected.put("all.long", 5);
expected.put("all.xyz", -1);
expected.put("all.str", 6);
expected.put("all.double", 3);
expected.put("all.sym", 7);
expected.put("zall.sym", -1);
try (Path path = new Path().of(root).concat("all").concat(TableUtils.META_FILE_NAME).$();
TableReaderMetadata metadata = new TableReaderMetadata(FilesFacadeImpl.INSTANCE, "all", path)) {
for (ObjIntHashMap.Entry<String> e : expected) {
Assert.assertEquals(e.value, metadata.getColumnIndexQuiet(e.key));
}
}
}
Aggregations