ICS 421 - Spring 2010 - Programming Assignment 3

Updated Mar 22 to fix localnode.driver.

Updated Mar 12 to include policy on grammar sharing.

Updated Mar 12 to include temporary table information.

You may work in a team of two students, but each student needs to make a submission. You are encouraged to engage in general discussions with other teams regarding the assignment, but specific details of a solution, including the solution itself, must always be the team's own work. You may submit the same code as the rest of your team.

Part 5: Distributed SQL Processor Supporting Joins (100 pts)

Modify your code from Part 3 (runSQL) to support select-from-where queries involving joins between exactly two tables. The two tables to be joined may be distributed tables with fragments residing on multiple nodes. The input to runSQL consists of two filenames (stored in variables clustercfg and sqlfile) passed in as commandline arguments. The file clustercfg contains access information for the catalog DB. The file sqlfile contains the SQL terminated by a semi-colon to be executed. The join query needs to be executed on multiple threads; However, you should develop the sequential non-multi-threaded version first. Guidance will be provided on how to convert the join QEP into a multi-threaded one.

runSQL should output the rows retrieved to the standard output on success or report failure.

You may assumed that the SQL queries only operate on at most two tables and do not contain any nested subqueries.

You should consider using the ANTLR compiler compiler to generate a SQL parser that you can use to extract the table names and to detect the join conditions. Only equi-joins need to be supported.

Policy on grammar sharing You may discuss, share, and/or develop the grammar with other groups.

You may test your program on a single computer by using different databases to simulate the multiple computers.

Sample contents of a clustercfg file

localnode identifies the node in the cluster that received the query and that will co-ordinate the execution of the query.

Sample contents of a sqlfile file

Sample Output of `./run3.sh ./cluster.cfg ./sailors.sql`

It is recommended that you develop your program in the following steps

You may need to use temporary tables for your joins. On DB2 you will need to use the following statement: DECLARE GLOBAL TEMPORARY TABLE.

General Requirements

Submission Procedure


antlrworks.jar is installed in /home/db2inst1/lib/antlrworks.jar on the submission machine

Follow the Submission Procedure