I am using the ESRI framework that extends the Hive syntax to support spatial types and operations.
In particular, I am trying to use an aggregated geometry function, announced in this blog post in 2013.
What I would like to do, is to generate a bunch of buffers around some points, and then dissolve them using ST_Aggr_Union.
create table buffers as select ST_Aggr_Union(ST_Buffer(tweets.geom,0.5)) as geom from tweets join grid_cnt where ST_Contains(grid_cnt.geom,tweets.geom)=true and ptcnt>6;
The query fails with a Map Reduce error:
Hadoop job information for Stage-2: number of mappers: 0; number of reducers: 0 2015-01-21 12:55:21,758 Stage-2 map = 0%, reduce = 0% Ended Job = job_local1494455277_0007 with errors Error during job, obtaining debugging information... Job Tracking URL: http://localhost:8080/ FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask MapReduce Jobs Launched: Stage-Stage-2: HDFS Read: 0 HDFS Write: 0 FAIL Total MapReduce CPU Time Spent: 0 msec
If I do the query without the ST_Aggr_Union function, it runs without problems.
Just to be sure, I also tried to reproduce the example in the blog post:
SELECT ST_AsText(ST_Aggr_Union(ST_Point(earthquakes.longitude, earthquakes.latitude))) FROM earthquakes JOIN counties_json counties WHERE counties.name = ‘San Bernardino’ AND earthquakes.magnitude > 6 AND ST_Contains(counties.shape, ST_Point(earthquakes.longitude, earthquakes.latitude));
It fails, with the exact same error. Could it be a bug?