use of com.bakdata.conquery.models.events.stores.root.ColumnStore in project conquery by bakdata.
the class ImportJob method createImport.
private Import createImport(PreprocessedHeader header, Map<String, ColumnStore> stores, Column[] columns, int size) {
Import imp = new Import(table);
imp.setName(header.getName());
imp.setNumberOfEntries(header.getRows());
imp.setNumberOfEntities(size);
final ImportColumn[] importColumns = new ImportColumn[columns.length];
for (int i = 0; i < columns.length; i++) {
final ColumnStore store = stores.get(columns[i].getName());
ImportColumn col = new ImportColumn(imp, store.createDescription(), store.getLines(), store.estimateMemoryConsumptionBytes());
col.setName(columns[i].getName());
importColumns[i] = col;
}
imp.setColumns(importColumns);
Set<DictionaryId> dictionaries = new HashSet<>();
for (Column column : columns) {
// only non-shared dictionaries need to be registered here
if (column.getType() != MajorTypeId.STRING) {
continue;
}
// shared dictionaries are not related to a specific import.
if (column.getSharedDictionary() != null) {
continue;
}
// Some StringStores don't have Dictionaries.
final StringStore stringStore = (StringStore) stores.get(column.getName());
if (!stringStore.isDictionaryHolding()) {
continue;
}
dictionaries.add(stringStore.getUnderlyingDictionary().getId());
}
imp.setDictionaries(dictionaries);
namespace.sendToAll(new AddImport(imp));
return imp;
}
use of com.bakdata.conquery.models.events.stores.root.ColumnStore in project conquery by bakdata.
the class Bucket method calculateMap.
public Map<String, Object> calculateMap(int event) {
Map<String, Object> out = new HashMap<>(stores.length);
for (int i = 0; i < stores.length; i++) {
ColumnStore store = stores[i];
if (!store.has(event)) {
continue;
}
out.put(getTable().getColumns()[i].getName(), store.createScriptValue(event));
}
return out;
}
Aggregations