public class CancellationTest.CrossJoinFunDefTester extends CrossJoinFunDef
FunUtil.DescendingValueComparator, FunUtil.ObjIntPair<T>, FunUtil.OrderKey
Util.AbstractFlatList<T>, Util.ByteMatcher, Util.ErrorCellValue, Util.Flat2List<T>, Util.Flat3List<T>, Util.Functor1<RT,PT>, Util.GcIterator<T>, Util.MemoryInfo, Util.PropertyList, Util.SqlNullSafeComparator
flags, parameterCategories, returnCategory
BooleanNull, DoubleEmpty, DoubleNull, IntegerNull, NullMember
DEBUG, EmptyValue, IBM_JVM, JdbcVersion, JVM_INSTANCE_UUID, nl, nullValue, Retrowoven
Constructor and Description |
---|
CrossJoinFunDefTester(FunDef dummyFunDef) |
Modifier and Type | Method and Description |
---|---|
TupleList |
nonEmptyList(Evaluator evaluator,
TupleList list,
ResolvedFunCall call)
This is the entry point to the crossjoin non-empty optimizer code.
|
compileCall, compileCallImmutableList, compileCallIterable, compileCallMutableList, getResultType, mutableCrossJoin, mutableCrossJoin, nonEmptyOptimizeList
createCall, getDescription, getName, getParameterCategories, getReturnCategory, getSignature, getSyntax, unparse, validateArg
avg, box, box, checkIterListResultStyles, checkListResultStyles, compareHierarchically, compareSiblingMembers, compareValues, compareValues, count, decodeCategory, decodeParameterCategories, decodeReturnCategory, decodeSyntacticType, getDimensionDefaultHierarchy, getNonEmptyMemberChildren, getNonEmptyMemberChildrenWithDetails, hierarchizeMemberList, hierarchizeTupleList, makeNullTuple, max, min, newEvalException, newEvalException, newEvalException, partiallySortMembers, partiallySortTuples, quartile, resolveFunArgs, sortTuples, stablePartialSort, stablePartialSort, stablePartialSortArray, stablePartialSortJulian, stablePartialSortMarc, stablePartialSortPedro, sum, sumDouble, sumDouble, tupleContainsNullMember, tupleContainsNullMember, worthCaching
addDatabaseTime, addLevelCalculatedMembers, append, appendArrays, areOccurencesEqual, assertPostcondition, assertPostcondition, assertPrecondition, assertPrecondition, assertTrue, assertTrue, badValue, binarySearch, bitSetBetween, camelToUpper, canCast, cancelStatement, caseSensitiveCompareName, cast, cast, castToIterable, checkCJResultLimit, close, commaList, compare, compareIntegers, compareKey, compareName, compileScript, convert, convert, convertOlap4jConnectStringToNativeMondrian, convertStackToString, copyOf, copyOf, copyOf, copyOf, copyOf, createExpr, createRandom, createRootRole, createSimpleValidator, createUdf, dbTimeMillis, deprecated, deprecated, digestMd5, digestSha256, equal, equalName, equals, equals, falseFunctor, filter, flatList, flatList, flatListCopy, generateUuidString, genericArray, getAnnotation, getClosestResource, getDimensionCube, getErrorMessage, getErrorMessage, getExecutorService, getFirstDescendantOnLevel, getMatchingCause, getMemberOrdinalInParent, getMemoryInfo, getScheduledExecutorService, hash, hash, hashArray, identityFunctor, implode, intersect, isBlank, isEmpty, isNull, isSorted, isValidProperty, last, lookup, lookup, lookup, lookup, lookup, lookupCompound, lookupCompound, lookupHierarchyLevel, lookupHierarchyRootMember, lookupHierarchyRootMember, lookupProperty, makeBigDecimalFromDouble, makeFqName, makeFqName, makeFqName, matches, matches, mdxEncodeString, needToImplement, newElementNotFoundException, newError, newError, newIdentityHashSet, newIdentityHashSetFake, newInternal, newInternal, newTimer, nonDbTimeMillis, normalizeName, only, parseCommaList, parseConnectString, parseIdentifier, parseInterval, parseLocale, printMemory, printMemory, quoteForMdx, quoteForMdx, quoteJavaString, quoteMdxIdentifier, quoteMdxIdentifier, quoteMdxIdentifier, quoteMdxIdentifier, quotePattern, readFully, readFully, readURL, readURL, readURL, readVirtualFile, readVirtualFileAsString, replace, replace, replaceProperties, safeGet, singleQuoteString, singleQuoteString, sort, sort, threadLocalRemove, toMap, toNullValuesMap, toOlap4j, toOlap4j, toOlap4j, toURL, trueFunctor, unexpected, uniquify, unparse, unparse, wildcardToRegexp
addChild, addChild, addChildren, addElement, concatenate, createDefaultParser, discard, discard, discard, discard, discard, discard, discard, discard, discard, getFirstInstance, wrapperToXml
getFirstTagName, printAtt, printAtt, printAtt, printAtt, printPCDATA, printPCDATA, printPCDATA, quoteAtt, quoteAtt, quoteAtt, quoteAtt, quotePCDATA, stringEncodeXML, stringHasXMLSpecials
public CrossJoinFunDefTester(FunDef dummyFunDef)
public TupleList nonEmptyList(Evaluator evaluator, TupleList list, ResolvedFunCall call)
CrossJoinFunDef
What one wants to determine is for each individual Member of the input parameter list, a 'List-Member', whether across a slice there is any data.
But what data?
For Members other than those in the list, the 'non-List-Members', one wants to consider all data across the scope of these other Members. For instance, if Time is not a List-Member, then one wants to consider data across All Time. Or, if Customer is not a List-Member, then look at data across All Customers. The theory here, is if there is no data for a particular Member of the list where all other Members not part of the list are span their complete hierarchy, then there is certainly no data for Members of that Hierarchy at a more specific Level (more on this below).
When a Member that is a non-List-Member is part of a Hierarchy that has an All Member (hasAll="true"), then its very easy to make sure that the All Member is used during the optimization. If a non-List-Member is part of a Hierarchy that does not have an All Member, then one must, in fact, iterate over all top-level Members of the Hierarchy!!! - otherwise a List-Member might be excluded because the optimization code was not looking everywhere.
Concerning default Members for those Hierarchies for the non-List-Members, ignore them. What is wanted is either the All Member or one must iterate across all top-level Members, what happens to be the default Member of the Hierarchy is of no relevant.
The Measures Hierarchy has special considerations. First, there is no All Measure. But, certainly one need only involve Measures that are actually in the query... yes and no. For Calculated Measures one must also get all of the non-Calculated Measures that make up each Calculated Measure. Thus, one ends up iterating across all Calculated and non-Calculated Measures that are explicitly mentioned in the query as well as all Calculated and non-Calculated Measures that are used to define the Calculated Measures in the query. Why all of these? because this represents the total scope of possible Measures that might yield a non-null value for the List-Members and that is what we what to find. It might be a super set, but thats ok; we just do not want to miss anything.
For other Members, the default Member is used, but for Measures one should look for that data for all Measures associated with the query, not just one Measure. For a dense dataset this may not be a problem or even apparent, but for a sparse dataset, the first Measure may, in fact, have not data but other Measures associated with the query might. Hence, the solution here is to identify all Measures associated with the query and then for each Member of the list, determine if there is any data iterating across all Measures until non-null data is found or the end of the Measures is reached.
This is a non-optimistic implementation. This means that an element of the input parameter List is only not included in the returned result List if for no combination of Measures, non-All Members (for Hierarchies that have no All Members) and evaluator default Members did the element evaluate to non-null.
nonEmptyList
in class CrossJoinFunDef
evaluator
- Evaluatorlist
- List of members or tuplescall
- Calling ResolvedFunCall used to determine what Measures
to use