Search in sources :

Example 11 with TableDefinition

use of io.dingodb.common.table.TableDefinition in project dingo by dingodb.

the class TestAvroCodec method setupAll.

@BeforeAll
public static void setupAll() throws IOException {
    TableDefinition tableDefinition = TableDefinition.readJson(TestAvroCodec.class.getResourceAsStream("/table-test.json"));
    codec = new AvroCodec(tableDefinition.getAvroSchema());
}
Also used : TableDefinition(io.dingodb.common.table.TableDefinition) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 12 with TableDefinition

use of io.dingodb.common.table.TableDefinition in project dingo by dingodb.

the class TestCsvUtils method setupAll.

@BeforeAll
public static void setupAll() throws IOException {
    TableDefinition tableDefinition = TableDefinition.readJson(TestCsvUtils.class.getResourceAsStream("/table-test.json"));
    schema = tableDefinition.getTupleSchema();
}
Also used : TableDefinition(io.dingodb.common.table.TableDefinition) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 13 with TableDefinition

use of io.dingodb.common.table.TableDefinition in project dingo by dingodb.

the class MetaTestService method getTableDefinitions.

@Override
public Map<String, TableDefinition> getTableDefinitions() {
    if (tableDefinitionMap != null) {
        return tableDefinitionMap;
    }
    if (path != null) {
        tableDefinitionMap = new LinkedHashMap<>();
        FileUtils.listFiles(path, new String[] { "json" }, true).forEach(f -> {
            try {
                TableDefinition td = TableDefinition.readJson(new FileInputStream(f));
                tableDefinitionMap.put(td.getName(), td);
            } catch (IOException e) {
                throw new RuntimeException("Read table definition \"" + f.getName() + "\" failed.", e);
            }
        });
        return tableDefinitionMap;
    }
    throw new RuntimeException(this.getClass().getName() + " is not initialized.");
}
Also used : TableDefinition(io.dingodb.common.table.TableDefinition) IOException(java.io.IOException) FileInputStream(java.io.FileInputStream)

Aggregations

TableDefinition (io.dingodb.common.table.TableDefinition)13 Output (io.dingodb.exec.base.Output)5 Task (io.dingodb.exec.base.Task)5 Location (io.dingodb.meta.Location)4 LinkedList (java.util.LinkedList)4 TableId (io.dingodb.common.table.TableId)3 PartitionStrategy (io.dingodb.exec.partition.PartitionStrategy)3 SimpleHashStrategy (io.dingodb.exec.partition.SimpleHashStrategy)3 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 PrimitiveCodec.encodeString (io.dingodb.common.codec.PrimitiveCodec.encodeString)2 OutputHint (io.dingodb.exec.base.OutputHint)2 GetByKeysOperator (io.dingodb.exec.operator.GetByKeysOperator)2 PartScanOperator (io.dingodb.exec.operator.PartScanOperator)2 PartitionOperator (io.dingodb.exec.operator.PartitionOperator)2 ValuesOperator (io.dingodb.exec.operator.ValuesOperator)2 IOException (java.io.IOException)2 List (java.util.List)2 BeforeAll (org.junit.jupiter.api.BeforeAll)2 DingoConventions (io.dingodb.calcite.DingoConventions)1