Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#1859 closed defect (fixed)

CREATE TYPE doesn't recognize complex/complexd cell type

Reported by: Dimitar Misev Owned by:
Priority: major Milestone: 9.8
Component: qlparser Version: development
Keywords: Cc: Peter Baumann, Vlad Merticariu
Complexity: Medium

Description

rasql -q 'CREATE TYPE test_2d_complex_mdd AS complex MDARRAY [d0, d1]'
Executing update query... rasdaman error 300: Parsing error 300 in line 1, column 36: Unexpected name complex.

rasql -q 'CREATE TYPE test_2d_complex_mdd AS complexd MDARRAY [d0, d1]'
Executing update query... rasdaman error 971: Update error 971 in line 1, column 1, near token complexd: Invalid cell type.

Furthermore, complex/complexd isn't recognized as a cast cell type.

Change History (7)

comment:1 by Dimitar Misev, 6 years ago

complex is already a command token for the complex constructor, so it's hard to reuse as a type token as well. In rasdl it's no problem as it's a separate grammar.

We could use something similar to gdal for example, which makes things clearer as well (https://www.gdal.org/gdal_8h.html#a22e22ce0a55036a96f652765793fb7a4)

CInt16
CInt32
CFloat32
CFloat64

Some data are also in CInt16 (one version of Sentinel 1 at least), related ticket: #1095

comment:2 by Dimitar Misev, 6 years ago

Cc: Peter Baumann added

comment:3 by Peter Baumann, 6 years ago

complex/complexd was an artificial token anyway, no such thing existed - hence, I see no problem in aligning it with relevant practice, such as GDAL.

comment:4 by Dimitar Misev, 6 years ago

Cc: Vlad Merticariu added

I think at the same time then it will be good to introduce aliases for the other types, e.g.

  • octet = int8
  • char = uint8
  • short = int16

These are much clearer and similarly aligned with the state of the art in C/C++, GDAL, numpy, etc.

comment:5 by Peter Baumann, 6 years ago

there were times when commonly accepted practice said "avoid being explicit about #bits as it may change as haw advances". Probably sizings have become stable over the years, and alignment with current practice (while retaining the old names) definitely is an asset.

comment:6 by Dimitar Misev, 5 years ago

Resolution: fixed
Status: newclosed

comment:7 by Dimitar Misev, 5 years ago

Milestone: Future9.8
Note: See TracTickets for help on using tickets.