Opened 15 years ago

Last modified 11 years ago

#15 closed enhancement

condense max and min bug — at Version 11

Reported by: Dirk Daems Owned by: Jinsongdi Yu
Priority: critical Milestone: 8.5
Component: qlparser Version: 8.0
Keywords: condense construct Cc: Dimitar Misev, Vlad Merticariu, Alex Dumitru
Complexity: Hard

Description (last modified by Dirk Daems)

Doesn't seem to work in the pre-release of v9.0.
Got the following exception using the last WCPS query listed in this ticket:

WcpsError: Invalid coverage Expression, next node: condense - Invalid coverage Expression, next node: condense
        at petascope.wcps.server.core.CoverageExpr.<init>(CoverageExpr.java:171)
        at petascope.wcps.server.core.ConstructCoverageExpr.<init>(ConstructCoverageExpr.java:87)
        at petascope.wcps.server.core.CoverageExpr.<init>(CoverageExpr.java:94)
        at petascope.wcps.server.core.EncodeDataExpr.<init>(EncodeDataExpr.java:77)
        at petascope.wcps.server.core.XmlQuery.startParsing(XmlQuery.java:120)
        at petascope.wcps.server.core.ProcessCoveragesRequest.<init>(ProcessCoveragesRequest.java:102)
        at petascope.wcps.server.core.Wcps.pcPrepare(Wcps.java:118)
        at petascope.wcps.server.core.Wcps.pcPrepare(Wcps.java:112)
        at petascope.wcps.server.servlet.WcpsServlet.doPost(WcpsServlet.java:181)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:722)

System tests involving condense min / max also fail.

Change History (11)

comment:1 by cj, 15 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed

there is no such operator max or min (i.e. writing max(1,2) will also not be recognized). So the problem is not in the condenser per se but in the grammar. Closing the ticket.

comment:2 by Peter Baumann, 15 years ago

Resolution: fixed
Status: closedreopened
Type: defectenhancement

the documentation in the QL Guide indeed lists these operations, so they should be supported.

comment:3 by Dimitar Misev, 13 years ago

Owner: set to Dimitar Misev
Status: reopenedaccepted

comment:4 by Peter Baumann, 12 years ago

Milestone: 9.0
Owner: changed from Dimitar Misev to Jinsongdi Yu
Status: acceptedassigned

comment:5 by Piero Campalani, 12 years ago

Complexity: Very Hard

Hi there,

in the meantime, a workaround for WCPS condense expressions with min and max — leading to this unsupported RasQL condense operations — is achieved by either using a direct min() operator call, or either, in case of a condense operation nested into a coverage constructor, replacing the nested condensation with a min(<coverageConstr>).
E.g.

for c in (mean_summer_airtemp)
  return encode(
     coverage mincov
     over     $px x (100:101)
     values   min(
        coverage mincov
        over     $py y (300:301)
        values   c[x:"CRS:1"($px), y:"CRS:1"($py)]
     )
  ), "csv")

Instead of:

for c in (mean_summer_airtemp)
  return encode(
     coverage mincov
     over     $px x (100:101)
     values   (
        condense min
        over     $py y (300:301)
        values   c[x:"CRS:1"($px), y:"CRS:1"($py)]
     )
  ), "csv")

comment:6 by Piero Campalani, 12 years ago

Complexity: Very HardMedium

comment:7 by abeccati, 12 years ago

Milestone: 9.08.5

comment:8 by Jinsongdi Yu, 11 years ago

Resolution: fixed
Status: assignedclosed

comment:9 by Dimitar Misev, 11 years ago

Resolution: fixed
Status: closedreopened

Seems like it was fixed in rasql but not yet in WCPS.

in reply to:  5 comment:10 by Dimitar Misev, 11 years ago

Resolution: fixed
Status: reopenedclosed

Replying to pcampalani:

Instead of:

for c in (mean_summer_airtemp)
  return encode(
     coverage mincov
     over     $px x (100:101)
     values   (
        condense min
        over     $py y (300:301)
        values   c[x:"CRS:1"($px), y:"CRS:1"($py)]
     )
  ), "csv")

Actually it's working in WCPS too, note that condense should have using, not values. I've added a test in the WCPS tests.

for c in (mean_summer_airtemp)
  return encode(
     coverage mincov
     over     $px x (100:101)
     values   (
        condense min
        over     $py y (300:301)
        using    c[x:"CRS:1"($px), y:"CRS:1"($py)]
     )
  ), "csv")

comment:11 by Dirk Daems, 11 years ago

Description: modified (diff)
Reporter: changed from j.yu@… to Dirk Daems
Resolution: fixed
Status: closedreopened
Note: See TracTickets for help on using tickets.