Opened 11 years ago
Closed 10 years ago
#588 closed defect (fixed)
Casting problems with RasQL's CSV encoding
Reported by: | Piero Campalani | Owned by: | Veranika Liaukevich |
---|---|---|---|
Priority: | minor | Milestone: | 9.0.x |
Component: | conversion | Version: | development |
Keywords: | cast rasql csv | Cc: | mantovani@… |
Complexity: | Medium |
Description
RasQL has some supposedly unexpected behaviors which might unveil some bug in the handling of data types and casting.
This might also be related with #434.
A couple of RasQL examples (with --string
output):
- 12
"select csv(pow(1, 2.0)) from eobstest AS c" Result object 1: {0} --> WRONG
- (long)12
select csv((long)pow(1, 2.0)) from eobstest AS c Result object 1: {1} --> OK
- ln(10.0)
select csv(ln(10.0)) from eobstest AS c Result object 1: {0} --> WRONG
- (float)ln(10.0)
select csv((float)ln(10.0)) from eobstest AS c Result object 1: {2.30259} --> OK
Change History (15)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Cc: | added |
---|---|
Keywords: | cast rasql added |
Yes, I verified already that csv was not the issue. I forgot to mention that:
select csv(pow(10, 1.0)) from eobstest AS c Result object 1: 7b 30 7d select csv((long)pow(10, 1.0)) from eobstest AS c" Result object 1: 7b 31 30 7d
comment:3 by , 11 years ago
No Piero, I mean remove the csv, like this
select pow(10, 1.0) from eobstest AS c
comment:4 by , 11 years ago
I'm getting correct result without the csv, so it's an issue in the source:conversion/csv.cc converter.
comment:5 by , 11 years ago
Component: | undecided → conversion |
---|
comment:6 by , 11 years ago
I think the issue here is that csv does not work with single scalar values, but with MDD objects only.
$ rasql -q 'select csv(marray i in [0:0] values pow(10, 1.0)) from test_grey AS c' --out string Result object 1: {10} $ rasql -q 'select csv(pow(10, 1.0)) from test_grey AS c' --out string: Result object 1: {0} $ rasql -q 'select pow(10, 1.0) from test_grey AS c' --out string Result element 1: 10
Possibly the cast produces an MDD out of the scalar and that's why it works, but I'm not sure.
comment:7 by , 11 years ago
Ah ok, I thought encoding was mandatory.
Actually the result is ok without csv encoding:
select pow(10, 1.0) from eobstest AS c where oid(c)=154625" Result element 1: 10
Despite this, it seems that the --output
argument is ignored when no encoding is specified in the query and the result is a scalar: that is, the above query gives 10
and not "0A
if I set --output hex
. As well for instance select avg_cell(pow((c) [3,52:54,151], 2.0)) from eobstest as c
returns a string
(1.69838e+06) output though it is set to hex.
Maybe this deserves a separate ticket.
comment:8 by , 11 years ago
An other use case:
select csv(((pow(191, 1.0))/(10))) from whatever AS c" Result object 1: {191.019} select (((pow(191, 1.0))/(10))) from whatever AS c" Result element 1: 19.1
comment:9 by , 11 years ago
Complexity: | Medium → Hard |
---|---|
Keywords: | csv added |
Summary: | Casting problems with RasQL → Casting problems with RasQL's CSV encoding |
comment:10 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Uneeb could look at this along while solving with #586
@Uneeb: the queries in the description of this ticket should all produce the same result.
comment:12 by , 11 years ago
Priority: | critical → minor |
---|
Lowering priority since WCPS queries can still allow non-CSV encoded scalar expressions.
comment:13 by , 10 years ago
Owner: | changed from | to
---|
comment:14 by , 10 years ago
Complexity: | Hard → Medium |
---|---|
Milestone: | → 9.0.x |
comment:15 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in changeset:6c4924b999b154ad.
Can you try with
--output hex
and remove the csv, so we can see if it's an csv error or something further down?