Add support for distinct_on