def test100_execute_mysql_query(self): # drop target table if exists ddl = "drop table if exists %s.%s" % (self.mysql_db, self.mysql_table) try: legoo.execute_mysql_query(mysql_host=self.mysql_host, mysql_db=self.mysql_db, mysql_query=ddl) except: self.fail("execute_mysql_query failed")
def test100_execute_mysql_query(self): # drop target table if exists ddl = "drop table if exists %s.%s" % (self.mysql_db, self.mysql_table) try: legoo.execute_mysql_query(mysql_host = self.mysql_host, \ mysql_db = self.mysql_db, \ mysql_query = ddl) except: self.fail("execute_mysql_query failed")
def test999_clean_up(self): # drop MySQL test table ddl = "drop table if exists %s.%s" % (self.mysql_db, self.mysql_table) legoo.execute_mysql_query(mysql_host=self.mysql_host, mysql_db=self.mysql_db, mysql_query=ddl) # drop HIVE test table ddl = "drop table if exists %s.%s" % (self.hive_db, self.hive_table) legoo.execute_remote_hive_query(hive_node=self.hive_node, hive_db=self.hive_db, hive_query=ddl) # remove test csv from hive export legoo.remove_file(file=self.hive_export_csv) # remove test csv from mysql export legoo.remove_file(file=self.mysql_export_csv)
def test320_hive_to_mysql(self): try: ddl = "drop table if exists %s.%s" % ( self.mysql_db, self.mysql_table) legoo.execute_mysql_query(mysql_host = self.mysql_host, \ mysql_db = self.mysql_db, \ mysql_query = ddl) legoo.hive_to_mysql(hive_node = self.hive_node, hive_db = self.hive_db, \ hive_table = self.hive_table, \ mapred_job_priority='VERY_HIGH', csv_delimiter='tab', \ mysql_host = self.mysql_host, mysql_db = self.mysql_db, \ mysql_create_table='Y', mysql_table = self.mysql_table) except: self.fail("hive_to_mysql with optiion mysql_create_table failed")
def test320_hive_to_mysql(self): try: ddl = "drop table if exists %s.%s" % (self.mysql_db, self.mysql_table) legoo.execute_mysql_query(mysql_host = self.mysql_host, \ mysql_db = self.mysql_db, \ mysql_query = ddl) legoo.hive_to_mysql(hive_node = self.hive_node, hive_db = self.hive_db, \ hive_table = self.hive_table, \ mapred_job_priority='VERY_HIGH', csv_delimiter='tab', \ mysql_host = self.mysql_host, mysql_db = self.mysql_db, \ mysql_create_table='Y', mysql_table = self.mysql_table) except: self.fail("hive_to_mysql with optiion mysql_create_table failed")
def test999_clean_up(self): # drop MySQL test table ddl = "drop table if exists %s.%s" % (self.mysql_db, self.mysql_table) legoo.execute_mysql_query(mysql_host = self.mysql_host, \ mysql_db = self.mysql_db, \ mysql_query = ddl) # drop HIVE test table ddl = "drop table if exists %s.%s" % (self.hive_db, self.hive_table) legoo.execute_remote_hive_query(hive_node = self.hive_node, \ hive_db = self.hive_db, \ hive_query = ddl) # remove test csv from hive export legoo.remove_file(file=self.hive_export_csv) # remove test csv from mysql export legoo.remove_file(file=self.mysql_export_csv)