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("Performing Range Query") Assignment2.RangeQuery(1.5, 3.5, con, "./rangeResult.txt") #Assignment2.RangeQuery(1,4,con, "./rangeResult.txt"); # Calling PointQuery print("Performing Point Query") Assignment2.PointQuery(4.5, con, "./pointResult.txt") #Assignment2.PointQuery('2,con, "./pointResult.txt"); # Deleting All Tables Assignment1.deleteTables('all', con) if con: con.close() except Exception as detail: print("Something bad has happened!!! This is the error ==> ", detail)
try: # Creating Database ddsassignment2 print("Creating Database named as dds_assignment2") createDB(DATABASE_NAME) # Getting connection to the database print("Getting connection from the dds_assignment2 database") con = getOpenConnection(dbname=DATABASE_NAME) #Loading two tables ratings and movies loadRatings('ratings', 'ratings.dat', con) loadMovies('movies', 'movies.dat', con) # Calling ParallelSort print("Performing Parallel Sort") Assignment2.ParallelSort('ratings', 'Rating', 'parallelSortOutputTable', con) a = input( "Check in database and once you are done, press enter to delete all tables: " ) deleteTables('ALL', con) #Loading two tables ratings and movies loadRatings('ratings', 'ratings.dat', con) loadMovies('movies', 'movies.dat', con) # Calling ParallelJoin print("Performing Parallel Join") Assignment2.ParallelJoin('ratings', 'movies', 'MovieId', 'MovieId1', 'parallelJoinOutputTable', con) a = input( "Check in database and once you are done, press enter to delete all tables: " )
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) # Calling PointQuery print "Performing Point Query" Assignment2.PointQuery('ratings', 4.5, con) # Deleting All Tables Assignment1.deleteTables('all', con) if con: con.close() except Exception as detail: print "Something bad has happened!!! This is the error ==> ", detail
# 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") Assignment2.RangeQuery(1,4,con, "./rangeResult.txt") # Calling PointQuery print("Performing Point Query") #Assignment2.PointQuery(4.5, con, "./pointResult.txt") Assignment2.PointQuery(5,con, "./pointResult.txt") # Deleting All Tables Assignment1.deleteTables('all', con) if con: con.close() except Exception as detail: print("Something bad has happened!!! This is the error ==> ", detail)
# 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); Assignment2.RangeQuery('ratings',1,4,con); # Calling PointQuery print "Performing Point Query" #Assignment2.PointQuery('ratings', 4.5, con); Assignment2.PointQuery('ratings',2,con); #Deleting All Tables #Assignment1.deleteTables('all', con); if con: con.close() except Exception as detail: print "Something bad has happened!!! This is the error ==> ", detail
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', 1, con) # Doing Round Robin Partition print "Doing the Round Robin Partitions" Assignment1.roundRobinPartition('ratings', 1, 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', 0, 0, con) # Calling PointQuery print "Performing Point Query" Assignment2.PointQuery('ratings', 5.0, con) # Deleting All Tables Assignment1.deleteTables('all', con) if con: con.close() except Exception as detail: print "Something bad has happened!!! This is the error ==> ", detail