Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: [Mondrian] Zeros being treated as Null

  1. #1
    Guest

    Default [Mondrian] 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 (DOT) com
    thomsonreuters.com <http://thomsonreuters.com>


    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  2. #2
    Julian Hyde Guest

    Default [Mondrian] 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 (DOT) com
    [mailto:Kurtis.Walker (AT) thomsonreuters (DOT) com]
    Sent: Thursday, March 11, 2010 7:21 AM
    To: jhyde (AT) pentaho (DOT) com
    Cc: mondrian (AT) pentaho (DOT) 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 (DOT) com
    <http://thomsonreuters.com> thomsonreuters.com


    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  3. #3
    Guest

    Default [Mondrian] RE: Zeros being treated as Null

    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 (DOT) com]
    Sent: Friday, March 12, 2010 2:16 AM
    To: Walker, Kurtis (Healthcare USA)
    Cc: mondrian (AT) pentaho (DOT) 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 (DOT) com
    [mailto:Kurtis.Walker (AT) thomsonreuters (DOT) com]
    Sent: Thursday, March 11, 2010 7:21 AM
    To: jhyde (AT) pentaho (DOT) com
    Cc: mondrian (AT) pentaho (DOT) 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 (DOT) com
    thomsonreuters.com <http://thomsonreuters.com>


    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  4. #4
    Sergio Ramazzina Guest

    Default Re: [Mondrian] RE: Zeros being treated as Null

    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  5. #5
    Guest

    Default RE: [Mondrian] RE: Zeros being treated as Null

    Only if the rows that you are missing should have had values of zero.
    I've checked in a fix with changelist 13467.



    Kurt



    From: mondrian-bounces (AT) pentaho (DOT) org [mailto:mondrian-bounces (AT) pentaho (DOT) org]
    On Behalf Of Sergio Ramazzina
    Sent: Friday, March 12, 2010 9:54 AM
    To: jhyde (AT) pentaho (DOT) com; Mondrian developer mailing list
    Subject: Re: [Mondrian] RE: Zeros being treated as Null



    Julian,

    Can the issue we get with the usage of the NOT EMPTY function be related
    with this change?

    Regards
    Sergio

    On 03/12/2010 08:16 AM, Julian Hyde wrote:

    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 (DOT) com
    [mailto:Kurtis.Walker (AT) thomsonreuters (DOT) com]
    Sent: Thursday, March 11, 2010 7:21 AM
    To: jhyde (AT) pentaho (DOT) com
    Cc: mondrian (AT) pentaho (DOT) 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 (DOT) com
    thomsonreuters.com <http://thomsonreuters.com>



    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian





    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.