[Mondrian] RE: Zeros being treated as Null

Kurtis.Walker at thomsonreuters.com Kurtis.Walker at thomsonreuters.com
Fri Mar 12 08:32:26 EST 2010


All existing tests are passing with our configuration.  The fix is
really simple.  There is a check for double/int value == 0 before
setting to null.  The fix will be to add result.wasNull() to that
condition.

 

From: Julian Hyde [mailto:jhyde at pentaho.com] 
Sent: Friday, March 12, 2010 2:16 AM
To: Walker, Kurtis (Healthcare USA)
Cc: mondrian at pentaho.org
Subject: RE: Zeros being treated as Null

 

I did not intend to change the behavior. So this is a bug.

 

Not all tests are passing on all platforms/configurations. Are all tests
passing in the configuration that shows this bug? I'd rather not add a
redundant test case.

 

The changes to SegmentLoader were a performance fix, so please try not
to undo the performance improvements I made there.

 

Julian

 

	
________________________________


	From: Kurtis.Walker at thomsonreuters.com
[mailto:Kurtis.Walker at thomsonreuters.com] 
	Sent: Thursday, March 11, 2010 7:21 AM
	To: jhyde at pentaho.com
	Cc: mondrian at pentaho.org
	Subject: Zeros being treated as Null

	Julian,

	The recent changes to how Mondrian gets values from the result
set have changed how zero values are treated.  They are empty cells in
the result instead of values of zero.  I've traced this to a couple
lines in SegmentLoader(line 516 and 524), but I'd like to confirm this
was not an intended change in behavior before I commit a fix.  Thanks.  

	 

	Here is the failing test:

	 

	public void testZeroValuesAreNotTreatedAsNull() {

	        String mdx =

	            "select"

	            + "  {"

	            + "    ("

	            + "      [Product].[All
Products].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Tell
Tale].[Tell Tale Tomatos],"

	            + "      [Warehouse].[All
Warehouses].[USA].[WA].[Seattle].[Quality Warehousing and Trucking],"

	            + "      [Store].[All
Stores].[USA].[WA].[Seattle].[Store 15],"

	            + "      [Time.Weekly].[All
Time.Weeklys].[1997].[24].[3]"

	            + "  )"

	            + "  }"

	            + "  on 0,"

	            + "  [Measures].[units shipped] on 1"

	            + " from warehouse";

	        assertQueryReturns(

	            mdx,

	            "Axis #0:\n"

	            + "{}\n"

	            + "Axis #1:\n"

	            + "{[Product].[All
Products].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Tell
Tale].[Tell Tale Tomatos], "

	            + "[Warehouse].[All
Warehouses].[USA].[WA].[Seattle].[Quality Warehousing and Trucking], "

	            + "[Store].[All Stores].[USA].[WA].[Seattle].[Store
15], "

	            + "[Time].[Weekly].[All Weeklys].[1997].[24].[3]}\n"

	            + "Axis #2:\n"

	            + "{[Measures].[Units Shipped]}\n"

	            + "Row #0: .0\n");

	    }

	 

	* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * *
	Kurtis Walker
	Programmer Analyst Sr

	Thomson Reuters

	734-913-3034
	kurtis.walker at thomsonreuters.com
	thomsonreuters.com <http://thomsonreuters.com> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20100312/79cd11fe/attachment.html 


More information about the Mondrian mailing list