Opened 12 years ago

Closed 12 years ago

#230 closed defect (fixed)

WCPS count() delivers wrong value

Reported by: jyu Owned by: Jinsongdi Yu
Priority: major Milestone: 8.4
Component: qlparser Version: 8.3
Keywords: Cc: Dimitar Misev, Heinrich Stamerjohanns
Complexity: Medium

Description

on Earthlook in the WCPS sandbox there is the example query

for c in ( NIR )
return

count( c.1 = 0 )

This returns 1091043328 which seems to be wrong in face of about 2 mPixels.

Change History (14)

comment:1 by Peter Baumann, 12 years ago

Owner: changed from Heinrich Stamerjohanns to Jinsongdi Yu
Status: newassigned

comment:2 by Jinsongdi Yu, 12 years ago

similar issues happen on numerical scalar results.

comment:3 by Jinsongdi Yu, 12 years ago

Resolution: fixed
Status: assignedclosed

should avoid the String.getBytes() method for OutputStream, because that uses the default encoding of the JVM, and it can't be reliably predicted in a portable way.

comment:4 by Dimitar Misev, 12 years ago

Did you test the fix, what number do you get now for the above query?

comment:5 by Dimitar Misev, 12 years ago

I'm getting 2113 without applying your patch btw, so something tells me that this bug has already been solved by Heinrich's patch for a related ticket, that fixed an endiannes bug in rasserver. This patch has not yet been propagated to earthlook however so there we still see a wrong value.

comment:6 by Dimitar Misev, 12 years ago

Cc: Heinrich Stamerjohanns added
Version: 8.3

comment:7 by Jinsongdi Yu, 12 years ago

the rasql result is correct when I check out the patch yesterday, however, the OutputStream of petascope interprets the byte in a different. The result is a different number, when it is OutputStream(String.getBytes()), because that uses the default encoding of the JVM, and it can't be reliably predicted in a portable way. After introducing PrintStream, the petascope return the same value as the rasql. I have tested that.

comment:8 by Dimitar Misev, 12 years ago

Great, thanks for checking it!

comment:9 by Dimitar Misev, 12 years ago

Resolution: fixed
Status: closedreopened

Jinsongdi, your fix has broken evaluation of WCPS queries when sent via GET request.

You can test with request like

http://localhost:8080/petascope?query=for c in (rgb) return encode (c, "PNG")

Before your fix this works fine, after your fix it doesn't.

comment:10 by Jinsongdi Yu, 12 years ago

Reporter: changed from Peter Baumann to jyu

What is the result in the log? It should work, as I test that by wget at that time.

comment:11 by Dimitar Misev, 12 years ago

There are no errors or anything problematic reported, everything is executed fine but no result seems to be returned. Try it in firefox.

comment:12 by Dimitar Misev, 12 years ago

I suspect it's the reason why some Earthlook fail recently

in reply to:  12 comment:13 by Dimitar Misev, 12 years ago

Replying to dmisev:

I suspect it's the reason why some Earthlook fail recently

Ok the demos are back working after reverting your patch. Note that the count query result in this ticket was not fixed by your patch.

comment:14 by Dimitar Misev, 12 years ago

Resolution: fixed
Status: reopenedclosed

I submitted a small fix to your patch regarding the WCPS queries returning only scalar results: you were closing the output stream before the images were written to it.

I also fixed the bug in this ticket, which turned out to be rasdaman enterprise specific, so we can close this ticket.

Note: See TracTickets for help on using tickets.