In scruid DQL we are using vararg in some functions. For example, to specify range filtering on dimensions that contain long millisecond values we are using the intervals operator:
This is useful on queries that we explicitly define all those intervals. When, for example, we have the desired intervals in a Sequence we can use vararg expansion:
val values = Seq"2011-06-01/2012-06-01", "2012-06-01/2013-06-01", ...)
'dim intervals(values: _*)
Similarly, in cases that the intervals are in any other iterable collection of the same type, we should first convert the collection into a Sequence and thereafter use vararg expansion.
Instead of using vararg expansion and possibly conversion to a Sequence, I propose to overload the functions and create additional ones with Iterable as argument. For example, the
// remains the same
def interval(value: String): FilteringExpression = ...
// remains the same
def intervals(first: String, second: String, rest: String*): FilteringExpression = ...
// this is the additional function
def intervals(values: Iterable[String]): FilteringExpression = ...
In scruid DQL we are using vararg in some functions. For example, to specify range filtering on dimensions that contain long millisecond values we are using the
intervals
operator:This is useful on queries that we explicitly define all those intervals. When, for example, we have the desired intervals in a Sequence we can use vararg expansion:
Similarly, in cases that the intervals are in any other iterable collection of the same type, we should first convert the collection into a Sequence and thereafter use vararg expansion.
Instead of using vararg expansion and possibly conversion to a Sequence, I propose to overload the functions and create additional ones with Iterable as argument. For example, the
The same goes for operators
in
andnotIn
.