implementing a query evaluator
- given a table Schema and CSV File with the instance in it
- Use JSQLParser to parse given query file
- convert the given parsed query to relational algebra tree
Queries
Your code is expected to support both aggregate and non-aggregate queries with the following features. Keep in mind that this is only a minimum requirement.
* Non-Aggregate Queries
* SelectItems may include:
* SelectExpressionItem: Any expression that Eval can evaluate. Note that Column expressions may or may not include an appropriate source. Where relevant, column aliases will be given, unless the SelectExpressionItem's expression is a Column (in which case the Column's name attribute should be used as an alias)
* AllTableColumns: For any aliased term in the from clause
* AllColumns: If present, this will be the only SelectItem in a given PlainSelect.
* Aggregate Queries
* SelectItems may include:
* SelectExpressionItems where the Expression is one of:
* A Function with the (case-insensitive) name: SUM, COUNT, AVG, MIN or MAX. The Function's argument(s) may be any expression(s) that can be evaluated by Eval.
* A Single Column that also occurs in the GroupBy list.
* AllTableColumns: If all of the table's columns also occur in the GroupBy list
* AllColumns: If all of the source's columns also occur in the GroupBy list.
* GroupBy column references are all Columns.
* Both Types of Queries
* From/Joins may include:
* Join: All joins will be simple joins
* Table: Tables may or may not be aliased. Non-Aliased tables should be treated as being aliased to the table's name.
* SubSelect: SubSelects may be aggregate or non-aggregate queries, as here.
* The Where/Having clauses may include:
* Any expression that Eval will evaluate to an instance of BooleanValue
* Allowable Select Options include
* SELECT DISTINCT (but not SELECT DISTINCT ON)
* UNION ALL (but not UNION)
* Order By: The OrderByItem expressions may include any expression that can be evaluated by Eval. Columns in the OrderByItem expressions will refer only to aliases defined in the SelectItems (i.e., the output schema of the query's projection. See TPC-H Benchmark Query 5 for an example of this)
* Limit: RowCount limits (e.g., LIMIT 5), but not Offset limits (e.g., LIMIT 5 OFFSET 10) or JDBC parameter limits.
Output
Your code is expected output query results in the same format as the input data:
* One output row per ('\n'-delimited) line. If there is no ORDER BY clause, you may emit the rows in any order.
* One output value per ('|'-delimited) field. Columns should appear in the same order that they appear in the query. Table Wildcards should be resolved in the same order that the columns appear in the CREATE TABLE statement. Global Wildcards should be resolved as Table Wildcards with the tables in the same order that they appear in the FROM clause.
* A trailing newline as the last character of the file.
* You should not output any header information or other formatting.
I am an IITK graduate, 9 year experienced software professional and I have got top notch developers in my team, who have got experience across a span of technologies. The members in my team have worked with top notch tech organization such as Amazon, Cisco, Oracle etc. We have been involved in similar projects in the past and our track record has been excellent.
Hello
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I can do it
I can do it
I can do it
I can do it
I can do it
I can do it
I can do it
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
thanks