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 , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 12 years ago
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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:5 by , 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 , 12 years ago
Cc: | added |
---|---|
Version: | → 8.3 |
comment:7 by , 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:9 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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 , 12 years ago
Reporter: | changed from | to
---|
What is the result in the log? It should work, as I test that by wget at that time.
comment:11 by , 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.
follow-up: 13 comment:12 by , 12 years ago
I suspect it's the reason why some Earthlook fail recently
comment:13 by , 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 , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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.
similar issues happen on numerical scalar results.