I am running kylin 2.6.2. Iissued "git diff e3896af234^ e3896af234" cpmmand to
study a code change in LookupTableEnumerator.java.
The code piece that puzzled me is the following:
public class LookupTableEnumerator implements Enumerator<Object[]> {
private final static Logger logger =
LoggerFactory.getLogger(LookupTableEnumerator.class);
private final ILookupTable lookupTable;
private final List<ColumnDesc> colDescs;
private final Object[] current;
private Iterator<String[]> iterator;
public LookupTableEnumerator(OLAPContext olapContext) {
//TODO: assuming LookupTableEnumerator is handled by a cube
CubeInstance cube = null;
if (olapContext.realization instanceof CubeInstance) {
cube = (CubeInstance) olapContext.realization;
<== here we got cube value
ProjectInstance project = cube.getProjectInstance();
List<RealizationEntry> realizationEntries =
project.getRealizationEntries();
String lookupTableName = olapContext.firstTableScan.getTableName();
CubeManager cubeMgr = CubeManager.getInstance(cube.getConfig());
cube = cubeMgr.findLatestSnapshot(realizationEntries,
lookupTableName); <== why do we reset cube to other value??????
olapContext.realization = cube;
} else if (olapContext.realization instanceof HybridInstance) {
final HybridInstance hybridInstance = (HybridInstance)
olapContext.realization;
final IRealization latestRealization =
hybridInstance.getLatestRealization();
if (latestRealization instanceof CubeInstance) {
cube = (CubeInstance) latestRealization;
} else {
throw new IllegalStateException();
}
}
Is a bug introduced by that bug fix?
Thanks.
Kang-sen
-----------------------------------------------------------------------------------------------------------------------
Notice: This e-mail together with any attachments may contain information of
Ribbon Communications Inc. that
is confidential and/or proprietary for the sole use of the intended recipient.
Any review, disclosure, reliance or
distribution by others or forwarding without express permission is strictly
prohibited. If you are not the intended
recipient, please notify the sender immediately and then delete all copies,
including any attachments.
-----------------------------------------------------------------------------------------------------------------------