def df_collectLimit(df, limit, *cols, sortCol=None):
    """Collect from a dataframe up to a limit

    :param df: dataframe to collect
    :type df: pyspark.sql.DataFrame
    :param limit: maximum number of rows to collect
    :type limit: int
    :param *cols: columns to collect
    :type *cols: str
    :param sortCol: column to sort by (so you always get the same rows if needed)
    :type sortCol: str
    :returns: collected columns of df if col specified or all the columns
    :rtype: list
    """
    if sortCol:
        df = df.sort(sortCol)

    if df.count() > limit:
        df = df.limit(limit)

    if cols:
        return df.select(*cols).collect()
    return df.collect()