mysticfall / pivot4j

Pivot4J provides a common API for OLAP servers which can be used to build an analytical service frontend with pivot style GUI.
Other
128 stars 99 forks source link

Refactor the MDX parser API #38

Closed mysticfall closed 11 years ago

mysticfall commented 11 years ago

Requirement

  1. Change the existing JPivot based parser definition to Olap4J/Mondrian based one if needed.
  2. Remove IDE warnings.
  3. Expose parser API for public use.
  4. Possibly fix #34 along the way.
  5. Provide the basis for implementing #37.
mysticfall commented 11 years ago

Fixed #34 without doing 1. It seems there's no way to achieve 2. without upgrading to jflex 2.

mysticfall commented 11 years ago

Though the parser API is now public and lot of limitations and inconsistencies in the original JPivot's codebase are fixed, there are still many improvements to be made which must affect the stability of the API.

It should be at least as consistent and intuitive as the Olap4J's parser API, and far more flexible. For example, handling of quoted identifier, or overall consistency is much better in Olap4J than the current implementation of the parser API which is based on old JPivot's codebase.

On the other hand, the Olap4J's parser API is rather limited in usefulness as it's very hard to modify (i.e. normalize) the parse tree, so our own API should try to improve in this aspect also.

I'll open separate issues for such improvements and also add additional features to Exp API such as built-in validation and normalization support in future.

mysticfall commented 11 years ago

In principle, every Exp in Pivot4J should be :

  1. Fully mutable.
  2. Can be constructed without any mandatory arguments.
  3. toMdx() should return partial/incorrect MDX for debugging purpose instead of throwing an exception when required properties are missing.
  4. Every collection properties should never return null.
  5. Visitable in cascading manner from any of its ancestors (both Olap4j and JPivot's visitor impl are defective).
  6. (Using 3.) Can be validated (separate issue #41).
  7. (Using 3.) Can be normalized (separate issue #41).