Opened 5 years ago

Closed 5 years ago

#230 closed defect (fixed)

WCPS count() delivers wrong value

Reported by: jyu Owned by: j.yu
Priority: major Milestone: 8.4
Component: qlparser Version: 8.3
Keywords: Cc: dmisev, hstamerjohanns
Complexity:

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 Changed 5 years ago by pbaumann

  • Owner changed from hstamerjohanns to j.yu
  • Status changed from new to assigned

comment:2 Changed 5 years ago by j.yu

similar issues happen on numerical scalar results.

comment:3 Changed 5 years ago by j.yu

  • Resolution set to fixed
  • Status changed from assigned to 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:4 Changed 5 years ago by dmisev

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

comment:5 Changed 5 years ago by dmisev

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 Changed 5 years ago by dmisev

  • Cc hstamerjohanns added
  • Version set to 8.3

comment:7 Changed 5 years ago by j.yu

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 Changed 5 years ago by dmisev

Great, thanks for checking it!

comment:9 Changed 5 years ago by dmisev

  • Resolution fixed deleted
  • Status changed from closed to 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 Changed 5 years ago by j.yu

  • Reporter changed from pbaumann to jyu

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

comment:11 Changed 5 years ago by dmisev

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 follow-up: Changed 5 years ago by dmisev

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

comment:13 in reply to: ↑ 12 Changed 5 years ago by dmisev

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 Changed 5 years ago by dmisev

  • Resolution set to fixed
  • Status changed from reopened to 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.

Note: See TracTickets for help on using tickets.