[Mondrian] NonEmptyTest.testConstrainedMeasureGetsOptimized

Kurtis.Walker at thomsonreuters.com Kurtis.Walker at thomsonreuters.com
Wed Jan 6 10:49:15 EST 2010


I checked in changelist 13287 for Oracle on jdk 1.6.

 

For the failure on 1.5, the order of the "and" conditions are different
from 1.6, the sql would still produce the correct results though.  Any
hints on how I can make the test work with both?

 

Kurt

 

From: Julian Hyde [mailto:jhyde at pentaho.com] 
Sent: Tuesday, January 05, 2010 1:35 PM
To: Walker, Kurtis (Healthcare USA); mondrian at pentaho.org;
mkambol at gmail.com
Subject: RE: [Mondrian] NonEmptyTest.testConstrainedMeasureGetsOptimized

 

Hudson runs against MySQL, not Oracle.

 

Nothing special about the environment. It's JDK 1.6 linux, oracle-xe
10.2. When I run it on JDK 1.5 I get 4 different failures in
NonEmptyTest:

 

[java] There were 4 failures:

[java] 1)
testNativeCrossjoinWillConstrainUsingArgsFromAllAxes(mondrian.rolap.NonE
mptyTest)junit.framework.AssertionFailedError: expected query [select
"time_by_day"."the_year" as "c0", "promotion"."promotion_name" as "c1"
from "time_by_day" "time_by_day", "sales_fact_1997" "sales_fact_1997",
"promotion" "promotion", "customer" "customer" where
"sales_fact_1997"."time_id" = "time_by_day"."time_id" and
"sales_fact_1997"."promotion_id" = "promotion"."promotion_id" and
("promotion"."promotion_name" in ('Bag Stuffers', 'Best Savings')) and
"sales_fact_1997"."customer_id" = "customer"."customer_id" and
("customer"."gender" = 'F') and ("time_by_day"."the_year" = 1997) group
by "time_by_day"."the_year", "promotion"."promotion_name" order by 1
ASC, 2 ASC] did not occur

[java] at
mondrian.rolap.BatchTestCase.assertQuerySqlOrNot(BatchTestCase.java:427)

[java] at
mondrian.rolap.BatchTestCase.assertQuerySql(BatchTestCase.java:294)

[java] at
mondrian.rolap.NonEmptyTest.testNativeCrossjoinWillConstrainUsingArgsFro
mAllAxes(NonEmptyTest.java:3678)

[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

[java] at
mondrian.test.MondrianTestRunner$2.run(MondrianTestRunner.java:139)

[java] at java.lang.Thread.run(Thread.java:595)

[java] 2)
testNativeCrossjoinWillExpandFirstLastChild(mondrian.rolap.NonEmptyTest)
junit.framework.AssertionFailedError: expected query [select
"time_by_day"."the_year" as "c0", "promotion"."promotion_name" as "c1"
from "time_by_day" "time_by_day", "sales_fact_1997" "sales_fact_1997",
"promotion" "promotion", "customer" "customer" where
"sales_fact_1997"."time_id" = "time_by_day"."time_id" and
"sales_fact_1997"."promotion_id" = "promotion"."promotion_id" and
"sales_fact_1997"."customer_id" = "customer"."customer_id" and
("customer"."gender" in ('F', 'M')) and ("promotion"."promotion_name" in
('Bag Stuffers', 'Best Savings')) and ("time_by_day"."the_year" = 1997)
group by "time_by_day"."the_year", "promotion"."promotion_name" order by
1 ASC, 2 ASC] did not occur

[java] at
mondrian.rolap.BatchTestCase.assertQuerySqlOrNot(BatchTestCase.java:427)

[java] at
mondrian.rolap.BatchTestCase.assertQuerySql(BatchTestCase.java:294)

[java] at
mondrian.rolap.NonEmptyTest.testNativeCrossjoinWillExpandFirstLastChild(
NonEmptyTest.java:3732)

[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

[java] at
mondrian.test.MondrianTestRunner$2.run(MondrianTestRunner.java:139)

[java] at java.lang.Thread.run(Thread.java:595)

[java] 3)
testNativeCrossjoinWillExpandLagInNamedSet(mondrian.rolap.NonEmptyTest)j
unit.framework.AssertionFailedError: expected query [select
"time_by_day"."the_year" as "c0", "promotion"."promotion_name" as "c1"
from "time_by_day" "time_by_day", "sales_fact_1997" "sales_fact_1997",
"promotion" "promotion", "customer" "customer" where
"sales_fact_1997"."time_id" = "time_by_day"."time_id" and
"sales_fact_1997"."promotion_id" = "promotion"."promotion_id" and
"sales_fact_1997"."customer_id" = "customer"."customer_id" and
("customer"."gender" in ('F', 'M')) and ("promotion"."promotion_name" in
('Bag Stuffers', 'Best Savings')) and ("time_by_day"."the_year" = 1997)
group by "time_by_day"."the_year", "promotion"."promotion_name" order by
1 ASC, 2 ASC] did not occur

[java] at
mondrian.rolap.BatchTestCase.assertQuerySqlOrNot(BatchTestCase.java:427)

[java] at
mondrian.rolap.BatchTestCase.assertQuerySql(BatchTestCase.java:294)

