Options

Sample C++ code for LAP with Custom C++ UDTF

BHIFPBHIFP Vertica Customer
edited September 2021 in General Discussion

Would like to test out LAP with custom C++ UDTF similar to below found at the bottom of
https://www.vertica.com/docs/10.1.x/HTML/Content/Authoring/AnalyzingData/AggregatedData/UDTSupport.htm, but I couldn't find the UDTF code for aggregated_proj and stv_intersect anywhere.

Please share a link. Thanks

CREATE TABLE points( point_id INTEGER, point_type VARCHAR(10), coordinates GEOMETRY(100));

CREATE PROJECTION aggregated_proj
   AS SELECT point_type, aggregate_classified_points( sq.point_id, sq.polygon_id) 
   OVER (PARTITION BATCH BY point_type)
   FROM 
      (SELECT point_type, stv_intersect(
         point_id, coordinates USING PARAMETERS index=‘polygons’ )
       OVER (PARTITION PREPASS BY point_type) AS (point_id, polygon_id) FROM points) sq;

Answers

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file