Http Server for Query Retrieval
This implementation creates an API server providing HTTP service (denoted as S). Server S handles the query for information from a table. It supports 4 query operators: “==” equal, “!=” not equal, “$=” equal (case insensitive), “&=” contain (the query term is a substring of the data cell). Each predicate P is defined on a column (C1, C2, or C3) or all columns (*), with an query term (a string wrapped in “"”). For example: “* &= “123” ” yields true when the value of any column in a row contains “123”. A query may contains several predicates which concatenated with “and” or “or”.
If the query is malformed, the server rejects query processing and try to point out the issue within the query. The error message should be helpful to the user for efficient query correction. The result is the set of data rows that the query matches. The format of the data is CSV with column headers.
The program provides an API accessable from localhost, with port # 9527. The query url should have the form “127.0.0.1:9527/?query=