https://github.com/apache/asterixdb
https://asterixdb.apache.org/docs/0.8.8-incubating/aql/primer.html
https://ci.apache.org/projects/asterixdb/aql/js-sdk.html
https://asterixdb.apache.org/docs/0.8.8-incubating/aql/primer-sql-like.html
use dataverse TinySocial;
load dataset FacebookUsers using localfs
(("path"="localhost:///home/culqi/understanding_asterixdb/face.adm"),("format"="adm"));
load dataset FacebookMessages using localfs
(("path"="localhost:///home/culqi/understanding_asterixdb/facems.adm"),("format"="adm"));
load dataset TwitterUsers using localfs
(("path"="localhost:///home/culqi/understanding_asterixdb/twt.adm"),("format"="adm"));
load dataset TweetMessages using localfs
(("path"="localhost:///home/culqi/understanding_asterixdb/twtms.adm"),("format"="adm"));
- [DOC] Query 6 - Existential Quantification empty result (review)
https://issues.apache.org/jira/browse/ASTERIXDB-1327?jql=text%20~%20%22spatial_intersect%22
drop dataverse channels if exists;
create dataverse channels;
use dataverse channels;
create type UserLocation as closed {
recordId: uuid,
location: point,
user-id: string,
timeoffset: float
}
create type EmergencyReport as closed {
reportId: uuid,
severity: int,
impactZone: circle,
timeoffset: float,
duration: float,
message: string,
emergencyType: string
}
create dataset UserLocations(UserLocation)
primary key recordId autogenerated;
create dataset EmergencyReports(EmergencyReport)
primary key reportId autogenerated;
load dataset UserLocations using localfs
(("path"="localhost:///home/culqi/understanding_asterixdb/UserLocationsShort.adm"),("format"="adm"));
load dataset EmergencyReports using localfs
(("path"="localhost:///home/culqi/understanding_asterixdb/EmergencyReports.adm"),("format"="adm"));
QUERIES
use dataverse channels;
for $report in dataset EmergencyReports
for $location in dataset UserLocations
where $report.emergencyType = "earthquake"
let $circle := create-circle($location.location,.1)
where spatial-intersect($report.impactZone, $circle)
return {
"user at":$location.location,
"report at":$report.impactZone
}