try: #Creating Database ddsassignment2 print "Creating Database named as " + DATABASE_NAME Assignment1.createDB(DATABASE_NAME) # Getting connection to the database print "Getting connection from the " + DATABASE_NAME + " database" con = Assignment1.getOpenConnection(dbname=DATABASE_NAME) # Clear the database existing tables print "Delete tables" Assignment1.deleteTables('all', con) # Loading Ratings table print "Creating and Loading the ratings table" Assignment1.loadRatings('ratings', 'test_data.txt', con) # Doing Range Partition print "Doing the Range Partitions" Assignment1.rangePartition('ratings', 5, con) # Doing Round Robin Partition print "Doing the Round Robin Partitions" Assignment1.roundRobinPartition('ratings', 5, con) # Deleting Ratings Table because Point Query and Range Query should not use ratings table instead they should use partitions. Assignment1.deleteTables('ratings', con) # Calling RangeQuery print "Performing Range Query" Assignment2.RangeQuery('ratings', 2, 3, con)
if cursor: cursor.close() if __name__ == '__main__': try: # Creating Database print "Creating Database named as " + DATABASE_NAME createDB() # Getting connection to the database print "Getting connection from the " + DATABASE_NAME + " database" con = getOpenConnection(dbname=DATABASE_NAME) #Loading two tables ratings and movies Assignment1.loadRatings('ratings', 'ratings.txt', con) loadMovies('movies', 'movies.txt', con) # Calling ParallelSort print "Performing Parallel Sort" Assignment3.ParallelSort('ratings', 'Rating', 'parallelSortOutputTable', con) #Loading two tables ratings and movies Assignment1.loadRatings('ratings', 'ratings.txt', con) loadMovies('movies', 'movies.txt', con) # Calling ParallelJoin print "Performing Parallel Join" Assignment3.ParallelJoin('ratings', 'movies', 'MovieId', 'MovieId1', 'parallelJoinOutputTable', con)
import Assignment1 as Assignment1 import Assignment2_Interface as Assignment2 if __name__ == '__main__': try: #Creating Database ddsassignment2 print "Creating Database named as ddsassignment2" Assignment1.createDB(); # Getting connection to the database print "Getting connection from the ddsassignment2 database" con = Assignment1.getOpenConnection(); # Loading Ratings table print "Creating and Loading the ratings table" Assignment1.loadRatings('ratings', 'test_data.dat', con); # Doing Range Partition print "Doing the Range Partitions" Assignment1.rangePartition('ratings', 5, con); # Doing Round Robin Partition print "Doing the Round Robin Partitions" Assignment1.roundRobinPartition('ratings', 5, con); # Deleting Ratings Table because Point Query and Range Query should not use ratings table instead they should use partitions. Assignment1.deleteTables('ratings', con); # Calling RangeQuery print "\n" + "Performing Range Query"
try: #Creating Database ddsassignment2 print "Creating Database named as ddsassignment2" Assignment1.createDB(); # Getting connection to the database print "Getting connection from the ddsassignment2 database" con = Assignment1.getOpenConnection(); # Clear the database existing tables print "Delete tables" Assignment1.deleteTables('all', con); # Loading Ratings table print "Creating and Loading the ratings table" Assignment1.loadRatings('ratings', 'v1.dat', con); # Doing Range Partition print "Doing the Range Partitions" Assignment1.rangePartition('ratings', 5, con); # Doing Round Robin Partition print "Doing the Round Robin Partitions" Assignment1.roundRobinPartition('ratings', 5, con); # Deleting Ratings Table because Point Query and Range Query should not use ratings table instead they should use partitions. Assignment1.deleteTables('ratings', con); # Calling RangeQuery print "Performing Range Query" Assignment2.RangeQuery(1.5, 3.5, con, "./rangeResult.txt");
try: #Creating Database ddsassignment2 print "Creating Database named as " + DATABASE_NAME Assignment1.createDB(DATABASE_NAME); # Getting connection to the database print "Getting connection from the "+ DATABASE_NAME + " database" con = Assignment1.getOpenConnection(dbname=DATABASE_NAME); # Clear the database existing tables print "Delete tables" Assignment1.deleteTables('all', con); # Loading Ratings table print "Creating and Loading the ratings table" Assignment1.loadRatings('ratings', '../ml-10M100K/ratings_small.dat', con); # Doing Range Partition print "Doing the Range Partitions" Assignment1.rangePartition('ratings', 5, con); # Doing Round Robin Partition print "Doing the Round Robin Partitions" Assignment1.roundRobinPartition('ratings', 5, con); # Deleting Ratings Table because Point Query and Range Query should not use ratings table instead they should use partitions. Assignment1.deleteTables('ratings', con); # Calling RangeQuery #print "Performing Range Query" #Assignment2.RangeQuery('ratings',1.5 ,3.5, con);
import Assignment1 as Assignment1 import Assignment2_Interface as Assignment2 if __name__ == '__main__': try: # Creating Database ddsassignment2 print "Creating Database named as ddsassignment2" Assignment1.createDB(); # Getting connection to the database print "Getting connection from the ddsassignment2 database" con = Assignment1.getOpenConnection(); # Loading Ratings table print "Creating and Loading the ratings table" Assignment1.loadRatings('ratings', 'ratings.dat', con); # Doing Range Partition print "Doing the Range Partitions" Assignment1.rangePartition('ratings', 5, con); # Doing Round Robin Partition print "Doing the Round Robin Partitions" Assignment1.roundRobinPartition('ratings', 5, con); # Deleting Ratings Table because Point Query and Range Query should not use ratings table instead they should use partitions. Assignment1.deleteTables('ratings', con); # Calling RangeQuery print "Performing Range Query" Assignment2.RangeQuery('ratings', 1.5, 3.5, con);