Opened 9 years ago
Closed 8 years ago
#1255 closed defect (invalid)
WCPS1.5_Handle devide (/) operator in interval.
Reported by: | Bang Pham Huu | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 9.3 |
Component: | petascope | Version: | development |
Keywords: | handle devide operator | Cc: | Dimitar Misev, Vlad Merticariu |
Complexity: | Medium |
Description
The problem is in Rasql, can use the operator "/" outside of interval like in the expression below:
select csv(((max_cells(c[1,-29:100,80:110]))+((6)/(3)))) from eobstest AS c where oid(c)=1537
but cannot use inside the interval which will return error
rasql -q "select csv(((max_cells(c[((2)/(1)),-29:100,80:110]))+((6)/(3)))) from eobstest AS c where oid(c)=1537" --out string rasql: rasdaman query tool v1.0, rasdaman v9.2.0-beta1-gf79e291 -- generated on 21.01.2016 14:39:26. opening database RASBASE at localhost:7001...ok Executing retrieval query...rasdaman error 390: Execution error 390 in line 1, column 25, near token [: Minterval dimension specifications must be either of type interval or integer. aborting transaction...ok
One way to work around is using "div" operator
select csv(((max_cells(c[div(2,1),-29:100,80:110]))+ ((6)/(3)))) from eobstest AS c where oid(c)=1537
WCPS1.0 and WCPS1.5 will try to return Rasql with "/" instead of "div" then it will throw error, e.g this WCPS query
for c in (eobstest) return encode(max(c[t(2 / 1),Lat(20.5:35.1), Long(10.5:75.3)]) + 6 / 3, "csv")
in WCPS 1.0
ows:Exception exceptionCode="RasdamanRequestFailed"><ows:ExceptionText> Error evaluating rasdaman query: 'select csv(((max_cells(c[(2)/(1),-29:100,80:110]))+((6)/(3)))) from eobstest AS c where oid(c)=1537 </ows:ExceptionText> </ows:Exception><ows:Exception exceptionCode="RuntimeError"><ows:ExceptionText>org.odmg.QueryException : Execution error 390 in line 1, column 25, near token [: Minterval dimension specifications must be either of type interval or integer.
in WCPS 1.5
<ows:Exception exceptionCode="RasdamanRequestFailed"><ows:ExceptionText> Error evaluating rasdaman query: 'SELECT encode( max_cells(c[2 / 1,-29:100,81:109]) + 6 / 3, "csv" ) FROM eobstest AS c </ows:ExceptionText></ows:Exception> <ows:Exception exceptionCode="RuntimeError"><ows:ExceptionText>org.odmg.QueryException : Execution error 390 in line 1, column 27, near token [: Minterval dimension specifications must be either of type interval or integer.</ows:ExceptionText>
So there are 2 options:
+ Fix in WCPS 1.5 and change A / B to div (A, B).
+ Fix in Rasql to support "/" operator in interval, then Dimitar will do this.
I think it should be fixed in Rasql but what do you think?
Change History (4)
follow-up: 2 comment:1 by , 9 years ago
comment:2 by , 9 years ago
Replying to dmisev:
No like rasql's error says:
Minterval dimension specifications must be either of type interval or integer.There's nothing to fix in rasql. You need to cast the division to long or use div.
Cast to long work, so the problem here is interval only can be integer then it must explicit need cast. Ok, thanks for comment.
comment:3 by , 9 years ago
Priority: | major → minor |
---|
comment:4 by , 8 years ago
Milestone: | 10.0 → 9.3 |
---|---|
Resolution: | → invalid |
Status: | new → closed |
In WCPS 1.5, we don't support the numeric expression in interval, close ticket.
No like rasql's error says:
There's nothing to fix in rasql. You need to cast the division to long or use div.