def import_from(connection_context, directory, replace=False, threads=1):
    """
    Import data into the SAP HANA.

    Parameters
    ----------
    connection_context : ConnectionContext
        A connection to the SAP HANA system.

    directory : str
        Specifies the location where the import source is found. Specify <archive_file_name> if the import data is in an archive file. The archive file must have the file extension .tar.gz or .tgz.

    replace : bool, optional
        Defines the behavior if the import data already exists in the database. When specified, if a table defined in the import data currently exists in the database, then it is dropped and recreated before the data is imported. If the REPLACE option is not specified, then an error is thrown if an existing database table is defined in the import data.

        Defaults to False.
    threads : int, optional
        The number of threads used for import.

        Defaults to 1.
    """
    import_options = []
    if replace is True:
        import_options.append('REPLACE')
    if threads > 1:
        import_options.append('THREADS {}'.format(threads))
    options = ''
    if len(import_options) > 1:
        options = 'WITH {}'.format(' '.join(import_options))
    query = 'IMPORT ALL FROM {0} {1}'.format(directory, options)
    with connection_context.connection.cursor() as cur:
        cur.execute(query)
