def _get_col_that_is_primary(common_cols, featuregroups):
    """
    Helper method that returns the column among a shared column between featuregroups that is most often marked as
    'primary' in the hive schema.

    Args:
        :common_cols: the list of columns shared between all featuregroups
        :featuregroups: the list of featuregroups

    Returns:
        the column among a shared column between featuregroups that is most often marked as 'primary' in the hive schema
    """
    primary_counts = []
    for col in common_cols:
        primary_count = 0
        for fg in featuregroups:
            for feature in fg.features:
                if feature.name == col and feature.primary:
                    primary_count = primary_count + 1
        primary_counts.append(primary_count)
    max_no_primary = max(primary_counts)
    if max(primary_counts) == 0:
        return common_cols[0]
    else:
        return common_cols[primary_counts.index(max_no_primary)]
