[ 
https://issues.apache.org/jira/browse/CALCITE-2546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16615270#comment-16615270
 ] 

Vladimir Sitnikov commented on CALCITE-2546:
--------------------------------------------

[~julianhyde], unfortunately, "json to string" is performed in 
[https://github.com/apache/calcite/blob/d23e529515ce0eb6e0c150052fe3d2c5d90f1747/core/src/main/java/org/apache/calcite/util/JsonBuilder.java#L98]
 (which is a production code, not test code)

I don't like very much the idea to put "3 digits precision" limit there.

If only that was a test code...

 

What is your take on use of Jackson for Map -> JSON conversion?

It has pluggable strategies, so we can add "rounding" strategy for the test.

 

Jackson's 
[JsonGenerator|https://fasterxml.github.io/jackson-core/javadoc/2.8/com/fasterxml/jackson/core/JsonGenerator.html]
 might be useful to write out Json as well (instead of 
calcite/util/JsonBuilder). 

 

Note: we can start easy and use Jackson for Map -> String conversion in TEST 
code: {{org.apache.calcite.profile.ProfilerTest.Fluid.StatisticToJson}} , then 
see how it goes. Any objections?

I like that approach better than adding "math floor" to Profiler code.



 

> testProfileScott2 in ProfilerTest.java fail with java.lang.AssertionError
> -------------------------------------------------------------------------
>
>                 Key: CALCITE-2546
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2546
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>         Environment: uname -a
> Linux pts00607-vm2 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:30:22 UTC 
> 2016 ppc64le ppc64le ppc64le GNU/Linux
>            Reporter: Alisha Prabhu
>            Assignee: Julian Hyde
>            Priority: Major
>              Labels: ppc64le
>         Attachments: Error.txt
>
>
> Maven command used in the core module : mvn 
> -Dtest=ProfilerTest#testProfileScott2 test
> The values expectedCardinality and surprise for columns:[HIREDATE,COMM] in 
> the test case differ on power platform.
>     Expected values : 
> expectedCardinality:12.682618485430247,surprise:0.4344728973121492
>     On ppc64le        :  
> expectedCardinality:12.682618485430254,surprise:0.43447289731214944
> The test case has passed on x86_64.
> The attached Error.txt file has the error log seen on power.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to