Skip to content

Enable Excel XMLA drill-through by implementing MDSCHEMA_ACTIONS and fixing HIERARCHY_ORIGIN null safety#3

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/implement-excel-drill-through
Closed

Enable Excel XMLA drill-through by implementing MDSCHEMA_ACTIONS and fixing HIERARCHY_ORIGIN null safety#3
Copilot wants to merge 2 commits into
mainfrom
copilot/implement-excel-drill-through

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 1, 2026

Excel's "Show Details" (drill-through) on XMLA PivotTables was silently disabled because Mondrian returned no rows for MDSCHEMA_ACTIONS — the discovery request Excel uses to gate the feature. This also adds a null-safety fix for virtual hierarchies in MDSCHEMA_HIERARCHIES.

MDSCHEMA_ACTIONS — populate drill-through actions per cube

MdschemaActionsRowset.populateImpl() was a no-op. Now emits one Drillthrough action row per visible cube:

Column Value
ACTION_NAME "Drillthrough"
ACTION_TYPE 256 (MDACTION_TYPE_ROWSET)
COORDINATE_TYPE 1 (MDACTION_COORDINATE_CUBE)
INVOCATION 1 (interactive)
CUBE_SOURCE 1 (cube)

Three previously stubbed-out columns (ACTION_TYPE, INVOCATION, CUBE_SOURCE) are now defined and included in the rowset schema. Full restriction filtering (catalog / schema / cube / action name) is wired up via makeCondition.

HIERARCHY_ORIGIN null safety

MdschemaHierarchiesRowset dereferenced xmlHierarchy.origin without null-checking xmlHierarchy itself — a crash path for virtual hierarchies. Now guarded:

if (xmlHierarchy == null || xmlHierarchy.origin == null
    || xmlHierarchy.origin.isEmpty())
{
    hierarchyOrigin = 1; // MD_ORIGIN_USER_DEFINED
} else {
    try {
        hierarchyOrigin = Integer.parseInt(xmlHierarchy.origin);
    } catch (NumberFormatException e) {
        hierarchyOrigin = 1;
    }
}

Test reference XML updates

  • XmlaBasicTest.ref.xmltestMDActions response now expects 7 action rows (one per FoodMart cube) with the full column schema.
  • XmlaBasicTest.ref.xml, XmlaExcel2000Test.ref.xml, XmlaExcelXPTest.ref.xmlDISCOVER_SCHEMA_ROWSETS entries for MDSCHEMA_ACTIONS updated to advertise the new restriction columns.

Integration tests

Added to DrillThroughTest:

  • testExcelStyleDrillThroughWithColumnsAndRows — exercises the exact MDX pattern Excel generates (WITH calculated members, FILTER on both axes, RETURN clause).
  • testDrillThroughWithColumnsAndRowsAxes — baseline check that DRILLTHROUGH with explicit ON COLUMNS / ON ROWS returns rows.

Copilot AI and others added 2 commits April 1, 2026 18:07
@dronsv
Copy link
Copy Markdown
Owner

dronsv commented May 3, 2026

Closing — MDSCHEMA_ACTIONS support and DRILLTHROUGH_ACTION_NAME constant are already on main (RowsetDefinition.java:4389+). PR is stale; branch will be deleted.

@dronsv dronsv closed this May 3, 2026
@dronsv dronsv deleted the copilot/implement-excel-drill-through branch May 3, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants