def getColumns(fields, columns="all"):
    if columns == "all":
        return list(range(len(fields)))
    elif columns == "all-but-first":
        return list(range(1, len(fields)))
    else:
        map_field2column = dict([(y, x) for x, y in enumerate(fields)])
        c = []
        for x in columns.split(","):
            if x in map_field2column:
                c.append(map_field2column[x])
            else:
                c.append(int(x) - 1)
        return c

##########################################################
##########################################################
##########################################################
Creates a DROP statement that gets rid of the temporary table.
dataset/ETHPy150Open CGATOxford/cgat/scripts/table2table.py/getColumns--crossover with--dataset/ETHPy150Open california-civic-data-coalition/django-postgres-copy/postgres_copy/__init__.py/CopyMapping.prep_drop