I put Drill to the test on GeoJSON data (GeoJSON is, as the name implies, a way
to serialize geo-spatial data in JSON, see an example at the end of this post),
but found an issue.
The trouble is that geometry features are held in a vector, which is where all the
selection should happen, but how I have to figure out how to do it.
I tried this statement:
select t.features.properties.name from dfs.`/opt/drill/sample-data/geo2.json` t;
but...
Query failed: Failure while running fragment.
org.apache.drill.exec.vector.complex.RepeatedMapVector cannot be cast to
org.apache.drill.exec.vector.complex.MapVector [4098f044-ebba-4ca4-8bec-c8b2760dd2ec]
Error: exception while executing query: Failure while trying to get next result
batch. (state=,code=0)
While, specifying the vector index works as expected:
select t.features[0].properties.name from dfs.`/opt/drill/sample-data/geo2.json` t;
Help appreciated,
Luca Morandini
Data Architect - AURIN project
Melbourne eResearch Group
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature",
"geometry": {"type": "Point", "coordinates": [-75.343, 39.984]},
"properties": {
"name": "Location A",
"category": "Store"
}
},
{ "type": "Feature",
"geometry": {"type": "Point", "coordinates": [-75.833, 39.284]},
"properties": {
"name": "Location B",
"category": "House"
}
},
{ "type": "Feature",
"geometry": {"type": "Point", "coordinates": [ -75.534, 39.123]},
"properties": {
"name": "Location C",
"category": "Office"
}
}
]
}
|