def select_categorical_gmeta_fields(metabase_cur, column_id):
    """
    Select Gmeta fields related to categorical columns.

    Note that the return value is different from other column types.

    Args:
        metabase_cur
        column_id

    Return:
        (Query result object fetched from psycopg2's DictCursor):
            Like a list of dictionaries with column names as keys. An empty
            list is returned if no record to fetch.
    """
    metabase_cur.execute(
        """
            SELECT code, frequency
            FROM metabase.code_frequency
            WHERE column_id = %(column_id)s
            ORDER BY frequency DESC
            LIMIT 20    -- Top-k
        """,
        {
            'column_id': column_id,
        },
    )

    return metabase_cur.fetchall()