Is there a way to get distinct values from multiple columns in geotools?
I know I can get unique values from a column like this:
SimpleFeatureSource featureSource = dataStore.getFeatureSource(layer);
Query query = new Query(layer, Filter.INCLUDE, new String[] { "PROPERTY_A",
"PROPERTY_B", "PROPERTY_C" });
UniqueVisitor visitor = new UniqueVisitor("PROPERTY_A");
SimpleFeatureCollection collection = featureSource.getFeatures( query );
collection.accepts(visitor, null);
Set set = visitor.getResult()
But what I need is an equivalent to select distinct PROPERTY_A, PROPERTY_B, PROPERTY_C.
Edit: I've tried to get unique values from the first column, and then create cql filters with the unique values from the first column to query unique values from the second column and so on, an then join it all in the end. But the performance, as expected, is very poor.

