def METHOD_NAME(ctx, db, ecmp_hash):
    """
    Check if ECMP hash argument is valid
    Args:
        ctx: click context
        db: State DB connector object
        ecmp_hash: ECMP hash field list
    """
    dup_list = get_dupes(ecmp_hash)
    if dup_list:
        raise click.UsageError("Invalid value for {}: {} has a duplicate hash field(s) {}".format(
            get_param_hint(ctx, "ecmp_hash"), to_str(ecmp_hash), to_str(dup_list)), ctx
        )
    entry = db.get_all(db.STATE_DB, "{}|{}".format(STATE_SWITCH_CAPABILITY, SW_CAP_KEY))
    entry.setdefault(SW_CAP_HASH_FIELD_LIST_KEY, 'N/A')
    entry.setdefault(SW_CAP_ECMP_HASH_KEY, 'false')
    if entry[SW_CAP_ECMP_HASH_KEY] == 'false':
        raise click.UsageError("Failed to configure {}: operation is not supported".format(
            get_param_hint(ctx, "ecmp_hash")), ctx
        )
    if not entry[SW_CAP_HASH_FIELD_LIST_KEY]:
        raise click.UsageError("Failed to configure {}: no hash field capabilities".format(
            get_param_hint(ctx, "ecmp_hash")), ctx
        )
    if entry[SW_CAP_HASH_FIELD_LIST_KEY] == 'N/A':
        return
    cap_list = entry[SW_CAP_HASH_FIELD_LIST_KEY].split(',')
    for hash_field in ecmp_hash:
        click.Choice(cap_list).convert(hash_field, get_param(ctx, "ecmp_hash"), ctx)