private void markExposedTablesAndColumns(ProjectCache prjCache, IRealization realization) { if (!realization.isReady()) { return; } for (TblColRef col : realization.getAllColumns()) { TableCache tableCache = prjCache.tables.get(col.getTable()); prjCache.exposedTables.add(tableCache.tableDesc); tableCache.exposed = true; tableCache.exposedColumns.add(col.getColumn()); } }
public LookupFiller(int[] hostIndex, LookupStringTable lookupTable, DeriveInfo deriveInfo, String[] derivedFieldNames) { this.hostIndex = hostIndex; this.hostLen = hostIndex.length; this.lookupKey = new Array<String>(new String[hostLen]); this.lookupTable = lookupTable; this.derivedIndex = new int[deriveInfo.columns.length]; this.derivedLen = derivedIndex.length; this.derivedFieldNames = derivedFieldNames; for (int i = 0; i < derivedLen; i++) { derivedIndex[i] = deriveInfo.columns[i].getColumn().getZeroBasedIndex(); } }
private LinkedList<Pair<Integer, Integer>> findColumnRowKeyRelationships(DimensionDesc dim) { LinkedList<Pair<Integer, Integer>> dimTblColAsRowKey = new LinkedList<Pair<Integer, Integer>>(); for (TblColRef colRef : dim.getColumnRefs()) { int dimTableIndex = colRef.getColumn().getZeroBasedIndex(); int rowKeyIndex = cubeDesc.getRowkey().getRowKeyIndexByColumnName(colRef.getName()); dimTblColAsRowKey.add(new Pair<Integer, Integer>(dimTableIndex, rowKeyIndex)); } return dimTblColAsRowKey; }
fkIndice.add(colRef.getColumn().getZeroBasedIndex());
private boolean sanityCheck(ProjectCache prjCache, IRealization realization) { MetadataManager metaMgr = mgr.getMetadataManager(); List<TblColRef> allColumns = realization.getAllColumns(); if (allColumns == null || allColumns.isEmpty()) { logger.error("Realization '" + realization.getCanonicalName() + "' does not report any columns"); return false; } for (TblColRef col : allColumns) { TableDesc table = metaMgr.getTableDesc(col.getTable()); if (table == null) { logger.error("Realization '" + realization.getCanonicalName() + "' reports column '" + col.getCanonicalName() + "', but its table is not found by MetadataManager"); return false; } ColumnDesc foundCol = table.findColumnByName(col.getName()); if (col.getColumn().equals(foundCol) == false) { logger.error("Realization '" + realization.getCanonicalName() + "' reports column '" + col.getCanonicalName() + "', but it is not equal to '" + foundCol + "' according to MetadataManager"); return false; } // auto-define table required by realization for some legacy test case if (prjCache.tables.get(table.getIdentity()) == null) { prjCache.tables.put(table.getIdentity(), new TableCache(table)); logger.warn("Realization '" + realization.getCanonicalName() + "' reports columcn '" + col.getCanonicalName() + "' whose table is not defined in project '" + prjCache.project + "'"); } } return true; }
public TableRecordInfo(IISegment iiSegment) { seg = iiSegment; desc = seg.getIIInstance().getDescriptor(); allColumns = desc.listAllColumns(); nColumns = allColumns.size(); dictionaries = new Dictionary<?>[nColumns]; measureSerializers = new FixedLenMeasureCodec<?>[nColumns]; DictionaryManager dictMgr = DictionaryManager.getInstance(desc.getConfig()); int index = 0; for (TblColRef tblColRef : desc.listAllColumns()) { ColumnDesc col = tblColRef.getColumn(); if (desc.isMetricsCol(index)) { measureSerializers[index] = FixedLenMeasureCodec.get(col.getType()); } else { String dictPath = seg.getDictResPath(tblColRef); try { dictionaries[index] = dictMgr.getDictionary(dictPath); } catch (IOException e) { throw new RuntimeException("dictionary " + dictPath + " does not exist ", e); } } index++; } digest = createDigest(); }
srcTable = col.getTable(); srcCol = col.getName(); srcColIdx = col.getColumn().getZeroBasedIndex(); int nColumns = metaMgr.getTableDesc(col.getTable()).getColumnCount(); table = new FileTable(factColumnsPath + "/" + col.getName(), nColumns); srcColIdx = col.getColumn().getZeroBasedIndex(); if (model.isFactTable(col.getTable())) { table = new FileTable(factColumnsPath + "/" + col.getName(), -1);
functionDesc.setReturnDataType(DataType.getInstance(iiDefaultHLLC)); } else { functionDesc.setReturnType(column.getColumn().getType().toString()); functionDesc.setReturnDataType(DataType.getInstance(functionDesc.getReturnType()));
private void markExposedTablesAndColumns(ProjectCache prjCache, IRealization realization) { if (!realization.isReady()) { return; } for (TblColRef col : realization.getAllColumns()) { TableCache tableCache = prjCache.tables.get(col.getTable()); prjCache.exposedTables.add(tableCache.tableDesc); tableCache.exposed = true; tableCache.exposedColumns.add(col.getColumn()); } }
private boolean sanityCheck(ProjectCache prjCache, IRealization realization) { MetadataManager metaMgr = mgr.getMetadataManager(); List<TblColRef> allColumns = realization.getAllColumns(); if (allColumns == null || allColumns.isEmpty()) { logger.error("Realization '" + realization.getCanonicalName() + "' does not report any columns"); return false; } for (TblColRef col : allColumns) { TableDesc table = metaMgr.getTableDesc(col.getTable()); if (table == null) { logger.error("Realization '" + realization.getCanonicalName() + "' reports column '" + col.getCanonicalName() + "', but its table is not found by MetadataManager"); return false; } ColumnDesc foundCol = table.findColumnByName(col.getName()); if (col.getColumn().equals(foundCol) == false) { logger.error("Realization '" + realization.getCanonicalName() + "' reports column '" + col.getCanonicalName() + "', but it is not equal to '" + foundCol + "' according to MetadataManager"); return false; } // auto-define table required by realization for some legacy test case if (prjCache.tables.get(table.getIdentity()) == null) { prjCache.tables.put(table.getIdentity(), new TableCache(table)); logger.warn("Realization '" + realization.getCanonicalName() + "' reports column '" + col.getCanonicalName() + "' whose table is not defined in project '" + prjCache.project + "'"); } } return true; }
srcTable = col.getTable(); srcCol = col.getName(); srcColIdx = col.getColumn().getZeroBasedIndex(); int nColumns = metaMgr.getTableDesc(col.getTable()).getColumnCount(); table = new FileTable(factColumnsPath + "/" + col.getName(), nColumns); srcColIdx = col.getColumn().getZeroBasedIndex(); if (model.isFactTable(col.getTable())) { table = new FileTable(factColumnsPath + "/" + col.getName(), -1);