[java] at
mondrian.rolap.NonEmptyTest.testNativeCrossjoinWillExpandLagInNamedSet(N
onEmptyTest.java:3756)

[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

[java] at
mondrian.test.MondrianTestRunner$2.run(MondrianTestRunner.java:139)

[java] at java.lang.Thread.run(Thread.java:595)

[java] 4)
testConstrainedMeasureGetsOptimized(mondrian.rolap.NonEmptyTest)junit.fr
amework.AssertionFailedError: expected query [select
"customer"."country" as "c0", "customer"."state_province" as "c1",
"customer"."city" as "c2", "customer"."customer_id" as "c3", "fname" ||
' ' || "lname" as "c4", "fname" || ' ' || "lname" as "c5",
"customer"."gender" as "c6", "customer"."marital_status" as "c7",
"customer"."education" as "c8", "customer"."yearly_income" as "c9" from
"customer" "customer", "sales_fact_1997" "sales_fact_1997" where
"sales_fact_1997"."customer_id" = "customer"."customer_id" and
("customer"."gender" in ('M', 'F')) group by "customer"."country",
"customer"."state_province", "customer"."city",
"customer"."customer_id", "fname" || ' ' || "lname",
"customer"."gender", "customer"."marital_status",
"customer"."education", "customer"."yearly_income" order by
"customer"."country" ASC, "customer"."state_province" ASC,
"customer"."city" ASC, "fname" || ' ' || "lname" ASC] did not occur

[java] at
mondrian.rolap.BatchTestCase.assertQuerySqlOrNot(BatchTestCase.java:427)

[java] at
mondrian.rolap.BatchTestCase.assertQuerySql(BatchTestCase.java:294)

[java] at
mondrian.rolap.NonEmptyTest.testConstrainedMeasureGetsOptimized(NonEmpty
Test.java:3795)

[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

[java] at
mondrian.test.MondrianTestRunner$2.run(MondrianTestRunner.java:139)

[java] at java.lang.Thread.run(Thread.java:595)

 

Can you look into those failures also.

I notice that ('F', 'M') occurs in some queries, ('M', 'F') in others.
This is a hint that there is non-determinism in your code. Make sure you
are not relying on iterator order of hashmaps or hashsets.

 

Julian


 

________________________________

	From: Kurtis.Walker at thomsonreuters.com
[mailto:Kurtis.Walker at thomsonreuters.com] 
	Sent: Tuesday, January 05, 2010 9:59 AM
	To: jhyde at pentaho.com; mondrian at pentaho.org; mkambol at gmail.com
	Subject: RE: [Mondrian]
NonEmptyTest.testConstrainedMeasureGetsOptimized

	Julian,

	 

	Our environment is Oracle and the test is passing.  Is there
anything else different about the environment where it fails?  Also, we
thought that the Hudson build ran against Oracle.  The Hudson build is
green right now, so are we incorrect that it runs against Oracle?

	 

	Kurt

	 

	From: mondrian-bounces at pentaho.org
[mailto:mondrian-bounces at pentaho.org] On Behalf Of Julian Hyde
	Sent: Tuesday, January 05, 2010 12:41 PM
	To: 'Matt Campbell'
	Cc: 'Mondrian developer mailing list'
	Subject: [Mondrian]
NonEmptyTest.testConstrainedMeasureGetsOptimized

	 

	Matt,

	 

	NonEmptyTest.testConstrainedMeasureGetsOptimized is failing on
Oracle:

	[java] There was 1 failure:

	[java] 1)
testConstrainedMeasureGetsOptimized(mondrian.rolap.NonEmptyTest)junit.fr
amework.AssertionFailedError: expected query [select
"customer"."country" as "c0", "customer"."state_province" as "c1",
"customer"."city" as "c2", "customer"."customer_id" as "c3", "fname" ||
' ' || "lname" as "c4", "fname" || ' ' || "lname" as "c5",
"customer"."gender" as "c6", "customer"."marital_status" as "c7",
"customer"."education" as "c8", "customer"."yearly_income" as "c9" from
"customer" "customer", "sales_fact_1997" "sales_fact_1997" where
"sales_fact_1997"."customer_id" = "customer"."customer_id" and
("customer"."gender" in ('M', 'F')) group by "customer"."country",
"customer"."state_province", "customer"."city",
"customer"."customer_id", "fname" || ' ' || "lname",
"customer"."gender", "customer"."marital_status",
"customer"."education", "customer"."yearly_income" order by
"customer"."country" ASC, "customer"."state_province" ASC,
"customer"."city" ASC, "fname" || ' ' || "lname" ASC] did not occur

	[java] at
mondrian.rolap.BatchTestCase.assertQuerySqlOrNot(BatchTestCase.java:427)

	[java] at
mondrian.rolap.BatchTestCase.assertQuerySql(BatchTestCase.java:294)

	[java] at
mondrian.rolap.NonEmptyTest.testConstrainedMeasureGetsOptimized(NonEmpty
Test.java:3795)

	[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)

	[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

	[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

	[java] at
mondrian.test.MondrianTestRunner$2.run(MondrianTestRunner.java:139)

	[java] at java.lang.Thread.run(Thread.java:619)

	 

	Julian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20100106/6541516e/attachment.html 


More information about the Mondrian mailing list