| 13 | |
| 14 | ''' |
| 15 | Another information |
| 16 | ''' |
| 17 | |
| 18 | When WCPS 1.5 translates this WCPS query |
| 19 | |
| 20 | |
| 21 | {{{ |
| 22 | for c in (mr) return (2,3) |
| 23 | }}} |
| 24 | |
| 25 | to Rasql |
| 26 | |
| 27 | {{{ |
| 28 | SELECT complex(2, 3) FROM mr AS c |
| 29 | }}} |
| 30 | |
| 31 | when Petascope execute this query, it throws exception |
| 32 | |
| 33 | |
| 34 | {{{ |
| 35 | Caused by: rasj.RasTypeNotSupportedException: Exception: Base type typeName: |
| 36 | typeID: 0 |
| 37 | as RasCollectionType is not supported yet. |
| 38 | at org.rasdaman.rasnet.communication.RasRasnetImplementation.getResponse(RasRasnetImplementation.java:711) |
| 39 | at org.rasdaman.rasnet.communication.RasRasnetImplementation.queryRequest(RasRasnetImplementation.java:400) |
| 40 | at rasj.odmg.RasOQLQuery.execute(RasOQLQuery.java:254) |
| 41 | at petascope.util.ras.RasUtil.executeRasqlQuery(RasUtil.java:151) |
| 42 | }}} |
| 43 | |
| 44 | |
| 45 | However, this Rasql query can be executed normally in Rasql |
| 46 | |
| 47 | |
| 48 | {{{ |
| 49 | rasql -q 'SELECT complex(2, 3) FROM mr AS c' --out string |
| 50 | rasql: rasdaman query tool v1.0, rasdaman v9.2.0-beta1-gf79e291 -- generated on 21.01.2016 14:39:26. |
| 51 | opening database RASBASE at localhost:7001...ok |
| 52 | Executing retrieval query...ok |
| 53 | Query result collection has 1 element(s): |
| 54 | Result element 1: (2,3) |
| 55 | |
| 56 | }}} |
| 57 | |
| 58 | It works if encode complex number inside "encode( )" operator, here is example: |
| 59 | |
| 60 | |
| 61 | {{{ |
| 62 | http://localhost:8088/rasdaman/ows?service=WCS&version=2.0.1&request=ProcessCoverages&query= |
| 63 | for c in (mr) return encode(coverage complexNumber |
| 64 | over $x x (0:1),$y y (0:1) values |
| 65 | condense over $x x (0:1),$y y (0:1) |
| 66 | using (0.1, 0.1),"csv")&wcpsVersion=2.0 |
| 67 | }}} |
| 68 | |
| 69 | which returns Rasql |
| 70 | |
| 71 | |
| 72 | {{{ |
| 73 | SELECT encode( |
| 74 | MARRAY x in [0:1,209:210] VALUES |
| 75 | CONDENSE + |
| 76 | OVER x in [0:1,209:210] |
| 77 | USING complex(0.1, 0.1), "csv" ) |
| 78 | FROM mr AS c |
| 79 | }}} |
| 80 | |
| 81 | and result |
| 82 | |
| 83 | |
| 84 | {{{ |
| 85 | {(0.4, 0.4),(0.4, 0.4)},{(0.4, 0.4),(0.4, 0.4)} |
| 86 | }}} |
| 87 | |
| 88 | |
| 89 | |
| 90 | |