def _filter_relevant_datasets(datasets, load_columns):
    """
    Filter datasets so only ones that actually load columns are left.

    Parameters
    ----------
    datasets: Dict[str, kartothek.core.dataset.DatasetMetadata]
        Datasets to filter.
    load_columns: Dict[str, Set[str]]
        Columns to load.

    Returns
    -------
    datasets: Dict[str, kartothek.core.dataset.DatasetMetadata]
        Filtered datasets.
    """
    which = set(load_columns.keys())
    return {
        ktk_cube_dataset_id: ds
        for ktk_cube_dataset_id, ds in datasets.items()
        if ktk_cube_dataset_id in which
    }