K class operated by ANA will not gain any miles on SQ. If you have ANA FFP it will gain 30% of miles actually flown. Star Alliance is based on operating company not the ticketing one. If you are flying UA metal you will gain 100% mileage no matter what class of Y your are on.