'Imports a specific query from the rdbms to hdfs
:param query: Free format query to run
:param target_dir: HDFS destination dir
:param append: Append data to an existing dataset in HDFS
:param file_type: "avro", "sequence", "text" or "parquet"
Imports data to hdfs into the specified format. Defaults to text.
:param split_by: Column of the table used to split work units
:param direct: Use direct import fast path
:param driver: Manually specify JDBC driver class to use'

def import_query(self, query, target_dir, append=False, file_type='text', split_by=None, direct=None, driver=None):

    cmd = self._import_cmd(target_dir, append, file_type, split_by, direct, driver)
    cmd += ['--query', query]
    self.Popen(cmd)
