Docker and Docker-Compose have to be installed.
Run the following command in the root directory.
$ docker-compose up
When MongoDB, Drill and this NodeJS backend are started, the frontend of Drill can be started: localhost:8087
Activate the MongoDB plugin and set the following configuration (http://localhost:8047/storage/mongo
).
{
"type": "mongo",
"connection": "mongodb://mongo:27017/",
"enabled": true
}
Add a workspace in the dfs
plugin (http://localhost:8047/storage/dfs
)
"storage": {
"location": "/storage",
"writable": true,
"defaultInputFormat": null,
"allowAccessOutsideWorkspace": false
}
Fill the database with data using the requests described in the REST API section.
Drill queries can be executed directly in the drill frontend (http://localhost:8047/query
) or via NodeJS backend.
Base URL: http://localhost:3000
Write students in the database. Existing data is not overwritten. It is written directly into the database (without using Drill).
URI: /initialize
Method: GET
Sends an SQL query to Drill. Returns all students in a programme.
URI: /query/student?studyProgramme=< studyProgramme >
Method: GET
Executes a user-defined ANSI SQL query
URI: /query
Method: POST
Body:
{"query": "ANSI-SQL"}
Create a new Student. It is written directly into the database (without using Drill).
URI: /student
Method: POST
Body:
{
"id": "Number",
"firstName": "String",
"lastname": "String",
"email": "String",
"studyProgramme": "String"
}
Returns all students in the database. Without using Drill, for debugging purposes.
URI: /student
Method: GET
Deletes a student. Without using Drill, for debugging purposes.
URI: /student
Method: DELETE
Body:
{"id": "number"}
Returns all students
select * from mongo.testdb.students
Returns all student/project assignments
select student.firstname, student.lastname, project.title, project.descripton
from dfs.storage.`projects.csvh` as project
join dfs.storage.`enrollment.json` as enrollment
on project.id=enrollment.projectId
join mongo.testdb.students as student
on enrollment.studentId=student.id