Search in sources :

Example 1 with ObjIntHashMap

use of io.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("zall.sym", -1);
    try (Path path = new Path().of(root).concat("all").concat(TableUtils.META_FILE_NAME).$();
        TableReaderMetadata metadata = new TableReaderMetadata(FilesFacadeImpl.INSTANCE, path)) {
        for (ObjIntHashMap.Entry<String> e : expected) {
            Assert.assertEquals(e.value, metadata.getColumnIndexQuiet(e.key));
        }
    }
}
Also used : Path(io.questdb.std.str.Path) ObjIntHashMap(io.questdb.std.ObjIntHashMap) Test(org.junit.Test)

Aggregations

ObjIntHashMap (io.questdb.std.ObjIntHashMap)1 Path (io.questdb.std.str.Path)1 Test (org.junit.Test)1