tag:blogger.com,1999:blog-5672165237896126100.post6537313086400326400..comments2022-03-27T08:59:33.430-07:00Comments on Julian Hyde on Streaming Data, Open Source OLAP. And stuff.: Formatting MDX as plain textJulian Hydehttp://www.blogger.com/profile/17816795169191026372noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-5672165237896126100.post-25540007825347790822009-04-18T17:59:00.000-07:002009-04-18T17:59:00.000-07:00Luc,
I totally agree. Laying out MDX results as g...Luc,<br /><br />I totally agree. Laying out MDX results as grids is not trivial, so it should be common code.<br /><br />I've <A HREF="http://olap4j.svn.sourceforge.net/olap4j/?rev=156&view=rev" REL="nofollow">moved the code</A> from inner classes of mondrian's TestContext class to org.olap4j.query.CellSetFormatter and a couple of sub-classes. The RectangularCellSetFormatter is capable of quite complex formatting, including cellsets of which have any number of axes (not just the usual 2) and where some of the axes may be empty. Both of the styles I called 'MySQL' and 'Oracle' are supported.<br /><br />The classes are marked 'experimental', which will give you or anyone else interested free reign to refactor into a multidimensional equivalent of Java's TableModel.<br /><br />I put them in the org.olap4j.query package because a programmer-friendly model for displaying MDX results seems very closely related to the programmer-friendly model for forming queries.<br /><br />JulianJulian Hydehttps://www.blogger.com/profile/17816795169191026372noreply@blogger.comtag:blogger.com,1999:blog-5672165237896126100.post-46563323234595464012009-04-18T17:55:00.000-07:002009-04-18T17:55:00.000-07:00This comment has been removed by the author.Julian Hydehttps://www.blogger.com/profile/17816795169191026372noreply@blogger.comtag:blogger.com,1999:blog-5672165237896126100.post-71975431913986879092009-04-13T10:40:00.000-07:002009-04-13T10:40:00.000-07:00It could be useful to include this code in Olap4j ...It could be useful to include this code in Olap4j in a separate package, but instead of limiting this new package to a simple 'text display' function, why not create one to support MDX tables?<BR/><BR/>Let me explain...<BR/><BR/>I thought about that a few weeks ago while working on Pentaho Analysis Tool. As far as I know, there are no 'java wide' open source table model to work with multidimensional tables. Thomas Morgner might have coded one actually for his Report Designer, but last time I checked (versions < 2.0) there was no such thing.<BR/><BR/>It could be a great feature to have a common API for multidimensional tables. There is definitely a need for a multidimensional equivalent of Java's basic TableModel. <BR/><BR/>Insights?Luc Boudreauhttps://www.blogger.com/profile/17962022808245057116noreply@blogger.comtag:blogger.com,1999:blog-5672165237896126100.post-35205967633497252009-04-11T15:32:00.000-07:002009-04-11T15:32:00.000-07:00Roland,CellSet would be the obvious place to put t...Roland,<BR/><BR/>CellSet would be the obvious place to put this, because you're formatting a CellSet after all, but I agree, it would also absolutely the wrong place to put it. (People often overdo the object-oriented programming: just because functionality relates to a particular class, it doesn't mean that the code should be glued onto that class.) CellSet is one of the core workhorse interfaces in olap4j (analogous to JDBC's ResultSet) so it should not be cluttered with extra functionality.<BR/><BR/>But even if it is not absolutely essential, it is useful to a lot of people, so I would like to package it with olap4j somehow. The org.olap4j.query package relates to forming and processing queries from an end-user's perspective, so I might add a Formatter class there.<BR/><BR/>Interesting point about the text result being parseable. I would not make this a goal of the rectangular output. I would create another format that is easily parseable and somewhat readable. In my opinion, the traditional format meets that goal; suggestions for other formats are welcome.<BR/><BR/>JulianJulian Hydehttps://www.blogger.com/profile/17816795169191026372noreply@blogger.comtag:blogger.com,1999:blog-5672165237896126100.post-10161499347421127142009-04-11T11:41:00.000-07:002009-04-11T11:41:00.000-07:00Hi Julian,I think the code belongs in olap4j, it's...Hi Julian,<BR/><BR/>I think the code belongs in olap4j, it's not Mondrian specific, it's useful also when connecting from a non-Mondrian olap4j client.<BR/><BR/>And I like the Mysql output better but both are very nice!<BR/><BR/>Thanks!<BR/><BR/>Calin MedianuCalinhttps://www.blogger.com/profile/06334314012581512422noreply@blogger.comtag:blogger.com,1999:blog-5672165237896126100.post-45262979989464065892009-04-11T00:41:00.000-07:002009-04-11T00:41:00.000-07:00Hi!re #1, I just glanced through the spec (http://...Hi!<BR/><BR/>re #1, I just glanced through the spec (http://olap4j.svn.sourceforge.net/viewvc/olap4j/trunk/doc/olap4j_fs.html) and I didn't seen anything relating to text output formats of the CellSet, CellSetMetadata and friends (is this the level I should be thinking of?). So for that reason I would not mix it with the olap4jcode because it would not be clear to what part of the spec it relates.<BR/><BR/>That said, I think this is incredibly useful stuff!!! So it'd be really nice if you could configure mondrian to pick a particular formatter.<BR/><BR/>re #2, well, It seems that it would be reaaly nice if it'd be easy for other tools to do something with the text result. It seems that what you call "MySQL format" is most suitable for that, as you can easily parse the result by scanning for the pipe and dash characters. <BR/><BR/>(Many people will perhaps disagree, but I can imagine that for some purposes, a scriptable command-line style client that provides this kind of output is exactly the right tool for the job - not everybody is capable if writing their own formatter directly in java whereas there are plenty tools to deal with csv-like text data)<BR/><BR/>just my 2ctrpboumanhttps://www.blogger.com/profile/13365137747952711328noreply@blogger.comtag:blogger.com,1999:blog-5672165237896126100.post-40525056307757295722009-04-10T17:49:00.000-07:002009-04-10T17:49:00.000-07:00By the way, if line-wrapping prevents you from see...By the way, if line-wrapping prevents you from seeing the tables properly, try reducing your browser's font size a bit.Julian Hydehttps://www.blogger.com/profile/17816795169191026372noreply@blogger.com