Starting from:

$20

CSE512-Assignment 2 Parallel-Sort and Parallel-Join Solved

The required task is to build a generic parallel sort and parallel join algorithm. 

1.     Implement a Python function ParallelSort() that takes as input: (1) InputTable stored in a PostgreSQL database, (2) SortingColumnName  the name of the column used to order the tuples by. ParallelSort() then sorts all tuples (using five parallelized threads) and stores the sorted tuples for in a table named OutputTable (the output table name is passed to the function). The OutputTable contains all the tuple present in InputTable sorted in ascending order. 

 

Function Interface: - 

ParallelSort (InputTable, SortingColumnName,  OutputTable, openconnection) InputTable – Name of the table on which sorting needs to be done. 

SortingColumnName  – Name of the column on which sorting needs to be done, would be either of type integer or real or float. Basically Numeric format. Will be Sorted in Ascending order. 

OutputTable – Name of the table where the output needs to be stored. 

openconnection – connection to the database. 

 

2.     Implement a Python function ParallelJoin() that takes as input: (1) InputTable1 and InputTable2 table stored in a PostgreSQL database, (2) Table1JoinColumn  and Table2JoinColumn  that represent the join key in each input table respectively. ParallelJoin() then joins both InputTable1 and InputTable2 (using five parallelized threads) and stored the resulting joined tuples in a table named OutputTable (the output table name is passed to the function). The schema of OutputTable should be 

InputTable1.Column1, InputTable.Column2, …, InputTable2.Column1, InputTable2.Column2…. 

 

Function Interface: - 

ParallelJoin (InputTable1, InputTable2, Table1JoinColumn,  Table2JoinColumn, 

OutputTable, openconnection) 

InputTable1 – Name of the first table on which you need to perform join. 

InputTable2 – Name of the second table on which you need to perform join. 

Table1JoinColumn  – Name of the column from first table i.e. join key for first table. Table2JoinColumn  – Name of the column from second table i.e. join key for second table. 

OutputTable - Name of the table where the output needs to be stored. 

openconnection – connection to the database. 

 

Naming Convention to be followed strictly: 

    Database name – dds_assignment2 

    Postgres User name – postgres     Postgres password – 1234 

 

Instructions on how this will be tested: - Please follow these instructions closely. 

1.      Two tables would be created in the database manually. 

2.      The created tables would contain at least an integer field, which would be used for both Parallel Sorting and Parallel Joining. 

3.      Then, the ParallelSort() and ParallelJoin() Function would be called to check the correctness of the program. 

4.      Your code should use 5 threads for both ParallelSort() as well as ParallelJoin(). 

5.      Your code should be able to handle table irrespective of its schema. 

6.      Do not make your code dependent on any particular table; it should be able to work on any table and any given input columns.  

 

 

More products