'Upload data found at filepath to HDFS home of user, the load intto a specific partition'

def load_partition(self, django_user, partition_spec, filepath):

    LOAD_PARTITION_HQL = "\n                        ALTER    TABLE    %(tablename)s    ADD    PARTITION(%(partition_spec)s)    LOCATION    '%(filepath)s'\n                        "
    partition_dir = self._get_partition_dir(partition_spec)
    hdfs_root_destination = self._get_hdfs_root_destination(django_user, subdir=partition_dir)
    filename = filepath.split('/')[(-1)]
    hdfs_file_destination = self._upload_to_hdfs(django_user, filepath, hdfs_root_destination, filename)
    hql = (LOAD_PARTITION_HQL % {'tablename': self.name, 'partition_spec': partition_spec, 'filepath': hdfs_root_destination})
    LOG.info(('Running    load    query:    %s' % hql))
    self._load_data_to_table(django_user, hql, hdfs_file_destination)
