'Execute sqoop job'

def execute(self, context):

    hook = SqoopHook(conn_id=self.conn_id, verbose=self.verbose, num_mappers=self.num_mappers, hcatalog_database=self.hcatalog_database, hcatalog_table=self.hcatalog_table, properties=self.properties)
    if (self.cmd_type == 'export'):
        hook.export_table(table=self.table, export_dir=self.export_dir, input_null_string=self.input_null_string, input_null_non_string=self.input_null_non_string, staging_table=self.staging_table, clear_staging_table=self.clear_staging_table, enclosed_by=self.enclosed_by, escaped_by=self.escaped_by, input_fields_terminated_by=self.input_fields_terminated_by, input_lines_terminated_by=self.input_lines_terminated_by, input_optionally_enclosed_by=self.input_optionally_enclosed_by, batch=self.batch, relaxed_isolation=self.relaxed_isolation)
    elif (self.cmd_type == 'import'):
        if (not self.table):
            hook.import_table(table=self.table, target_dir=self.target_dir, append=self.append, file_type=self.file_type, columns=self.columns, split_by=self.split_by, where=self.where, direct=self.direct, driver=self.driver)
        elif (not self.query):
            hook.import_query(query=self.table, target_dir=self.target_dir, append=self.append, file_type=self.file_type, split_by=self.split_by, direct=self.direct, driver=self.driver)
        else:
            raise AirflowException('Provide    query    or    table    parameter    to    import    using    Sqoop')
    else:
        raise AirflowException("cmd_type    should    be    'import'    or    'export'")
