rubin-dp0 / Support

Submit Github Issues related to DP0
MIT License
1 stars 3 forks source link

[BUG] incorrect typing causes incorrect sorting #12

Closed RoyWilliams closed 3 years ago

RoyWilliams commented 3 years ago

Describe the bug Subtracting two double's should be a double not a char

To Reproduce

  1. Go to Firefly portal
  2. Choose TAP service = RSP
  3. Choose ADQL
  4. Enter this query and click Search SELECT mag_g,mag_r, mag_g-mag_r as color FROM dp01_dc2_catalogs.object WHERE CONTAINS(POINT('ICRS', ra, dec),CIRCLE('ICRS', 55, -35, 1))=1 AND (mag_g <21 AND mag_r <21)

Expected behavior If I click on the sort button in the display, it should sort as doubles, not as chars

Actual behavior Seems strange that "color" is a char field. If I click on the sort button in the display it sorts alphabetically instead of numerically mag_g-mag_r

Additional context However, if I add "ORDER BY color DESC" to my ADQL, then the sorting is correct.

frossie commented 3 years ago

Thanks for the report, we are investigating which is the offending layer of the sandwich

fritzm commented 3 years ago

Verified that Qserv is returning correctly typed result data to TAP for this query.

frossie commented 3 years ago

We have rolled out a fix to this. @RoyWilliams please give it a try.

RoyWilliams commented 3 years ago

Looks great! Thank you!

frossie commented 3 years ago

For the record, fix upstreamed to CADC, h/t @cbanek