@Override public void implementOLAP(OLAPImplementor implementor) { Preconditions.checkState(columnRowType == null, "OLAPTableScan MUST NOT be shared by more than one prent"); // create context in case of non-join if (implementor.getContext() == null || !(implementor.getParentNode() instanceof OLAPJoinRel) || implementor.isNewOLAPContextRequired()) { implementor.allocateContext(); } context = implementor.getContext(); context.allTableScans.add(this); columnRowType = buildColumnRowType(); if (context.olapSchema == null) { OLAPSchema schema = olapTable.getSchema(); context.olapSchema = schema; context.storageContext.setConnUrl(schema.getStorageUrl()); } if (context.firstTableScan == null) { context.firstTableScan = this; } if (needCollectionColumns(implementor)) { // OLAPToEnumerableConverter on top of table scan, should be a select * from table for (TblColRef tblColRef : columnRowType.getAllColumns()) { if (!tblColRef.getName().startsWith("_KY_")) { context.allColumns.add(tblColRef); } } } }
@Before public void setUp() throws Exception { this.createTestMetadata(); CubeManager cubeMgr = CubeManager.getInstance(getTestConfig()); cube = cubeMgr.getCube("TEST_KYLIN_CUBE_WITHOUT_SLR_EMPTY"); Assert.assertNotNull(cube); storageEngine = StorageEngineFactory.getStorageEngine(cube); String url = KylinConfig.getInstanceFromEnv().getStorageUrl(); context = new StorageContext(); context.setConnUrl(url); }
@Override public void implementOLAP(OLAPImplementor implementor) { Preconditions.checkState(columnRowType == null, "OLAPTableScan MUST NOT be shared by more than one prent"); // create context in case of non-join if (implementor.getContext() == null || !(implementor.getParentNode() instanceof OLAPJoinRel) || implementor.isNewOLAPContextRequired()) { implementor.allocateContext(); } context = implementor.getContext(); context.allTableScans.add(this); columnRowType = buildColumnRowType(); if (context.olapSchema == null) { OLAPSchema schema = olapTable.getSchema(); context.olapSchema = schema; context.storageContext.setConnUrl(schema.getStorageUrl()); } if (context.firstTableScan == null) { context.firstTableScan = this; } if (needCollectionColumns(implementor)) { // OLAPToEnumerableConverter on top of table scan, should be a select * from table for (TblColRef tblColRef : columnRowType.getAllColumns()) { if (!tblColRef.getName().startsWith("_KY_")) { context.allColumns.add(tblColRef); } } } }