Use case matching and val2keyFunc to map rdd