collections.entrySet().stream() .filter(entry -> entry.getValue().stream().anyMatch(e -> e.getName().equals(projectConfig.getUserColumn()))) .map(collection -> getTableSubQuery(collection.getValue().stream().anyMatch(e -> e.getName().equals("_device_id")), collection.getKey(), connectorField, Optional.of(isText), timeColumn, dimension, startDate, endDate, Optional.empty())) approximate ? "approx_set" : "set", connectorField, connectorField, getTableSubQuery( metastore.getCollection(project, collection).stream().anyMatch(e -> e.getName().equals("_device_id")), collection, connectorField, Optional.empty(),