fix multiple toplevel dimfilters

This commit is contained in:
xvrl 2013-03-04 16:18:42 -08:00
parent d1c128bdbf
commit ae682d2cbb
1 changed files with 10 additions and 6 deletions

View File

@ -203,12 +203,16 @@ constant returns [ConstantPostAggregator c]
/* time filters must be top level filters */
timeAndDimFilter returns [DimFilter filter, org.joda.time.Interval interval]
: t=timeFilter (AND f=dimFilter)? {
if($f.ctx != null) $filter = $f.filter;
$interval = $t.interval;
}
| (f=dimFilter)? AND t=timeFilter {
if($f.ctx != null) $filter = $f.filter;
: (f1=dimFilter AND)? t=timeFilter (AND f2=dimFilter)? {
if($f1.ctx != null || $f2.ctx != null) {
if($f1.ctx != null && $f2.ctx != null) {
$filter = new AndDimFilter(Lists.newArrayList($f1.filter, $f2.filter));
} else if($f1.ctx != null) {
$filter = $f1.filter;
} else {
$filter = $f2.filter;
}
}
$interval = $t.interval;
}
;