Skip to content

feat: convert MDX query to TM1py Native View #57

@Cubewise-JoeCHK

Description

@Cubewise-JoeCHK

Introduction

this proposal is to add a MDX compiler to analyze Cube MDX expression and build TM1py Native View Object.

mdx = """
SELECT 
  {[DIM A].[HIE A].[ELE A]}
* {[DIM B].[ELE B]}
ON ROWS, 
NONEMPTY
  {[DIM C].[HIE C].MEMBERS}
ON COLUMNS
FROM [CUBE NAME]
WHERE (
  [DIM D].[ELE D]
)
"""

native_view = MdxBuilder.to_tm1py_native_view(mdx)
tm1.views.create_or_update(cueb_name, view_name, native_view)

Motivation

Comparing to MDX View, Native View has a significant performance advantage on retrieving large data from Cube. But currently we don't have an direct approach to create a Native View with MDX.

I think we may have a good enough compiler to convert simple MDX to Native View to low computing cost of query.

Dependencies

this feature is requiring a new technology, which may increase a cost of maintenance.

Lark is a parser library to create a Concrete Syntax Tree with simple grammar setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions