heavyai / rbc

Remote Backend Compiler
https://rbc.readthedocs.io
BSD 3-Clause "New" or "Revised" License
30 stars 10 forks source link

Add support for GeoPoint and GeoLineString #523

Closed guilhermeleobas closed 1 year ago

guilhermeleobas commented 1 year ago

Requires https://github.com/heavyai/heavydb-internal/pull/7126

This pull request adds support for three HeavyDB Geo column types (GeoLineString, GeoPoint and Point2D) and common operations:

Structure of each type:

struct ColumnGeo[LineString/Point] {
  int8_t* flatbuffer;
  int64_t size;
};

struct GeoLineString {
  int8_t* flatbuffer_;
  int64_t index1;
  int64_t index2;
  int64_t index3;
  int64_t index4;
  int32_t n_;
}

struct Point2D {
  float64 x, y;
};

Caveats

Parser doesn’t handle template specialization

Current parser implementation doesn’t handle subtype alias. So, Column<GeoPoint> isn’t redirected to HeavyDBColumnGeoPointType, but rather HeavyDBColumnType. To circumvent this limitation, there’s a short-circuit in HeavyDBColumnType::postprocess_type which redirects the implementation to the correct type.

guilhermeleobas commented 1 year ago

Before approving or requesting changes, I'll try it out and look into the typesystem issue.

Ok. I'll edit the first comment to include a description of what I did and what is currently supported. And about the typesystem issue, we don't have to address it right now, as the workaround I did works.

guilhermeleobas commented 1 year ago

Closing it in favor of #537