Learning
Documentation
Community
Open Exchange
Global Masters
Home > Class Reference > %SYS namespace > %DeepSee.Query.query
Private  Storage   

%DeepSee.Query.query


class %DeepSee.Query.query extends
node

This class holds run-time information for a DeepSee MDX statement and provides the machinery to prepare and execute it (via the %DeepSee.ResultSet interface.

Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
42 70


Summary


Properties
%MaxListingRows %NamedParameters %ParameterValues %QueryKey
%Statistics %WITHText %hasRelations %hasRelationship
%hasSqlRestrict %isCompound %isCompoundMember %listing
%listingSource %mustCompute %orderList %originalAxisText
%originalWITHContents %recomputeAxes %removeEmpty %returnList
%target %targetKey %variables axes
calculatedMembers compoundDrillthroughs compoundQueries cube
filterAxis filters measureAxis namedSets
parent parentCube parentQueryKey parentWITHText
queryType recompute showPlan slicer
subqueries useAgents useCache value

Methods
%%OIDGet %AddLabel %AddToSaveSet
%BindExport %BuildObjectGraph %CheckResultsCache
%CheckSubqueryResultsCache %ClassIsLatestVersion %ClassName
%ClearQueryResults %ClearStatistics %Close
%CombineFiltersWithSlicer %CompleteAxes %CompressTimeRange
%ComputeAxisCRC %ConstructClone %CopyNode
%CreateAxisKey %CreateResultKey %CreateSubQueryResultSet
%DeleteNode %DispatchClassMethod %DispatchGetModified
%DispatchGetProperty %DispatchMethod %DispatchSetModified
%DispatchSetMultidimProperty %DispatchSetProperty %ExecuteAsynch
%ExecuteAxes %ExecuteCells %ExecuteIntermediateCells
%ExecuteParameters %Extends %FindMemberInfo
%FlattenSlicer %FoldCompoundQueries %GetCalculatedMembers
%GetFirstDayHorolog %GetLanguage %GetLastDay
%GetLastDayHorolog %GetMeasureFromSpec %GetMemberProvider
%GetParameter %GetParameterInfo %GetSubQuery
%GetType %GetValue %HasCrossJoin
%HasCurrentMember %HasMeasure %HideNode
%IncrementCount %InitializeAxisCache %InitializeResultsCache
%IsA %IsAggFunc %IsCrossjoinSwapExempt
%IsEnabled %IsExecutable %IsMeasure
%IsMember %IsModified %LookupCalculatedMember
%LookupNamedSet %MakeReserveAxisKey %New
%NormalizeObject %NullifyAxis %ObjectModified
%OriginalNamespace %PackageName %PreProcess
%PreProcessQuery %Prepare %PrintNode
%PrintStatistics %ProcessAxes %ProcessFilter
%ProcessSlicerRestrictions %PushDownCurrentMember %QueryTrace
%ReduceNode %RegisterSubQuery %ReleaseReservedAxes
%RemoveFromSaveSet %RemoveLabel %RemoveLabelsInFilterExpression
%ReserveAxes %ResolveNamedParm %ResolveVariablesInText
%RewriteCompoundQuery %RewriteForCrossJoin %RewriteForCurrentMember
%RewriteForTimeFolding %RewriteGroup %RewriteNodeAsSubquery
%RewriteWITH %SerializeObject %SetModified
%SetVariables %SplitDate %SplitDateRange
%TestSubQueryCache %ToString %ValidateObject
%WITHToString %XMLGenerate XMLAfterExport
XMLBeforeExport XMLDTD XMLExport
XMLExportInternal XMLExportToStream XMLExportToString
XMLGetSchemaImports XMLImport XMLImportInternal
XMLIsObjectEmpty XMLNew XMLSchema
XMLSchemaNamespace XMLSchemaType


Properties


• property %MaxListingRows as %Integer [ InitialExpression = 1000 ];
Maximum number of rows returned by a DRILLTHROUGH query. This is set by the MAXROWS directive within a DRILLTHROUGH query.
• property %NamedParameters as %String [ MultiDimensional ];
Array of named parameters with current values.
• property %ParameterValues as %String [ MultiDimensional ];
Array of named parameter values supplied when this query was executed.
• property %QueryKey as %String(XMLPROJECTION="none");
Hash key used to address the results for this query. This allows a query to be prepared and later restored.
• property %Statistics as %DeepSee.Datatype.string [ MultiDimensional ];
Array of timing and performance statistics for this query.
• property %WITHText as %String(XMLPROJECTION="none");
Canonic form of WITH clause. Used internally to create hash keys.
• property %hasRelations as %Boolean(XMLPROJECTION="none") [ InitialExpression = 0 ];
If true, this query contains references to related cubes.
This is set during the axis prepare phase.
• property %hasRelationship as %Boolean(XMLPROJECTION="none") [ InitialExpression = 0 ];
If true, this query contains references to related cubes.
Set during the parse phase, might replace %hasRelations.
• property %hasSqlRestrict as %Boolean(XMLPROJECTION="none") [ InitialExpression = 0 ];
If true, this query contains an %SQLRESTRIICT statement.
Set during the parse phase.
• property %isCompound as %Boolean(XMLPROJECTION="attribute") [ InitialExpression = 0 ];
If true, then this is a query on a compound cube.
• property %isCompoundMember as %Boolean [ InitialExpression = 0 ];
If true, this query is being run as a subquery in a compound cube.
• property %listing as %String(MAXLEN=255,XMLPROJECTION="none");
Name of listing specified by %LISTING statement in query.
• property %listingSource as %String(VALUELIST="source,facts",XMLPROJECTION="none");
For a drillthrough, this indicates whether the listing query is against the source table or the fact table.
• property %mustCompute as %Boolean(XMLPROJECTION="none") [ InitialExpression = 0 ];
If true, then the query must be recomputed-- the cached results are not guaranteed to be up-to-date.
• property %orderList as %String(MAXLEN=2000,XMLPROJECTION="none");
List of fields in %ORDER BY clause for DRILLTHROUGH statement.
• property %originalAxisText as %String [ MultiDimensional ];
Original text for each axis. Used as part of the axis key.
• property %originalWITHContents as %String;
Original components of the WITH clause. Order is not necessarily preserved from the original query text.
• property %recomputeAxes as %Boolean(XMLPROJECTION="none") [ InitialExpression = 0 ];
If true, then the axes for the query must be recomputed.
• property %removeEmpty as %Boolean(XMLPROJECTION="none") [ MultiDimensional ];
Indicates, by axis, if empty value needs to be removed after processing. This is used by compound queries.
• property %returnList as %String(MAXLEN=2000,XMLPROJECTION="none");
List of fields in RETURN clause for DRILLTHROUGH statement.
• property %target as %DeepSee.Datatype.string(VALUELIST=",SET,MEMBER",XMLPROJECTION="none");
For CREATE or DROP statements this specifies the target of the command.
• property %targetKey as %DeepSee.Datatype.string(XMLPROJECTION="none");
For DROP statements this specifies the key of the item to be dropped.
• property %variables as %String [ MultiDimensional ];
Current pivot variable settings for this query.
• relationship axes as %DeepSee.Query.axis(XMLELEMENTREF=1,XMLPROJECTION="ELEMENT",XMLTYPECONSTRAINT="CHOICE") [ Inverse = query,Cardinality = many ];
Axes defined for this query.
• property calculatedMembers as array of %DeepSee.Query.calculatedMember(XMLKEYNAME="memberName",XMLPROJECTION="ELEMENT");
Collection of Calculated Members defined within the WITH clause of the query. These are indexed by Dimension.MemberName.
• property compoundDrillthroughs as list of %String(XMLPROJECTION="NONE");
For DRILLTHROUGH queries on compound cubes, this is the MDX DRILLTHROUGH statements for each leg of the compound query.
• property compoundQueries as list of %String(XMLPROJECTION="NONE");
For queries on compound cubes, this is the set of keys for the subqueries that have to be executed and then joined.
• property cube as %DeepSee.Datatype.string(XMLPROJECTION="attribute");
Name of the cube this query is based on.
This is the FROM clause of the query.
• property filterAxis as %DeepSee.Query.axis(XMLPROJECTION="NONE");
Used to hold cube/subjectArea level filter.
• property filters as list of %DeepSee.Query.axis(XMLPROJECTION="ELEMENT");
Filter(s) defined for this query.
This is the ISC extension %FILTER clause of the query.
• property measureAxis as %Integer [ InitialExpression = -1 ];
Used as an indicator as to which axis supplies the measure information for this query. The slicer is denoted by a 0, other axes are logged as their 1-based number. A value of -1 for this property indicates the default measure will be used.
• property namedSets as array of %DeepSee.Query.namedSet(XMLKEYNAME="setName",XMLPROJECTION="ELEMENT");
Collection of Named Sets defined within the WITH clause of the query.
• property parentCube as %String;
Contains the parent cube name if query is a member of a subquery.
• property parentQueryKey as %String(XMLPROJECTION="none");
For subqueries, remember which parent query initiated it.
• property parentWITHText as %String(XMLPROJECTION="none");
Canonic form of WITH clause. Used internally to create hash keys.
• property queryType as %DeepSee.Datatype.string(VALUELIST=",SELECT,DRILLTHROUGH,CREATE,DROP,%BITSET",XMLPROJECTION="attribute") [ InitialExpression = "SELECT" ];
This indicates what type of MDX statement this is.
• property recompute as %Boolean(XMLPROJECTION="none") [ InitialExpression = 1 ];
If true recompute previously run queries whose data has been updated. otherwise return old values.
• property showPlan as %Boolean(XMLPROJECTION="none") [ InitialExpression = 0 ];
If true, execute this query in "plan" mode.
• property slicer as %DeepSee.Query.axis(XMLPROJECTION="ELEMENT");
Slicer defined for this query.
This is the WHERE clause of the query.
From a definition perspective this is no different than any other axis.
• property subqueries as list of %DeepSee.ResultSet(XMLPROJECTION="NONE");
Collection of all subqueries associated with this query.
• property useAgents as %Boolean(XMLPROJECTION="none") [ InitialExpression = 0 ];
If true, execute using background agents.
This is set when using async mode.
• property useCache as %Boolean(XMLPROJECTION="attribute") [ InitialExpression = 1 ];
If true, then use results caching for this query.

Methods


• classmethod %AddLabel(pReferenceGroup As %DeepSee.Query.group, pLabel As %DeepSee.Query.group = "", Output pLabeledGroup As %DeepSee.Query.group) as %Status
Add a %LABEL to pReferenceGroup. The label is supplied to the method as an abstracted %LABEL object pLabel. The input group is placed in the first argument of a %LABEL which contains all the same parameters that are defined in pLabel. The newly labeled group is returned in pLabeledGroup.
• classmethod %CheckResultsCache(pCubeName, pQueryKey, ByRef pUpToDate=1) as %Status
• classmethod %CheckSubqueryResultsCache(pMainCube, pCubeName, pQueryKey, ByRef pUpToDate=1) as %Status
• classmethod %ClearQueryResults(pCubeName As %String = "", pQueryKey As %String = "") as %Status
This method provides a means for safely killing previously cached results without destroying the
^DeepSee.Cache.Results(CUBEKEY,QueryKey,"query")
node. Primarily this allows %PrepareKey to function if an execution determines the remainder of the cache is stale and cannot be reused.
• method %ClearStatistics()
Clear out current statistics for this query.
• method %CombineFiltersWithSlicer() as %Status
Combine all filters into the slicer.
• method %CompleteAxes() as %Status
Make sure this query has an executable set of axes. Axes 0 and 1 (COLUMNS, ROWS) are required, axis 2 is optional. If either Rows or Columns are missing, insert a placeholder %SEARCH term
• method %CompressTimeRange(pNode As %DeepSee.Query.range) as %DeepSee.Query.node
See if a time range can be compressed into smaller units.
• classmethod %ComputeAxisCRC(pCube As %String, pAxisKey As %String, Output pCRC) as %Status
Compute a CRC on the given query axis.
• method %CreateAxisKey(Output pStatus As %Status = $$$OK, pType="", pAxis As %DeepSee.Query.axis = $$$NULLOREF, pOriginalSpec="", Output pFinalText="", pRefreshKey As %Boolean = 0) as %String
Generate an axis key for a %DeepSee.Query.axis object.
• method %CreateResultKey(Output pStatus As %Status = $$$OK, Output pFinalText="", pRefreshKey As %Boolean = 0, pMDXRequest As %String = "") as %String
Generate the result key for the current query object.
• method %CreateSubQueryResultSet(pMDX As %String, Output pRS As %DeepSee.ResultSet, pSkipWITH As %Boolean = 0) as %Status
Create and prepare a result set for a subquery within this query.
• method %ExecuteAsynch(pWait As %Boolean = 0, Output pTaskGroupId As %String, pAxesOnly As %Boolean = 0, pAxisQuery As %String = "", ByRef pParms) as %Status
Execute this query using background agents.
If pWait is true (1) then do not return until the background agents are finished.
If pWait is false, then pTaskGroupId will return the task group id used to execute the query.
• method %ExecuteAxes() as %Status
Execute this query and materialize the contents of the result axes.
The results are written to the results cache.
• method %ExecuteCells(pTrace As %Boolean = 0) as %Status
Execute this query and calculate the contents of the resulting cells.
Note that this may be called on a partially constructed query object if a ResultSet was prepared using an existing query key.
• classmethod %ExecuteIntermediateCells(pCubeName As %String, pQueryKey As %String, pUseAgents As %Boolean = 1, pTrace As %Boolean = 0, ByRef pStats) as %Status
This does the actual work of splitting the cells into buckets and sections and executing them.
This may be called from a background agent.
• method %ExecuteParameters(ByRef pParms) as %Status
Apply the set of named parameters values to this query and then make sure the result cache is ready to accept values.
• method %FindMemberInfo(pNode As %DeepSee.Query.node, Output pMember As %DeepSee.Query.member) as %Status
Utility method. Try to find the dimension info assoiciated with the provided query object.
• method %FlattenSlicer(pNode As %DeepSee.Query.group, pLevel As %Integer = 0, Output pMoveAll As %Boolean) as %Status
Walk down a given node within the slicer and flatten expressions and aggregate functions.
• method %FoldCompoundQueries() as %Status
Combine the results of a set of subqueries against the components of a compound cube.
• method %GetCalculatedMembers(pDimName As %String, ByRef pList As %String) as %Status
Find the list of calculated members in the given dimension. Return a list of their names: pList(UNAME) = name
• classmethod %GetFirstDayHorolog(pYear As %Integer, pMonth As %Integer, pCalendar As %String = "gregorian") as %Integer
• classmethod %GetLanguage() as %String
Return the RFC 1766 code of the current language. Used to ensure that cached values preserve localization.
• classmethod %GetLastDay(pYear As %Integer, pMonth As %Integer, pCalendar As %String) as %Integer
Return the last day (number) of the given year and month.
• classmethod %GetLastDayHorolog(pYear As %Integer, pMonth As %Integer, pCalendar As %String = "gregorian") as %Integer
Return the last day (number) of the given year and month.
• classmethod %GetMeasureFromSpec(pSpec As %String, Output pMeasure) as %Status
Utility. See if this spec is for a measure. If so return the measure name.
• method %GetParameterInfo(Output pParms) as %Status
Return the set of named parameters values defined by this query.
• method %GetSubQuery(pKey As %Integer, Output pRS As %DeepSee.ResultSet) as %Status
Retrieve a ResultSet from the set of registered subqueries.
• method %HasCrossJoin(pGroup As %DeepSee.Query.group) as %Boolean
Test if a group has a crossjoin in it (with an aggregate or expression as its first child).
• method %HasCurrentMember(pGroup As %DeepSee.Query.group) as %Boolean
Test if a group has a current member in it.
• classmethod %HasMeasure(pNode As %DeepSee.Query.node, ByRef pStatus As %Status) as %Boolean
Test for an existence of a measure in pNode.
• method %InitializeAxisCache(pType As %String, pAxis As axis, Output pAxisKey As %String, Output pUpToDate As %Integer, pOriginalSpec As %String = "") as %Status
Set up the axis cache for the given axis. Also test if the axis already exists and is up-to-date.
On return, pUpToDate is 1 if the axis is up-to-date, 0 if it is not, and -1 if it is a reference axis that needs further checking.
• method %InitializeResultsCache() as %Status
Prepare the results cache for this query so that it can contain the axis and cell values.
If the query is already in the results cache, then this method may decide to re-use the previous results.
• classmethod %IsAggFunc(pFunc As %String) as %Boolean
Test if pFunc is an aggregate function
• classmethod %IsCrossjoinSwapExempt(pNode1, pNode2) as %Boolean
Test to determine if the two provided crossjoin terms are swap-exempt
• method %IsExecutable(Output pStatus=$$$OK, Output pReason As %String = "") as %Boolean
Test the current query object for enabled dimensions, measures, and relationships as aplicable. If all items have completed a build process and contain queryable data, the query is executable.
• classmethod %IsMeasure(pNode As %DeepSee.Query.node, Output pStatus) as %String
Utility Method. Determine whether the current node can be considered a measure. Returns: "cell" - This node is a spreadsheet function and is exempt 1 - This node functions as a measure 0 - This node does not function as a measure
• classmethod %IsMember(pNode As %DeepSee.Query.node, Output pStatus) as %Boolean
Utility Method. Determine whether the current node can be considered a member
• method %LookupCalculatedMember(ByRef pMemberSpec As %String, pCount As %Integer, ByRef pSet As %DeepSee.Query.set, Output pSC As %Status, Output pIsFunc As %Boolean, pUseKey As %Boolean = 0) as %Boolean
See if the specified calculated member is defined.
pMemberSpec is an array of the names making up the member spec. pCount is the number of names to look at in the list. None of the names in the list should have [ ] characters around them.
If the last item in the list is the name of one of the few functions allowed on calculated dimensions, then pIsFunc is set.
• method %LookupNamedSet(pName As %String, ByRef pSet As %DeepSee.Query.set, Output pSC As %Status) as %Boolean
See if the specified named set is defined.
pName should not have [ ] characters around it.
• method %MakeReserveAxisKey(pType As %String, pAxis As axis, Output pReserveKey As %String, pOriginalSpec As %String = "") as %String
• classmethod %NullifyAxis(pAxisKey) as %Status
Set the axis to a literal null
• method %PreProcessQuery() as %Status
Execute the pre-processing logic for this node.
• method %Prepare() as %Status
Prepare this query.
This is the first step in executing a query.
• private method %PrepareResultsCache() as %Status
Called after the axes are ready, this method does the final check to determine if the query results can be re-used and if not, fills in the starting values for the result cache.
• method %PrintNode(pLevel As %Integer = 0)
Diagnostic. Print value of this node to the console.
• method %PrintStatistics()
Write out current statistics for this query.
• method %ProcessSlicerRestrictions(Output pBranches, Output pNoData As %Boolean) as %Status
Build member restriction data from the materialized slicer axis. This is called by %GetMembers to prune the results based on the current slicer.
• method %PushDownCurrentMember(Output pNewGroup As %DeepSee.Query.group, pCurrMember As %DeepSee.Query.group, pExpr As %DeepSee.Query.group, pLevel As %Integer = 0) as %Status
Push a current member down into an expression tree.
• classmethod %QueryTrace(pMethod As %String, pCubeName As %String, pMessage As %String = "") as %Status
Log a step within the execution of this query. This is an internal diagnostic.
• method %RegisterSubQuery(pMDX As %String, Output pKey As %Integer, pAxis As axis = "", pSkipWITH As %Boolean = 0) as %Status
Add the given subquery to the list of subqueries and return its key (for subsequent lookup).
• classmethod %ReleaseReservedAxes(pCubeName, pQueryKey) as %Status
Utility method to remove the zprocessing node for reserved axes
• classmethod %RemoveLabel(pReferenceGroup As %DeepSee.Query.group, Output pLabelGroup As %DeepSee.Query.group, Output pInnerGroup As %DeepSee.Query.group) as %Status
Remove the %LABEL and expose the group is is acting upon. The abstracted contents of the %LABEL are returned as the pLabelGroup.
• classmethod %RemoveLabelsInFilterExpression(pReferenceGroup As %DeepSee.Query.group, Output pOutputGroup As %DeepSee.Query.group, pCubeName As %String = "") as %Status
• method %ReserveAxes(Output pAxesAvailable) as %Status
• method %ResolveNamedParm(pParmName As %String, Output pValue As %String) as %Status
Evaluate the given named parameter and return its value.
• classmethod %ResolveVariablesInText(pMDX As %String, ByRef pVariables) as %Status
Resolve any instances of "$variable.Name" in the text pMDX using values in the lookup array pVariables.
• method %RewriteCompoundQuery(Output pMDX As %String, pPrimaryCube As %String, pSubCube As %String, Output pNonEmptyInfo) as %Status
Rewrite this query for use by a leg of a compound query.
pNonEmptyInfo indicates which axes are NON EMPTY; this is because the rewritten query does not have NON EMPTY-- it is applied at the end of the query.
• method %RewriteForCrossJoin(pParentGroup As %DeepSee.Query.group, pGroup As %DeepSee.Query.group, Output pNewGroup As %DeepSee.Query.group, pLevel As %Integer = 0) as %Status
Rewrite a group and rewrite any CJOIN(agg(a),b) to CJOIN(b,agg(a))). Do the same for expression in the first child.
• method %RewriteForCurrentMember(pParentGroup As %DeepSee.Query.group, pGroup As %DeepSee.Query.group, Output pNewGroup As %DeepSee.Query.group, ByRef pCmbrIndex, ByRef pCmbrID, Output pCmbrList, pLevel As %Integer = 0, pTreatAsExpr As %Boolean = 0) as %Status
Rewrite a group and clean up the current member functions within it. On return pCmbrIndex contains the list of cmbr substitutions: pCmbrIndex("$$CMBRn$$") = spec
pCmbrID and pCmbrList are used to track state as this function recurses.
• method %RewriteForTimeFolding(pParentGroup As %DeepSee.Query.group, pGroup As %DeepSee.Query.group, Output pNewGroup As %DeepSee.Query.group, pLevel As %Integer = 0) as %Status
Rewrite a group and rewrite any SUM(timeRange) as SUM(foldedTimeRange). Also applies to %OR().
• method %RewriteGroup(Output pNewGroup As %DeepSee.Query.group, pIsSlicer As %Boolean, pPrimaryCube As %String, pSubCube As %String, pGroup As group, ByRef pCalcMbrNames As %String) as %Status
Rewrite part of a query for use by a compound query.
• classmethod %RewriteNodeAsSubquery(pNode) as %DeepSee.Query.node
Write the node as the columns clause in an %MDX subquery.
• method %RewriteWITH(pWithText As %String, pPrimaryCube As %String, pSubCube As %String, Output pText As %String) as %Status
• method %SetVariables(ByRef pVariables) as %Status
• classmethod %SplitDate(pDate As %Date, pCalendar As %String = "gregorian", Output pYear, Output pMonth, Output pDay) as %Status
Return the last day (number) of the given year and month.
• classmethod %SplitDateRange(pStartDate As %Date, pEndDate As %Date, Output pRange, pCalendar As %String = "gregorian") as %Boolean
Given a start and end of a date range, return a set of ranges that cover the original range with as few members as possible. The higher level units are months and years. Return an array of ranges:
pRange(n) = $LB("day|month|year",start,end)
• classmethod %TestSubQueryCache(pCubeName As %String, pQueryKey As %String, pTimestamp As %String, Output pCurrent As %Boolean, pQueryCube As %String) as %Status
Given a cube, subquery key, and timestamp, determine if there is an up-to-date result cache for the query. Return true (1) if this is the case.
As a side effect, remove any out-of-date portions of the result cache for this query.
• method %ToString(Output pSC As %Status) as %String
Convert this node to its text representation.
• method %WITHToString() as %String
Convert the WITH clause for this query (named sets and calculated members) to a canonic text representation.