def hive_data(self, app): """Performs a HIVE query and writes it to a text file.""" if HIVE_ALTERNATE is not None: self.log('Hive alternate file used') return HIVE_ALTERNATE self.log('Starting HIVE query...') if app == 'mobile': hive_file = hive.query("""SELECT guid, appos, appversion, tmain, tfirstpaint, tsessionrestored FROM addons_pings WHERE ds = '{date}' AND src='{app}';""".format(date=self.date, app=app)) else: hive_file = hive.query("""SELECT guid, appos, appversion, tmain, tfirstpaint, tsessionrestored FROM addons_pings WHERE ds = '{date}' AND src='{app}' AND guid LIKE '%972ce4c6-7e08-4474-a285-3208198ce6fd%';""".format(date=self.date, app=app)) self.time_event('hive_data') self.log('HIVE data obtained') return hive_file
def hive_data(self, app): """Performs a HIVE query and writes it to a text file.""" if HIVE_ALTERNATE is not None: self.log('Hive alternate file used') return HIVE_ALTERNATE self.log('Starting HIVE query...') if app == 'mobile': hive_file = hive.query("""SELECT guid, COUNT(1) as num FROM addons_pings WHERE ds = '{date}' AND src='{app}' GROUP BY guid ORDER BY num;""".format(date=self.date, app=app)) else: hive_file = hive.query("""SELECT guid, COUNT(1) as num FROM addons_pings WHERE ds = '{date}' AND src='{app}' AND guid LIKE '%972ce4c6-7e08-4474-a285-3208198ce6fd%' GROUP BY guid ORDER BY num;""".format(date=self.date, app=app)) self.time_event('hive_data') self.log('HIVE data obtained') return hive_file