def __getColDistinctValsDict__(conn, cols, col_types_dict, table_name):
    distinct_vals_stmt = '''
                            select distinct {col_name}
                            from  {table_name}
                            order by {col_name};
                         '''
    #If any of the columns is of type character or varchar or text, and the number of distinct values in these columns < N (for now let's set it at 32)
    #Then 'binarize' this column's values and create a new table for this column
    col_distinct_vals_dict = {}
    for col in cols:        
        if(col_types_dict[col] in ['char','character varying', 'text']):
            #Find distinct values of the column
            stmt = distinct_vals_stmt.format(col_name=col,table_name=table_name)   
            result = psql.read_frame(stmt, conn.getConnection())
            distinct_vals = result.get(col)
            distinct_vals_dict = {}
            for i in range(len(distinct_vals)):
                distinct_vals_dict[distinct_vals[i]]=i
            
            #If the number of distinct values of a categorical column is reasonable, then add it to a mapper    
            if(len(distinct_vals) < MAX_DISTINCT_VALS):
                col_distinct_vals_dict[col] = distinct_vals_dict
                  
    return col_distinct_vals_dict
Return a dict of column name, and the set of all distinct values in the column
dataset/ETHPy150Open pivotalsoftware/pymadlib/pymadlib/utils.py/__getColDistinctValsDict__