This is an automated email from the ASF dual-hosted git repository.

xiangfu pushed a commit to branch nested-object-indexing-1
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit a1d2d690221686a8073dfbadd015d5eecea0a6a4
Author: kishore gopalakrishna <g.kish...@gmail.com>
AuthorDate: Fri Jan 18 16:05:45 2019 -0800

    Adding support for MATCHES Predicate
---
 .../antlr4/org/apache/pinot/pql/parsers/PQL2.g4    |   5 +
 .../apache/pinot/common/config/Deserializer.java   |   5 +-
 .../pinot/common/request/AggregationInfo.java      |  73 +++++------
 .../apache/pinot/common/request/BrokerRequest.java | 131 +++++++++----------
 .../pinot/common/request/FilterOperator.java       |  32 ++---
 .../apache/pinot/common/request/FilterQuery.java   |  87 ++++++-------
 .../pinot/common/request/FilterQueryMap.java       |  64 +++++----
 .../org/apache/pinot/common/request/GroupBy.java   | 137 +++++++++----------
 .../pinot/common/request/HavingFilterQuery.java    |  87 ++++++-------
 .../pinot/common/request/HavingFilterQueryMap.java |  62 ++++-----
 .../pinot/common/request/InstanceRequest.java      | 111 ++++++++--------
 .../apache/pinot/common/request/QuerySource.java   |  60 ++++-----
 .../org/apache/pinot/common/request/QueryType.java |  77 +++++------
 .../org/apache/pinot/common/request/Selection.java | 145 ++++++++++-----------
 .../apache/pinot/common/request/SelectionSort.java |  65 +++++----
 .../pinot/common/response/ProcessingException.java |  66 +++++-----
 .../apache/pinot/pql/parsers/Pql2AstListener.java  |  11 ++
 .../parsers/pql2/ast/MatchesPredicateAstNode.java  |  62 +++++++++
 .../org/apache/pinot/core/common/Predicate.java    |  35 ++++-
 .../core/common/predicate/MatchesPredicate.java    |  50 +++++++
 .../MatchesPredicateEvaluatorFactory.java          |  69 ++++++++++
 .../predicate/PredicateEvaluatorProvider.java      |   6 +-
 22 files changed, 787 insertions(+), 653 deletions(-)

diff --git a/pinot-common/src/main/antlr4/org/apache/pinot/pql/parsers/PQL2.g4 
b/pinot-common/src/main/antlr4/org/apache/pinot/pql/parsers/PQL2.g4
index 5086182..17652ca 100644
--- a/pinot-common/src/main/antlr4/org/apache/pinot/pql/parsers/PQL2.g4
+++ b/pinot-common/src/main/antlr4/org/apache/pinot/pql/parsers/PQL2.g4
@@ -77,6 +77,7 @@ predicate:
   | betweenClause                         # BetweenPredicate
   | isClause                              # IsPredicate
   | regexpLikeClause                      # RegexpLikePredicate
+  | matchesClause                         # MatchesPredicate  
   ;
 
 inClause:
@@ -95,6 +96,9 @@ betweenClause:
 regexpLikeClause:
   REGEXP_LIKE '(' expression ',' literal ')';
 
+matchesClause:
+  expression MATCHES '(' literal ',' literal ')';
+
 booleanOperator: OR | AND;
 
 groupByClause: GROUP BY groupByList;
@@ -131,6 +135,7 @@ LIMIT: L I M I T;
 NOT : N O T;
 OR: O R;
 REGEXP_LIKE: R E G E X P '_' L I K E;
+MATCHES: M A T C H E S;
 ORDER: O R D E R;
 SELECT: S E L E C T;
 TOP: T O P;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/config/Deserializer.java 
b/pinot-common/src/main/java/org/apache/pinot/common/config/Deserializer.java
index 93c4d84..63646c4 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/config/Deserializer.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/config/Deserializer.java
@@ -404,8 +404,9 @@ public class Deserializer {
     config = config.resolve();
 
     try {
-      return deserialize(clazz, 
io.vavr.collection.HashSet.ofAll(config.entrySet())
-          .toMap(entry -> Tuple.of(entry.getKey(), 
entry.getValue().unwrapped())), "");
+      Map<String, Object> map = 
io.vavr.collection.HashSet.ofAll(config.entrySet())
+          .toMap(entry -> Tuple.of(entry.getKey(), 
entry.getValue().unwrapped()));
+      return deserialize(clazz, map, "");
     } catch (Exception e) {
       Utils.rethrowException(e);
       return null;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/AggregationInfo.java
 
b/pinot-common/src/main/java/org/apache/pinot/common/request/AggregationInfo.java
index aa0b3db..ab129ff 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/request/AggregationInfo.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/request/AggregationInfo.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,29 +6,40 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * AUTO GENERATED: DO NOT EDIT
  *  Aggregation
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-8-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class AggregationInfo implements 
org.apache.thrift.TBase<AggregationInfo, AggregationInfo._Fields>, 
java.io.Serializable, Cloneable, Comparable<AggregationInfo> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("AggregationInfo");
 
@@ -135,13 +128,13 @@ public class AggregationInfo implements 
org.apache.thrift.TBase<AggregationInfo,
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.AGGREGATION_TYPE, new 
org.apache.thrift.meta_data.FieldMetaData("aggregationType", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.AGGREGATION_TYPE, new 
org.apache.thrift.meta_data.FieldMetaData("aggregationType", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.AGGREGATION_PARAMS, new 
org.apache.thrift.meta_data.FieldMetaData("aggregationParams", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
-        new 
org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
-            new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
+    tmpMap.put(_Fields.AGGREGATION_PARAMS, new 
org.apache.thrift.meta_data.FieldMetaData("aggregationParams", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new 
org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
+            new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
 
             new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
-    tmpMap.put(_Fields.IS_IN_SELECT_LIST, new 
org.apache.thrift.meta_data.FieldMetaData("isInSelectList", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.IS_IN_SELECT_LIST, new 
org.apache.thrift.meta_data.FieldMetaData("isInSelectList", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AggregationInfo.class,
 metaDataMap);
@@ -506,7 +499,7 @@ public class AggregationInfo implements 
org.apache.thrift.TBase<AggregationInfo,
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
@@ -514,7 +507,7 @@ public class AggregationInfo implements 
org.apache.thrift.TBase<AggregationInfo,
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.aggregationType = iprot.readString();
               struct.setAggregationTypeIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -534,7 +527,7 @@ public class AggregationInfo implements 
org.apache.thrift.TBase<AggregationInfo,
                 iprot.readMapEnd();
               }
               struct.setAggregationParamsIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -542,7 +535,7 @@ public class AggregationInfo implements 
org.apache.thrift.TBase<AggregationInfo,
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
               struct.isInSelectList = iprot.readBool();
               struct.setIsInSelectListIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/BrokerRequest.java 
b/pinot-common/src/main/java/org/apache/pinot/common/request/BrokerRequest.java
index c95c782..3ff9ad1 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/request/BrokerRequest.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/request/BrokerRequest.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,29 +6,40 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * AUTO GENERATED: DO NOT EDIT
  * Broker Query
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-8-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class BrokerRequest implements org.apache.thrift.TBase<BrokerRequest, 
BrokerRequest._Fields>, java.io.Serializable, Cloneable, 
Comparable<BrokerRequest> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("BrokerRequest");
 
@@ -200,42 +193,42 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.QUERY_TYPE, new 
org.apache.thrift.meta_data.FieldMetaData("queryType", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.QUERY_TYPE, new 
org.apache.thrift.meta_data.FieldMetaData("queryType", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 QueryType.class)));
-    tmpMap.put(_Fields.QUERY_SOURCE, new 
org.apache.thrift.meta_data.FieldMetaData("querySource", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.QUERY_SOURCE, new 
org.apache.thrift.meta_data.FieldMetaData("querySource", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 QuerySource.class)));
-    tmpMap.put(_Fields.TIME_INTERVAL, new 
org.apache.thrift.meta_data.FieldMetaData("timeInterval", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.TIME_INTERVAL, new 
org.apache.thrift.meta_data.FieldMetaData("timeInterval", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DURATION, new 
org.apache.thrift.meta_data.FieldMetaData("duration", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.DURATION, new 
org.apache.thrift.meta_data.FieldMetaData("duration", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.FILTER_QUERY, new 
org.apache.thrift.meta_data.FieldMetaData("filterQuery", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.FILTER_QUERY, new 
org.apache.thrift.meta_data.FieldMetaData("filterQuery", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 FilterQuery.class)));
-    tmpMap.put(_Fields.AGGREGATIONS_INFO, new 
org.apache.thrift.meta_data.FieldMetaData("aggregationsInfo", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
-        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+    tmpMap.put(_Fields.AGGREGATIONS_INFO, new 
org.apache.thrift.meta_data.FieldMetaData("aggregationsInfo", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 AggregationInfo.class))));
-    tmpMap.put(_Fields.GROUP_BY, new 
org.apache.thrift.meta_data.FieldMetaData("groupBy", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.GROUP_BY, new 
org.apache.thrift.meta_data.FieldMetaData("groupBy", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 GroupBy.class)));
-    tmpMap.put(_Fields.SELECTIONS, new 
org.apache.thrift.meta_data.FieldMetaData("selections", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.SELECTIONS, new 
org.apache.thrift.meta_data.FieldMetaData("selections", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 Selection.class)));
-    tmpMap.put(_Fields.FILTER_SUB_QUERY_MAP, new 
org.apache.thrift.meta_data.FieldMetaData("filterSubQueryMap", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.FILTER_SUB_QUERY_MAP, new 
org.apache.thrift.meta_data.FieldMetaData("filterSubQueryMap", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 FilterQueryMap.class)));
-    tmpMap.put(_Fields.BUCKET_HASH_KEY, new 
org.apache.thrift.meta_data.FieldMetaData("bucketHashKey", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.BUCKET_HASH_KEY, new 
org.apache.thrift.meta_data.FieldMetaData("bucketHashKey", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.ENABLE_TRACE, new 
org.apache.thrift.meta_data.FieldMetaData("enableTrace", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.ENABLE_TRACE, new 
org.apache.thrift.meta_data.FieldMetaData("enableTrace", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-    tmpMap.put(_Fields.RESPONSE_FORMAT, new 
org.apache.thrift.meta_data.FieldMetaData("responseFormat", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.RESPONSE_FORMAT, new 
org.apache.thrift.meta_data.FieldMetaData("responseFormat", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.DEBUG_OPTIONS, new 
org.apache.thrift.meta_data.FieldMetaData("debugOptions", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
-        new 
org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
-            new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
+    tmpMap.put(_Fields.DEBUG_OPTIONS, new 
org.apache.thrift.meta_data.FieldMetaData("debugOptions", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new 
org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
+            new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
 
             new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
-    tmpMap.put(_Fields.QUERY_OPTIONS, new 
org.apache.thrift.meta_data.FieldMetaData("queryOptions", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
-        new 
org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
-            new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
+    tmpMap.put(_Fields.QUERY_OPTIONS, new 
org.apache.thrift.meta_data.FieldMetaData("queryOptions", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new 
org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
+            new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
 
             new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
-    tmpMap.put(_Fields.HAVING_FILTER_QUERY, new 
org.apache.thrift.meta_data.FieldMetaData("havingFilterQuery", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.HAVING_FILTER_QUERY, new 
org.apache.thrift.meta_data.FieldMetaData("havingFilterQuery", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 HavingFilterQuery.class)));
-    tmpMap.put(_Fields.HAVING_FILTER_SUB_QUERY_MAP, new 
org.apache.thrift.meta_data.FieldMetaData("havingFilterSubQueryMap", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.HAVING_FILTER_SUB_QUERY_MAP, new 
org.apache.thrift.meta_data.FieldMetaData("havingFilterSubQueryMap", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 HavingFilterQueryMap.class)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BrokerRequest.class,
 metaDataMap);
@@ -1617,7 +1610,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
@@ -1626,7 +1619,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
               struct.queryType = new QueryType();
               struct.queryType.read(iprot);
               struct.setQueryTypeIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1635,7 +1628,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
               struct.querySource = new QuerySource();
               struct.querySource.read(iprot);
               struct.setQuerySourceIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1643,7 +1636,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.timeInterval = iprot.readString();
               struct.setTimeIntervalIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1651,7 +1644,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.duration = iprot.readString();
               struct.setDurationIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1660,7 +1653,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
               struct.filterQuery = new FilterQuery();
               struct.filterQuery.read(iprot);
               struct.setFilterQueryIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1679,7 +1672,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
                 iprot.readListEnd();
               }
               struct.setAggregationsInfoIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1688,7 +1681,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
               struct.groupBy = new GroupBy();
               struct.groupBy.read(iprot);
               struct.setGroupByIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1697,7 +1690,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
               struct.selections = new Selection();
               struct.selections.read(iprot);
               struct.setSelectionsIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1706,7 +1699,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
               struct.filterSubQueryMap = new FilterQueryMap();
               struct.filterSubQueryMap.read(iprot);
               struct.setFilterSubQueryMapIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1714,7 +1707,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.bucketHashKey = iprot.readString();
               struct.setBucketHashKeyIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1722,7 +1715,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
               struct.enableTrace = iprot.readBool();
               struct.setEnableTraceIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1730,7 +1723,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.responseFormat = iprot.readString();
               struct.setResponseFormatIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1750,7 +1743,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
                 iprot.readMapEnd();
               }
               struct.setDebugOptionsIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1770,7 +1763,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
                 iprot.readMapEnd();
               }
               struct.setQueryOptionsIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1779,7 +1772,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
               struct.havingFilterQuery = new HavingFilterQuery();
               struct.havingFilterQuery.read(iprot);
               struct.setHavingFilterQueryIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -1788,7 +1781,7 @@ public class BrokerRequest implements 
org.apache.thrift.TBase<BrokerRequest, Bro
               struct.havingFilterSubQueryMap = new HavingFilterQueryMap();
               struct.havingFilterSubQueryMap.read(iprot);
               struct.setHavingFilterSubQueryMapIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/FilterOperator.java
 
b/pinot-common/src/main/java/org/apache/pinot/common/request/FilterOperator.java
index 797aad5..a2f4351 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/request/FilterOperator.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/request/FilterOperator.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,10 +6,15 @@
  */
 package org.apache.pinot.common.request;
 
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
 /**
  * AUTO GENERATED: DO NOT EDIT
  * Filter Operator
- *
+ * 
  */
 public enum FilterOperator implements org.apache.thrift.TEnum {
   AND(0),
@@ -37,7 +24,8 @@ public enum FilterOperator implements org.apache.thrift.TEnum 
{
   RANGE(4),
   REGEXP_LIKE(5),
   NOT_IN(6),
-  IN(7);
+  IN(7),
+  TEXT_MATCH(8);
 
   private final int value;
 
@@ -56,7 +44,7 @@ public enum FilterOperator implements org.apache.thrift.TEnum 
{
    * Find a the enum type by its integer value, as defined in the Thrift IDL.
    * @return null if the value is not found.
    */
-  public static FilterOperator findByValue(int value) {
+  public static FilterOperator findByValue(int value) { 
     switch (value) {
       case 0:
         return AND;
@@ -74,6 +62,8 @@ public enum FilterOperator implements org.apache.thrift.TEnum 
{
         return NOT_IN;
       case 7:
         return IN;
+      case 8:
+        return TEXT_MATCH;
       default:
         return null;
     }
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/FilterQuery.java 
b/pinot-common/src/main/java/org/apache/pinot/common/request/FilterQuery.java
index 54a8141..3e6b8fe 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/request/FilterQuery.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/request/FilterQuery.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,29 +6,40 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * AUTO GENERATED: DO NOT EDIT
  * Filter query
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-5-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class FilterQuery implements org.apache.thrift.TBase<FilterQuery, 
FilterQuery._Fields>, java.io.Serializable, Cloneable, Comparable<FilterQuery> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("FilterQuery");
 
@@ -77,7 +70,7 @@ public class FilterQuery implements 
org.apache.thrift.TBase<FilterQuery, FilterQ
     COLUMN((short)2, "column"),
     VALUE((short)3, "value"),
     /**
-     *
+     * 
      * @see FilterOperator
      */
     OPERATOR((short)4, "operator"),
@@ -152,17 +145,17 @@ public class FilterQuery implements 
org.apache.thrift.TBase<FilterQuery, FilterQ
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", 
org.apache.thrift.TFieldRequirementType.REQUIRED,
+    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", 
org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
-    tmpMap.put(_Fields.COLUMN, new 
org.apache.thrift.meta_data.FieldMetaData("column", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.COLUMN, new 
org.apache.thrift.meta_data.FieldMetaData("column", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.VALUE, new 
org.apache.thrift.meta_data.FieldMetaData("value", 
org.apache.thrift.TFieldRequirementType.DEFAULT,
-        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+    tmpMap.put(_Fields.VALUE, new 
org.apache.thrift.meta_data.FieldMetaData("value", 
org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
-    tmpMap.put(_Fields.OPERATOR, new 
org.apache.thrift.meta_data.FieldMetaData("operator", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.OPERATOR, new 
org.apache.thrift.meta_data.FieldMetaData("operator", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, 
FilterOperator.class)));
-    tmpMap.put(_Fields.NESTED_FILTER_QUERY_IDS, new 
org.apache.thrift.meta_data.FieldMetaData("nestedFilterQueryIds", 
org.apache.thrift.TFieldRequirementType.DEFAULT,
-        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+    tmpMap.put(_Fields.NESTED_FILTER_QUERY_IDS, new 
org.apache.thrift.meta_data.FieldMetaData("nestedFilterQueryIds", 
org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FilterQuery.class,
 metaDataMap);
@@ -309,7 +302,7 @@ public class FilterQuery implements 
org.apache.thrift.TBase<FilterQuery, FilterQ
   }
 
   /**
-   *
+   * 
    * @see FilterOperator
    */
   public FilterOperator getOperator() {
@@ -317,7 +310,7 @@ public class FilterQuery implements 
org.apache.thrift.TBase<FilterQuery, FilterQ
   }
 
   /**
-   *
+   * 
    * @see FilterOperator
    */
   public void setOperator(FilterOperator operator) {
@@ -719,7 +712,7 @@ public class FilterQuery implements 
org.apache.thrift.TBase<FilterQuery, FilterQ
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
@@ -727,7 +720,7 @@ public class FilterQuery implements 
org.apache.thrift.TBase<FilterQuery, FilterQ
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
               struct.id = iprot.readI32();
               struct.setIdIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -735,7 +728,7 @@ public class FilterQuery implements 
org.apache.thrift.TBase<FilterQuery, FilterQ
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.column = iprot.readString();
               struct.setColumnIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -753,7 +746,7 @@ public class FilterQuery implements 
org.apache.thrift.TBase<FilterQuery, FilterQ
                 iprot.readListEnd();
               }
               struct.setValueIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -761,7 +754,7 @@ public class FilterQuery implements 
org.apache.thrift.TBase<FilterQuery, FilterQ
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
               struct.operator = 
org.apache.pinot.common.request.FilterOperator.findByValue(iprot.readI32());
               struct.setOperatorIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -779,7 +772,7 @@ public class FilterQuery implements 
org.apache.thrift.TBase<FilterQuery, FilterQ
                 iprot.readListEnd();
               }
               struct.setNestedFilterQueryIdsIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/FilterQueryMap.java
 
b/pinot-common/src/main/java/org/apache/pinot/common/request/FilterQueryMap.java
index 8754c80..2a15e98 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/request/FilterQueryMap.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/request/FilterQueryMap.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,28 +6,40 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * AUTO GENERATED: DO NOT EDIT
  * Filter Query is nested but thrift stable version does not support yet (The 
support is there in top of the trunk but no released jars. Two concerns : 
stability and onus of maintaining a stable point. Also, its pretty difficult to 
compile thrift in Linkedin software development environment which is not geared 
towards c++ dev. Hence, the )
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-5-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class FilterQueryMap implements org.apache.thrift.TBase<FilterQueryMap, 
FilterQueryMap._Fields>, java.io.Serializable, Cloneable, 
Comparable<FilterQueryMap> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("FilterQueryMap");
 
@@ -122,9 +116,9 @@ public class FilterQueryMap implements 
org.apache.thrift.TBase<FilterQueryMap, F
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.FILTER_QUERY_MAP, new 
org.apache.thrift.meta_data.FieldMetaData("filterQueryMap", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
-        new 
org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
-            new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32),
+    tmpMap.put(_Fields.FILTER_QUERY_MAP, new 
org.apache.thrift.meta_data.FieldMetaData("filterQueryMap", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new 
org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
+            new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32),
 
             new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 FilterQuery.class))));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FilterQueryMap.class,
 metaDataMap);
@@ -355,7 +349,7 @@ public class FilterQueryMap implements 
org.apache.thrift.TBase<FilterQueryMap, F
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
@@ -376,7 +370,7 @@ public class FilterQueryMap implements 
org.apache.thrift.TBase<FilterQueryMap, F
                 iprot.readMapEnd();
               }
               struct.setFilterQueryMapIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/GroupBy.java 
b/pinot-common/src/main/java/org/apache/pinot/common/request/GroupBy.java
index 134eb6b..6381642 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/request/GroupBy.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/request/GroupBy.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,29 +6,40 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * AUTO GENERATED: DO NOT EDIT
  * GroupBy
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-5-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class GroupBy implements org.apache.thrift.TBase<GroupBy, 
GroupBy._Fields>, java.io.Serializable, Cloneable, Comparable<GroupBy> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("GroupBy");
 
@@ -135,13 +128,13 @@ public class GroupBy implements 
org.apache.thrift.TBase<GroupBy, GroupBy._Fields
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.COLUMNS, new 
org.apache.thrift.meta_data.FieldMetaData("columns", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
-        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+    tmpMap.put(_Fields.COLUMNS, new 
org.apache.thrift.meta_data.FieldMetaData("columns", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
-    tmpMap.put(_Fields.TOP_N, new 
org.apache.thrift.meta_data.FieldMetaData("topN", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.TOP_N, new 
org.apache.thrift.meta_data.FieldMetaData("topN", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.EXPRESSIONS, new 
org.apache.thrift.meta_data.FieldMetaData("expressions", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
-        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+    tmpMap.put(_Fields.EXPRESSIONS, new 
org.apache.thrift.meta_data.FieldMetaData("expressions", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GroupBy.class, 
metaDataMap);
@@ -526,25 +519,25 @@ public class GroupBy implements 
org.apache.thrift.TBase<GroupBy, GroupBy._Fields
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
           case 1: // COLUMNS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list36 = 
iprot.readListBegin();
-                struct.columns = new ArrayList<String>(_list36.size);
-                String _elem37;
-                for (int _i38 = 0; _i38 < _list36.size; ++_i38)
+                org.apache.thrift.protocol.TList _list62 = 
iprot.readListBegin();
+                struct.columns = new ArrayList<String>(_list62.size);
+                String _elem63;
+                for (int _i64 = 0; _i64 < _list62.size; ++_i64)
                 {
-                  _elem37 = iprot.readString();
-                  struct.columns.add(_elem37);
+                  _elem63 = iprot.readString();
+                  struct.columns.add(_elem63);
                 }
                 iprot.readListEnd();
               }
               struct.setColumnsIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -552,25 +545,25 @@ public class GroupBy implements 
org.apache.thrift.TBase<GroupBy, GroupBy._Fields
             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
               struct.topN = iprot.readI64();
               struct.setTopNIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
           case 3: // EXPRESSIONS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list39 = 
iprot.readListBegin();
-                struct.expressions = new ArrayList<String>(_list39.size);
-                String _elem40;
-                for (int _i41 = 0; _i41 < _list39.size; ++_i41)
+                org.apache.thrift.protocol.TList _list65 = 
iprot.readListBegin();
+                struct.expressions = new ArrayList<String>(_list65.size);
+                String _elem66;
+                for (int _i67 = 0; _i67 < _list65.size; ++_i67)
                 {
-                  _elem40 = iprot.readString();
-                  struct.expressions.add(_elem40);
+                  _elem66 = iprot.readString();
+                  struct.expressions.add(_elem66);
                 }
                 iprot.readListEnd();
               }
               struct.setExpressionsIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -592,9 +585,9 @@ public class GroupBy implements 
org.apache.thrift.TBase<GroupBy, GroupBy._Fields
           oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
           {
             oprot.writeListBegin(new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
struct.columns.size()));
-            for (String _iter42 : struct.columns)
+            for (String _iter68 : struct.columns)
             {
-              oprot.writeString(_iter42);
+              oprot.writeString(_iter68);
             }
             oprot.writeListEnd();
           }
@@ -611,9 +604,9 @@ public class GroupBy implements 
org.apache.thrift.TBase<GroupBy, GroupBy._Fields
           oprot.writeFieldBegin(EXPRESSIONS_FIELD_DESC);
           {
             oprot.writeListBegin(new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
struct.expressions.size()));
-            for (String _iter43 : struct.expressions)
+            for (String _iter69 : struct.expressions)
             {
-              oprot.writeString(_iter43);
+              oprot.writeString(_iter69);
             }
             oprot.writeListEnd();
           }
@@ -651,9 +644,9 @@ public class GroupBy implements 
org.apache.thrift.TBase<GroupBy, GroupBy._Fields
       if (struct.isSetColumns()) {
         {
           oprot.writeI32(struct.columns.size());
-          for (String _iter44 : struct.columns)
+          for (String _iter70 : struct.columns)
           {
-            oprot.writeString(_iter44);
+            oprot.writeString(_iter70);
           }
         }
       }
@@ -663,9 +656,9 @@ public class GroupBy implements 
org.apache.thrift.TBase<GroupBy, GroupBy._Fields
       if (struct.isSetExpressions()) {
         {
           oprot.writeI32(struct.expressions.size());
-          for (String _iter45 : struct.expressions)
+          for (String _iter71 : struct.expressions)
           {
-            oprot.writeString(_iter45);
+            oprot.writeString(_iter71);
           }
         }
       }
@@ -677,13 +670,13 @@ public class GroupBy implements 
org.apache.thrift.TBase<GroupBy, GroupBy._Fields
       BitSet incoming = iprot.readBitSet(3);
       if (incoming.get(0)) {
         {
-          org.apache.thrift.protocol.TList _list46 = new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
iprot.readI32());
-          struct.columns = new ArrayList<String>(_list46.size);
-          String _elem47;
-          for (int _i48 = 0; _i48 < _list46.size; ++_i48)
+          org.apache.thrift.protocol.TList _list72 = new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
iprot.readI32());
+          struct.columns = new ArrayList<String>(_list72.size);
+          String _elem73;
+          for (int _i74 = 0; _i74 < _list72.size; ++_i74)
           {
-            _elem47 = iprot.readString();
-            struct.columns.add(_elem47);
+            _elem73 = iprot.readString();
+            struct.columns.add(_elem73);
           }
         }
         struct.setColumnsIsSet(true);
@@ -694,13 +687,13 @@ public class GroupBy implements 
org.apache.thrift.TBase<GroupBy, GroupBy._Fields
       }
       if (incoming.get(2)) {
         {
-          org.apache.thrift.protocol.TList _list49 = new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
iprot.readI32());
-          struct.expressions = new ArrayList<String>(_list49.size);
-          String _elem50;
-          for (int _i51 = 0; _i51 < _list49.size; ++_i51)
+          org.apache.thrift.protocol.TList _list75 = new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
iprot.readI32());
+          struct.expressions = new ArrayList<String>(_list75.size);
+          String _elem76;
+          for (int _i77 = 0; _i77 < _list75.size; ++_i77)
           {
-            _elem50 = iprot.readString();
-            struct.expressions.add(_elem50);
+            _elem76 = iprot.readString();
+            struct.expressions.add(_elem76);
           }
         }
         struct.setExpressionsIsSet(true);
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/HavingFilterQuery.java
 
b/pinot-common/src/main/java/org/apache/pinot/common/request/HavingFilterQuery.java
index 3ab0de9..d50e055 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/request/HavingFilterQuery.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/request/HavingFilterQuery.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,29 +6,40 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * AUTO GENERATED: DO NOT EDIT
  * Having Filter query
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-8-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class HavingFilterQuery implements 
org.apache.thrift.TBase<HavingFilterQuery, HavingFilterQuery._Fields>, 
java.io.Serializable, Cloneable, Comparable<HavingFilterQuery> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("HavingFilterQuery");
 
@@ -77,7 +70,7 @@ public class HavingFilterQuery implements 
org.apache.thrift.TBase<HavingFilterQu
     AGGREGATION_INFO((short)2, "aggregationInfo"),
     VALUE((short)3, "value"),
     /**
-     *
+     * 
      * @see FilterOperator
      */
     OPERATOR((short)4, "operator"),
@@ -152,17 +145,17 @@ public class HavingFilterQuery implements 
org.apache.thrift.TBase<HavingFilterQu
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", 
org.apache.thrift.TFieldRequirementType.REQUIRED,
+    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", 
org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
-    tmpMap.put(_Fields.AGGREGATION_INFO, new 
org.apache.thrift.meta_data.FieldMetaData("aggregationInfo", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.AGGREGATION_INFO, new 
org.apache.thrift.meta_data.FieldMetaData("aggregationInfo", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT
        , "AggregationInfo")));
-    tmpMap.put(_Fields.VALUE, new 
org.apache.thrift.meta_data.FieldMetaData("value", 
org.apache.thrift.TFieldRequirementType.DEFAULT,
-        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+    tmpMap.put(_Fields.VALUE, new 
org.apache.thrift.meta_data.FieldMetaData("value", 
org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
-    tmpMap.put(_Fields.OPERATOR, new 
org.apache.thrift.meta_data.FieldMetaData("operator", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.OPERATOR, new 
org.apache.thrift.meta_data.FieldMetaData("operator", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, 
FilterOperator.class)));
-    tmpMap.put(_Fields.NESTED_FILTER_QUERY_IDS, new 
org.apache.thrift.meta_data.FieldMetaData("nestedFilterQueryIds", 
org.apache.thrift.TFieldRequirementType.DEFAULT,
-        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+    tmpMap.put(_Fields.NESTED_FILTER_QUERY_IDS, new 
org.apache.thrift.meta_data.FieldMetaData("nestedFilterQueryIds", 
org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HavingFilterQuery.class,
 metaDataMap);
@@ -309,7 +302,7 @@ public class HavingFilterQuery implements 
org.apache.thrift.TBase<HavingFilterQu
   }
 
   /**
-   *
+   * 
    * @see FilterOperator
    */
   public FilterOperator getOperator() {
@@ -317,7 +310,7 @@ public class HavingFilterQuery implements 
org.apache.thrift.TBase<HavingFilterQu
   }
 
   /**
-   *
+   * 
    * @see FilterOperator
    */
   public void setOperator(FilterOperator operator) {
@@ -719,7 +712,7 @@ public class HavingFilterQuery implements 
org.apache.thrift.TBase<HavingFilterQu
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
@@ -727,7 +720,7 @@ public class HavingFilterQuery implements 
org.apache.thrift.TBase<HavingFilterQu
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
               struct.id = iprot.readI32();
               struct.setIdIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -736,7 +729,7 @@ public class HavingFilterQuery implements 
org.apache.thrift.TBase<HavingFilterQu
               struct.aggregationInfo = new AggregationInfo();
               struct.aggregationInfo.read(iprot);
               struct.setAggregationInfoIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -754,7 +747,7 @@ public class HavingFilterQuery implements 
org.apache.thrift.TBase<HavingFilterQu
                 iprot.readListEnd();
               }
               struct.setValueIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -762,7 +755,7 @@ public class HavingFilterQuery implements 
org.apache.thrift.TBase<HavingFilterQu
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
               struct.operator = 
org.apache.pinot.common.request.FilterOperator.findByValue(iprot.readI32());
               struct.setOperatorIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -780,7 +773,7 @@ public class HavingFilterQuery implements 
org.apache.thrift.TBase<HavingFilterQu
                 iprot.readListEnd();
               }
               struct.setNestedFilterQueryIdsIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/HavingFilterQueryMap.java
 
b/pinot-common/src/main/java/org/apache/pinot/common/request/HavingFilterQueryMap.java
index bcc0c59..0d3620a 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/request/HavingFilterQueryMap.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/request/HavingFilterQueryMap.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,23 +6,35 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-8-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class HavingFilterQueryMap implements 
org.apache.thrift.TBase<HavingFilterQueryMap, HavingFilterQueryMap._Fields>, 
java.io.Serializable, Cloneable, Comparable<HavingFilterQueryMap> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("HavingFilterQueryMap");
 
@@ -117,9 +111,9 @@ public class HavingFilterQueryMap implements 
org.apache.thrift.TBase<HavingFilte
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.FILTER_QUERY_MAP, new 
org.apache.thrift.meta_data.FieldMetaData("filterQueryMap", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
-        new 
org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
-            new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32),
+    tmpMap.put(_Fields.FILTER_QUERY_MAP, new 
org.apache.thrift.meta_data.FieldMetaData("filterQueryMap", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new 
org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
+            new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32),
 
             new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 HavingFilterQuery.class))));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HavingFilterQueryMap.class,
 metaDataMap);
@@ -350,7 +344,7 @@ public class HavingFilterQueryMap implements 
org.apache.thrift.TBase<HavingFilte
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
@@ -371,7 +365,7 @@ public class HavingFilterQueryMap implements 
org.apache.thrift.TBase<HavingFilte
                 iprot.readMapEnd();
               }
               struct.setFilterQueryMapIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/InstanceRequest.java
 
b/pinot-common/src/main/java/org/apache/pinot/common/request/InstanceRequest.java
index b0fd5fa..1bd3d19 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/request/InstanceRequest.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/request/InstanceRequest.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,29 +6,40 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * AUTO GENERATED: DO NOT EDIT
  * Instance Request
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-5-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class InstanceRequest implements 
org.apache.thrift.TBase<InstanceRequest, InstanceRequest._Fields>, 
java.io.Serializable, Cloneable, Comparable<InstanceRequest> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("InstanceRequest");
 
@@ -146,16 +139,16 @@ public class InstanceRequest implements 
org.apache.thrift.TBase<InstanceRequest,
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.REQUEST_ID, new 
org.apache.thrift.meta_data.FieldMetaData("requestId", 
org.apache.thrift.TFieldRequirementType.REQUIRED,
+    tmpMap.put(_Fields.REQUEST_ID, new 
org.apache.thrift.meta_data.FieldMetaData("requestId", 
org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.QUERY, new 
org.apache.thrift.meta_data.FieldMetaData("query", 
org.apache.thrift.TFieldRequirementType.REQUIRED,
+    tmpMap.put(_Fields.QUERY, new 
org.apache.thrift.meta_data.FieldMetaData("query", 
org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 BrokerRequest.class)));
-    tmpMap.put(_Fields.SEARCH_SEGMENTS, new 
org.apache.thrift.meta_data.FieldMetaData("searchSegments", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
-        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+    tmpMap.put(_Fields.SEARCH_SEGMENTS, new 
org.apache.thrift.meta_data.FieldMetaData("searchSegments", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
-    tmpMap.put(_Fields.ENABLE_TRACE, new 
org.apache.thrift.meta_data.FieldMetaData("enableTrace", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.ENABLE_TRACE, new 
org.apache.thrift.meta_data.FieldMetaData("enableTrace", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-    tmpMap.put(_Fields.BROKER_ID, new 
org.apache.thrift.meta_data.FieldMetaData("brokerId", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.BROKER_ID, new 
org.apache.thrift.meta_data.FieldMetaData("brokerId", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(InstanceRequest.class,
 metaDataMap);
@@ -683,7 +676,7 @@ public class InstanceRequest implements 
org.apache.thrift.TBase<InstanceRequest,
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
@@ -691,7 +684,7 @@ public class InstanceRequest implements 
org.apache.thrift.TBase<InstanceRequest,
             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
               struct.requestId = iprot.readI64();
               struct.setRequestIdIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -700,25 +693,25 @@ public class InstanceRequest implements 
org.apache.thrift.TBase<InstanceRequest,
               struct.query = new BrokerRequest();
               struct.query.read(iprot);
               struct.setQueryIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
           case 3: // SEARCH_SEGMENTS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list96 = 
iprot.readListBegin();
-                struct.searchSegments = new ArrayList<String>(_list96.size);
-                String _elem97;
-                for (int _i98 = 0; _i98 < _list96.size; ++_i98)
+                org.apache.thrift.protocol.TList _list122 = 
iprot.readListBegin();
+                struct.searchSegments = new ArrayList<String>(_list122.size);
+                String _elem123;
+                for (int _i124 = 0; _i124 < _list122.size; ++_i124)
                 {
-                  _elem97 = iprot.readString();
-                  struct.searchSegments.add(_elem97);
+                  _elem123 = iprot.readString();
+                  struct.searchSegments.add(_elem123);
                 }
                 iprot.readListEnd();
               }
               struct.setSearchSegmentsIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -726,7 +719,7 @@ public class InstanceRequest implements 
org.apache.thrift.TBase<InstanceRequest,
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
               struct.enableTrace = iprot.readBool();
               struct.setEnableTraceIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -734,7 +727,7 @@ public class InstanceRequest implements 
org.apache.thrift.TBase<InstanceRequest,
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.brokerId = iprot.readString();
               struct.setBrokerIdIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -764,9 +757,9 @@ public class InstanceRequest implements 
org.apache.thrift.TBase<InstanceRequest,
           oprot.writeFieldBegin(SEARCH_SEGMENTS_FIELD_DESC);
           {
             oprot.writeListBegin(new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
struct.searchSegments.size()));
-            for (String _iter99 : struct.searchSegments)
+            for (String _iter125 : struct.searchSegments)
             {
-              oprot.writeString(_iter99);
+              oprot.writeString(_iter125);
             }
             oprot.writeListEnd();
           }
@@ -818,9 +811,9 @@ public class InstanceRequest implements 
org.apache.thrift.TBase<InstanceRequest,
       if (struct.isSetSearchSegments()) {
         {
           oprot.writeI32(struct.searchSegments.size());
-          for (String _iter100 : struct.searchSegments)
+          for (String _iter126 : struct.searchSegments)
           {
-            oprot.writeString(_iter100);
+            oprot.writeString(_iter126);
           }
         }
       }
@@ -843,13 +836,13 @@ public class InstanceRequest implements 
org.apache.thrift.TBase<InstanceRequest,
       BitSet incoming = iprot.readBitSet(3);
       if (incoming.get(0)) {
         {
-          org.apache.thrift.protocol.TList _list101 = new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
iprot.readI32());
-          struct.searchSegments = new ArrayList<String>(_list101.size);
-          String _elem102;
-          for (int _i103 = 0; _i103 < _list101.size; ++_i103)
+          org.apache.thrift.protocol.TList _list127 = new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
iprot.readI32());
+          struct.searchSegments = new ArrayList<String>(_list127.size);
+          String _elem128;
+          for (int _i129 = 0; _i129 < _list127.size; ++_i129)
           {
-            _elem102 = iprot.readString();
-            struct.searchSegments.add(_elem102);
+            _elem128 = iprot.readString();
+            struct.searchSegments.add(_elem128);
           }
         }
         struct.setSearchSegmentsIsSet(true);
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/QuerySource.java 
b/pinot-common/src/main/java/org/apache/pinot/common/request/QuerySource.java
index b4d4e3b..9c63591 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/request/QuerySource.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/request/QuerySource.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,28 +6,40 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * AUTO GENERATED: DO NOT EDIT
  * Query source
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-5-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class QuerySource implements org.apache.thrift.TBase<QuerySource, 
QuerySource._Fields>, java.io.Serializable, Cloneable, Comparable<QuerySource> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("QuerySource");
 
@@ -122,7 +116,7 @@ public class QuerySource implements 
org.apache.thrift.TBase<QuerySource, QuerySo
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.TABLE_NAME, new 
org.apache.thrift.meta_data.FieldMetaData("tableName", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.TABLE_NAME, new 
org.apache.thrift.meta_data.FieldMetaData("tableName", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(QuerySource.class,
 metaDataMap);
@@ -330,7 +324,7 @@ public class QuerySource implements 
org.apache.thrift.TBase<QuerySource, QuerySo
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
@@ -338,7 +332,7 @@ public class QuerySource implements 
org.apache.thrift.TBase<QuerySource, QuerySo
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.tableName = iprot.readString();
               struct.setTableNameIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/QueryType.java 
b/pinot-common/src/main/java/org/apache/pinot/common/request/QueryType.java
index d0b1208..a49112d 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/request/QueryType.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/request/QueryType.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,29 +6,40 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * AUTO GENERATED: DO NOT EDIT
  *  Query type
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-8-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class QueryType implements org.apache.thrift.TBase<QueryType, 
QueryType._Fields>, java.io.Serializable, Cloneable, Comparable<QueryType> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("QueryType");
 
@@ -149,15 +142,15 @@ public class QueryType implements 
org.apache.thrift.TBase<QueryType, QueryType._
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.HAS_SELECTION, new 
org.apache.thrift.meta_data.FieldMetaData("hasSelection", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.HAS_SELECTION, new 
org.apache.thrift.meta_data.FieldMetaData("hasSelection", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-    tmpMap.put(_Fields.HAS_FILTER, new 
org.apache.thrift.meta_data.FieldMetaData("hasFilter", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.HAS_FILTER, new 
org.apache.thrift.meta_data.FieldMetaData("hasFilter", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-    tmpMap.put(_Fields.HAS_AGGREGATION, new 
org.apache.thrift.meta_data.FieldMetaData("hasAggregation", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.HAS_AGGREGATION, new 
org.apache.thrift.meta_data.FieldMetaData("hasAggregation", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-    tmpMap.put(_Fields.HAS_GROUP_BY, new 
org.apache.thrift.meta_data.FieldMetaData("hasGroup_by", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.HAS_GROUP_BY, new 
org.apache.thrift.meta_data.FieldMetaData("hasGroup_by", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-    tmpMap.put(_Fields.HAS_HAVING, new 
org.apache.thrift.meta_data.FieldMetaData("hasHaving", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.HAS_HAVING, new 
org.apache.thrift.meta_data.FieldMetaData("hasHaving", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(QueryType.class, 
metaDataMap);
@@ -634,7 +627,7 @@ public class QueryType implements 
org.apache.thrift.TBase<QueryType, QueryType._
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
@@ -642,7 +635,7 @@ public class QueryType implements 
org.apache.thrift.TBase<QueryType, QueryType._
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
               struct.hasSelection = iprot.readBool();
               struct.setHasSelectionIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -650,7 +643,7 @@ public class QueryType implements 
org.apache.thrift.TBase<QueryType, QueryType._
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
               struct.hasFilter = iprot.readBool();
               struct.setHasFilterIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -658,7 +651,7 @@ public class QueryType implements 
org.apache.thrift.TBase<QueryType, QueryType._
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
               struct.hasAggregation = iprot.readBool();
               struct.setHasAggregationIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -666,7 +659,7 @@ public class QueryType implements 
org.apache.thrift.TBase<QueryType, QueryType._
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
               struct.hasGroup_by = iprot.readBool();
               struct.setHasGroup_byIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -674,7 +667,7 @@ public class QueryType implements 
org.apache.thrift.TBase<QueryType, QueryType._
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
               struct.hasHaving = iprot.readBool();
               struct.setHasHavingIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/Selection.java 
b/pinot-common/src/main/java/org/apache/pinot/common/request/Selection.java
index 92a2b2c..b037a0b 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/request/Selection.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/request/Selection.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,29 +6,40 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * AUTO GENERATED: DO NOT EDIT
  * Selection
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-5-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class Selection implements org.apache.thrift.TBase<Selection, 
Selection._Fields>, java.io.Serializable, Cloneable, Comparable<Selection> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("Selection");
 
@@ -141,15 +134,15 @@ public class Selection implements 
org.apache.thrift.TBase<Selection, Selection._
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.SELECTION_COLUMNS, new 
org.apache.thrift.meta_data.FieldMetaData("selectionColumns", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
-        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+    tmpMap.put(_Fields.SELECTION_COLUMNS, new 
org.apache.thrift.meta_data.FieldMetaData("selectionColumns", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
-    tmpMap.put(_Fields.SELECTION_SORT_SEQUENCE, new 
org.apache.thrift.meta_data.FieldMetaData("selectionSortSequence", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
-        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+    tmpMap.put(_Fields.SELECTION_SORT_SEQUENCE, new 
org.apache.thrift.meta_data.FieldMetaData("selectionSortSequence", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new 
org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new 
org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
 SelectionSort.class))));
-    tmpMap.put(_Fields.OFFSET, new 
org.apache.thrift.meta_data.FieldMetaData("offset", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.OFFSET, new 
org.apache.thrift.meta_data.FieldMetaData("offset", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
-    tmpMap.put(_Fields.SIZE, new 
org.apache.thrift.meta_data.FieldMetaData("size", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.SIZE, new 
org.apache.thrift.meta_data.FieldMetaData("size", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Selection.class, 
metaDataMap);
@@ -609,44 +602,44 @@ public class Selection implements 
org.apache.thrift.TBase<Selection, Selection._
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
           case 1: // SELECTION_COLUMNS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list52 = 
iprot.readListBegin();
-                struct.selectionColumns = new ArrayList<String>(_list52.size);
-                String _elem53;
-                for (int _i54 = 0; _i54 < _list52.size; ++_i54)
+                org.apache.thrift.protocol.TList _list78 = 
iprot.readListBegin();
+                struct.selectionColumns = new ArrayList<String>(_list78.size);
+                String _elem79;
+                for (int _i80 = 0; _i80 < _list78.size; ++_i80)
                 {
-                  _elem53 = iprot.readString();
-                  struct.selectionColumns.add(_elem53);
+                  _elem79 = iprot.readString();
+                  struct.selectionColumns.add(_elem79);
                 }
                 iprot.readListEnd();
               }
               struct.setSelectionColumnsIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
           case 2: // SELECTION_SORT_SEQUENCE
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list55 = 
iprot.readListBegin();
-                struct.selectionSortSequence = new 
ArrayList<SelectionSort>(_list55.size);
-                SelectionSort _elem56;
-                for (int _i57 = 0; _i57 < _list55.size; ++_i57)
+                org.apache.thrift.protocol.TList _list81 = 
iprot.readListBegin();
+                struct.selectionSortSequence = new 
ArrayList<SelectionSort>(_list81.size);
+                SelectionSort _elem82;
+                for (int _i83 = 0; _i83 < _list81.size; ++_i83)
                 {
-                  _elem56 = new SelectionSort();
-                  _elem56.read(iprot);
-                  struct.selectionSortSequence.add(_elem56);
+                  _elem82 = new SelectionSort();
+                  _elem82.read(iprot);
+                  struct.selectionSortSequence.add(_elem82);
                 }
                 iprot.readListEnd();
               }
               struct.setSelectionSortSequenceIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -654,7 +647,7 @@ public class Selection implements 
org.apache.thrift.TBase<Selection, Selection._
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
               struct.offset = iprot.readI32();
               struct.setOffsetIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -662,7 +655,7 @@ public class Selection implements 
org.apache.thrift.TBase<Selection, Selection._
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
               struct.size = iprot.readI32();
               struct.setSizeIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -684,9 +677,9 @@ public class Selection implements 
org.apache.thrift.TBase<Selection, Selection._
           oprot.writeFieldBegin(SELECTION_COLUMNS_FIELD_DESC);
           {
             oprot.writeListBegin(new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
struct.selectionColumns.size()));
-            for (String _iter58 : struct.selectionColumns)
+            for (String _iter84 : struct.selectionColumns)
             {
-              oprot.writeString(_iter58);
+              oprot.writeString(_iter84);
             }
             oprot.writeListEnd();
           }
@@ -698,9 +691,9 @@ public class Selection implements 
org.apache.thrift.TBase<Selection, Selection._
           oprot.writeFieldBegin(SELECTION_SORT_SEQUENCE_FIELD_DESC);
           {
             oprot.writeListBegin(new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, 
struct.selectionSortSequence.size()));
-            for (SelectionSort _iter59 : struct.selectionSortSequence)
+            for (SelectionSort _iter85 : struct.selectionSortSequence)
             {
-              _iter59.write(oprot);
+              _iter85.write(oprot);
             }
             oprot.writeListEnd();
           }
@@ -751,18 +744,18 @@ public class Selection implements 
org.apache.thrift.TBase<Selection, Selection._
       if (struct.isSetSelectionColumns()) {
         {
           oprot.writeI32(struct.selectionColumns.size());
-          for (String _iter60 : struct.selectionColumns)
+          for (String _iter86 : struct.selectionColumns)
           {
-            oprot.writeString(_iter60);
+            oprot.writeString(_iter86);
           }
         }
       }
       if (struct.isSetSelectionSortSequence()) {
         {
           oprot.writeI32(struct.selectionSortSequence.size());
-          for (SelectionSort _iter61 : struct.selectionSortSequence)
+          for (SelectionSort _iter87 : struct.selectionSortSequence)
           {
-            _iter61.write(oprot);
+            _iter87.write(oprot);
           }
         }
       }
@@ -780,27 +773,27 @@ public class Selection implements 
org.apache.thrift.TBase<Selection, Selection._
       BitSet incoming = iprot.readBitSet(4);
       if (incoming.get(0)) {
         {
-          org.apache.thrift.protocol.TList _list62 = new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
iprot.readI32());
-          struct.selectionColumns = new ArrayList<String>(_list62.size);
-          String _elem63;
-          for (int _i64 = 0; _i64 < _list62.size; ++_i64)
+          org.apache.thrift.protocol.TList _list88 = new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, 
iprot.readI32());
+          struct.selectionColumns = new ArrayList<String>(_list88.size);
+          String _elem89;
+          for (int _i90 = 0; _i90 < _list88.size; ++_i90)
           {
-            _elem63 = iprot.readString();
-            struct.selectionColumns.add(_elem63);
+            _elem89 = iprot.readString();
+            struct.selectionColumns.add(_elem89);
           }
         }
         struct.setSelectionColumnsIsSet(true);
       }
       if (incoming.get(1)) {
         {
-          org.apache.thrift.protocol.TList _list65 = new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, 
iprot.readI32());
-          struct.selectionSortSequence = new 
ArrayList<SelectionSort>(_list65.size);
-          SelectionSort _elem66;
-          for (int _i67 = 0; _i67 < _list65.size; ++_i67)
+          org.apache.thrift.protocol.TList _list91 = new 
org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, 
iprot.readI32());
+          struct.selectionSortSequence = new 
ArrayList<SelectionSort>(_list91.size);
+          SelectionSort _elem92;
+          for (int _i93 = 0; _i93 < _list91.size; ++_i93)
           {
-            _elem66 = new SelectionSort();
-            _elem66.read(iprot);
-            struct.selectionSortSequence.add(_elem66);
+            _elem92 = new SelectionSort();
+            _elem92.read(iprot);
+            struct.selectionSortSequence.add(_elem92);
           }
         }
         struct.setSelectionSortSequenceIsSet(true);
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/request/SelectionSort.java 
b/pinot-common/src/main/java/org/apache/pinot/common/request/SelectionSort.java
index aef39a2..413f8fb 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/request/SelectionSort.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/request/SelectionSort.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,30 +6,41 @@
  */
 package org.apache.pinot.common.request;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * AUTO GENERATED: DO NOT EDIT
  * selection-sort : specifies how the search results should be sorted.
  * The results can be sorted based on one or multiple columns
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-5-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class SelectionSort implements org.apache.thrift.TBase<SelectionSort, 
SelectionSort._Fields>, java.io.Serializable, Cloneable, 
Comparable<SelectionSort> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("SelectionSort");
 
@@ -131,9 +124,9 @@ public class SelectionSort implements 
org.apache.thrift.TBase<SelectionSort, Sel
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.COLUMN, new 
org.apache.thrift.meta_data.FieldMetaData("column", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.COLUMN, new 
org.apache.thrift.meta_data.FieldMetaData("column", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.IS_ASC, new 
org.apache.thrift.meta_data.FieldMetaData("isAsc", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.IS_ASC, new 
org.apache.thrift.meta_data.FieldMetaData("isAsc", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SelectionSort.class,
 metaDataMap);
@@ -412,7 +405,7 @@ public class SelectionSort implements 
org.apache.thrift.TBase<SelectionSort, Sel
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
@@ -420,7 +413,7 @@ public class SelectionSort implements 
org.apache.thrift.TBase<SelectionSort, Sel
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.column = iprot.readString();
               struct.setColumnIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -428,7 +421,7 @@ public class SelectionSort implements 
org.apache.thrift.TBase<SelectionSort, Sel
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
               struct.isAsc = iprot.readBool();
               struct.setIsAscIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/common/response/ProcessingException.java
 
b/pinot-common/src/main/java/org/apache/pinot/common/response/ProcessingException.java
index f0463ac..2035406 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/common/response/ProcessingException.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/common/response/ProcessingException.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
  * Autogenerated by Thrift Compiler (0.9.2)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
@@ -24,29 +6,39 @@
  */
 package org.apache.pinot.common.response;
 
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Generated;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
+
 import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
  * Processing exception
- *
+ * 
  */
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2017-5-24")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = 
"2019-1-18")
 public class ProcessingException extends TException implements 
org.apache.thrift.TBase<ProcessingException, ProcessingException._Fields>, 
java.io.Serializable, Cloneable, Comparable<ProcessingException> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new 
org.apache.thrift.protocol.TStruct("ProcessingException");
 
@@ -130,9 +122,9 @@ public class ProcessingException extends TException 
implements org.apache.thrift
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> 
metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 
EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.ERROR_CODE, new 
org.apache.thrift.meta_data.FieldMetaData("errorCode", 
org.apache.thrift.TFieldRequirementType.REQUIRED,
+    tmpMap.put(_Fields.ERROR_CODE, new 
org.apache.thrift.meta_data.FieldMetaData("errorCode", 
org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
-    tmpMap.put(_Fields.MESSAGE, new 
org.apache.thrift.meta_data.FieldMetaData("message", 
org.apache.thrift.TFieldRequirementType.OPTIONAL,
+    tmpMap.put(_Fields.MESSAGE, new 
org.apache.thrift.meta_data.FieldMetaData("message", 
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new 
org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ProcessingException.class,
 metaDataMap);
@@ -421,7 +413,7 @@ public class ProcessingException extends TException 
implements org.apache.thrift
       while (true)
       {
         schemeField = iprot.readFieldBegin();
-        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
           break;
         }
         switch (schemeField.id) {
@@ -429,7 +421,7 @@ public class ProcessingException extends TException 
implements org.apache.thrift
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
               struct.errorCode = iprot.readI32();
               struct.setErrorCodeIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
@@ -437,7 +429,7 @@ public class ProcessingException extends TException 
implements org.apache.thrift
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.message = iprot.readString();
               struct.setMessageIsSet(true);
-            } else {
+            } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, 
schemeField.type);
             }
             break;
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/pql/parsers/Pql2AstListener.java 
b/pinot-common/src/main/java/org/apache/pinot/pql/parsers/Pql2AstListener.java
index 7de7a26..1b6669d 100644
--- 
a/pinot-common/src/main/java/org/apache/pinot/pql/parsers/Pql2AstListener.java
+++ 
b/pinot-common/src/main/java/org/apache/pinot/pql/parsers/Pql2AstListener.java
@@ -35,6 +35,7 @@ import 
org.apache.pinot.pql.parsers.pql2.ast.InPredicateAstNode;
 import org.apache.pinot.pql.parsers.pql2.ast.IntegerLiteralAstNode;
 import org.apache.pinot.pql.parsers.pql2.ast.IsPredicateAstNode;
 import org.apache.pinot.pql.parsers.pql2.ast.LimitAstNode;
+import org.apache.pinot.pql.parsers.pql2.ast.MatchesPredicateAstNode;
 import org.apache.pinot.pql.parsers.pql2.ast.OptionAstNode;
 import org.apache.pinot.pql.parsers.pql2.ast.OptionsAstNode;
 import org.apache.pinot.pql.parsers.pql2.ast.OrderByAstNode;
@@ -291,6 +292,16 @@ public class Pql2AstListener extends PQL2BaseListener {
   }
 
   @Override
+  public void enterMatchesPredicate(@NotNull 
PQL2Parser.MatchesPredicateContext ctx) {
+    pushNode(new MatchesPredicateAstNode());
+  }
+
+  @Override
+  public void exitMatchesPredicate(@NotNull PQL2Parser.MatchesPredicateContext 
ctx) {
+    popNode();
+  }
+  
+  @Override
   public void enterHaving(@NotNull PQL2Parser.HavingContext ctx) {
     pushNode(new HavingAstNode());
   }
diff --git 
a/pinot-common/src/main/java/org/apache/pinot/pql/parsers/pql2/ast/MatchesPredicateAstNode.java
 
b/pinot-common/src/main/java/org/apache/pinot/pql/parsers/pql2/ast/MatchesPredicateAstNode.java
new file mode 100644
index 0000000..7715064
--- /dev/null
+++ 
b/pinot-common/src/main/java/org/apache/pinot/pql/parsers/pql2/ast/MatchesPredicateAstNode.java
@@ -0,0 +1,62 @@
+package org.apache.pinot.pql.parsers.pql2.ast;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.pinot.common.request.BrokerRequest;
+import org.apache.pinot.common.request.FilterOperator;
+import org.apache.pinot.common.utils.request.FilterQueryTree;
+import org.apache.pinot.common.utils.request.HavingQueryTree;
+import org.apache.pinot.pql.parsers.Pql2CompilationException;
+
+public class MatchesPredicateAstNode extends PredicateAstNode {
+
+  private static final String SEPERATOR = "\t\t";
+  private String _identifier;
+
+  @Override
+  public void addChild(AstNode childNode) {
+    if (childNode instanceof IdentifierAstNode) {
+      if (_identifier == null) {
+        IdentifierAstNode node = (IdentifierAstNode) childNode;
+        _identifier = node.getName();
+      } else {
+        throw new Pql2CompilationException("TEXT_MATCH predicate has more than 
one identifier.");
+      }
+    } else if (childNode instanceof FunctionCallAstNode) {
+      throw new Pql2CompilationException("TEXT_MATCH operator can not be 
called for a function.");
+    } else {
+      super.addChild(childNode);
+    }
+  }
+
+  @Override
+  public FilterQueryTree buildFilterQueryTree() {
+    if (_identifier == null) {
+      throw new Pql2CompilationException("TEXT_MATCH predicate has no 
identifier");
+    }
+
+    List<String> values = new ArrayList<>();
+
+    for (AstNode astNode : getChildren()) {
+      if (astNode instanceof LiteralAstNode) {
+        LiteralAstNode node = (LiteralAstNode) astNode;
+        String expr = node.getValueAsString();
+        values.add(expr);
+      }
+    }
+    if (values.size() != 2) {
+      throw new Pql2CompilationException(
+          "TEXT_MATCH expects columnName, 'queryString', 'queryOption'");
+    }
+
+    FilterOperator filterOperator = FilterOperator.TEXT_MATCH;
+    return new FilterQueryTree(_identifier, values, filterOperator, null);
+  }
+
+  @Override
+  public HavingQueryTree buildHavingQueryTree() {
+    throw new Pql2CompilationException("TEXT_MATCH predicate is not supported 
in HAVING clause.");
+  }
+
+}
diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/common/Predicate.java 
b/pinot-core/src/main/java/org/apache/pinot/core/common/Predicate.java
index 41ddd6f..302dd0c 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/common/Predicate.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/common/Predicate.java
@@ -28,12 +28,14 @@ import org.apache.pinot.core.common.predicate.NEqPredicate;
 import org.apache.pinot.core.common.predicate.NotInPredicate;
 import org.apache.pinot.core.common.predicate.RangePredicate;
 import org.apache.pinot.core.common.predicate.RegexpLikePredicate;
+import org.apache.pinot.core.common.predicate.MatchesPredicate;
 
 
 public abstract class Predicate {
 
   public enum Type {
-    EQ, NEQ, REGEXP_LIKE, RANGE, IN, NOT_IN;
+
+    EQ, NEQ, REGEXP_LIKE, RANGE, IN, NOT_IN, MATCHES;
 
     public boolean isExclusive() {
       return this == NEQ || this == NOT_IN;
@@ -74,8 +76,9 @@ public abstract class Predicate {
     final String column = filterQueryTree.getColumn();
     final List<String> value = filterQueryTree.getValue();
 
-    Predicate predicate = null;
+    Predicate predicate;
     switch (filterType) {
+<<<<<<< HEAD
       case EQUALITY:
         predicate = new EqPredicate(column, value);
         break;
@@ -94,8 +97,36 @@ public abstract class Predicate {
       case IN:
         predicate = new InPredicate(column, value);
         break;
+      case TEXT_MATCH:
+        predicate = new MatchesPredicate(column, value);
+        break;
       default:
         throw new UnsupportedOperationException("Unsupported filterType:" + 
filterType);
+=======
+    case EQUALITY:
+      predicate = new EqPredicate(column, value);
+      break;
+    case RANGE:
+      predicate = new RangePredicate(column, value);
+      break;
+    case REGEXP_LIKE:
+      predicate = new RegexpLikePredicate(column, value);
+      break;
+    case NOT:
+      predicate = new NEqPredicate(column, value);
+      break;
+    case NOT_IN:
+      predicate = new NotInPredicate(column, value);
+      break;
+    case IN:
+      predicate = new InPredicate(column, value);
+      break;
+    case MATCHES:
+      predicate = new MatchesPredicate(column, value);
+      break;
+    default:
+      throw new UnsupportedOperationException("Unsupported filterType:" + 
filterType);
+>>>>>>> Enhancing PQL to support MATCHES predicate, can be used for searching 
within text, map, json and other complex objects
     }
     return predicate;
   }
diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/common/predicate/MatchesPredicate.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/common/predicate/MatchesPredicate.java
new file mode 100644
index 0000000..8b0e285
--- /dev/null
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/common/predicate/MatchesPredicate.java
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.core.common.predicate;
+
+import com.google.common.base.Preconditions;
+import java.util.Arrays;
+import java.util.List;
+import org.apache.pinot.core.common.Predicate;
+
+
+public class MatchesPredicate extends Predicate {
+  String _query;
+  String _options;
+  public MatchesPredicate(String lhs, List<String> rhs) {
+    super(lhs, Type.MATCHES, rhs);
+    Preconditions.checkArgument(rhs.size() == 2);
+    _query = rhs.get(0);
+    _options = rhs.get(1);
+  }
+
+  @Override
+  public String toString() {
+    return "Predicate: type: " + getType() + ", left : " + getLhs() + ", right 
: " + Arrays.toString(new String[]{_query, _options}) + "\n";
+  }
+  
+  public String getQuery(){
+   return _query;
+  }
+
+  public String getQueryOptions(){
+    return _options;
+  }
+
+}
diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/operator/filter/predicate/MatchesPredicateEvaluatorFactory.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/operator/filter/predicate/MatchesPredicateEvaluatorFactory.java
new file mode 100644
index 0000000..26b7e16
--- /dev/null
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/operator/filter/predicate/MatchesPredicateEvaluatorFactory.java
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.core.operator.filter.predicate;
+
+import org.apache.pinot.common.data.FieldSpec;
+import org.apache.pinot.core.common.Predicate;
+import org.apache.pinot.core.common.predicate.MatchesPredicate;
+
+public class MatchesPredicateEvaluatorFactory {
+  private MatchesPredicateEvaluatorFactory() {
+  }
+
+  /**
+   * Create a new instance of raw value based REGEXP_LIKE predicate evaluator.
+   * @param textMatchPredicate REGEXP_LIKE predicate to evaluate
+   * @param dataType Data type for the column
+   * @return Raw value based REGEXP_LIKE predicate evaluator
+   */
+  public static BaseRawValueBasedPredicateEvaluator newRawValueBasedEvaluator(
+      MatchesPredicate textMatchPredicate, FieldSpec.DataType dataType) {
+    return new RawValueBasedTextMatchPredicateEvaluator(textMatchPredicate);
+  }
+
+  public static final class RawValueBasedTextMatchPredicateEvaluator
+      extends BaseRawValueBasedPredicateEvaluator {
+    String _query;
+    String _options;
+
+    public RawValueBasedTextMatchPredicateEvaluator(MatchesPredicate 
textMatchPredicate) {
+      _query = textMatchPredicate.getQuery();
+      _options = textMatchPredicate.getQueryOptions();
+    }
+
+    @Override
+    public Predicate.Type getPredicateType() {
+      return Predicate.Type.MATCHES;
+    }
+
+    @Override
+    public boolean applySV(String value) {
+      throw new UnsupportedOperationException(
+          "Text Match is not supported via scanning, its supported only via 
inverted index");
+    }
+
+    public String getQueryString() {
+      return _query;
+    }
+
+    public String getQueryOptions() {
+      return _options;
+    }
+  }
+}
diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/operator/filter/predicate/PredicateEvaluatorProvider.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/operator/filter/predicate/PredicateEvaluatorProvider.java
index 3acb0dd..80626ca 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/operator/filter/predicate/PredicateEvaluatorProvider.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/operator/filter/predicate/PredicateEvaluatorProvider.java
@@ -27,6 +27,7 @@ import org.apache.pinot.core.common.predicate.NEqPredicate;
 import org.apache.pinot.core.common.predicate.NotInPredicate;
 import org.apache.pinot.core.common.predicate.RangePredicate;
 import org.apache.pinot.core.common.predicate.RegexpLikePredicate;
+import org.apache.pinot.core.common.predicate.MatchesPredicate;
 import org.apache.pinot.core.query.exception.BadQueryRequestException;
 import org.apache.pinot.core.segment.index.readers.Dictionary;
 
@@ -53,6 +54,7 @@ public class PredicateEvaluatorProvider {
           case REGEXP_LIKE:
             return RegexpLikePredicateEvaluatorFactory
                 .newDictionaryBasedEvaluator((RegexpLikePredicate) predicate, 
dictionary);
+          case MATCHES:
           default:
             throw new UnsupportedOperationException("Unsupported predicate 
type: " + predicate.getType());
         }
@@ -72,7 +74,9 @@ public class PredicateEvaluatorProvider {
           case REGEXP_LIKE:
             return RegexpLikePredicateEvaluatorFactory
                 .newRawValueBasedEvaluator((RegexpLikePredicate) predicate, 
dataType);
-          default:
+          case MATCHES:
+            return 
MatchesPredicateEvaluatorFactory.newRawValueBasedEvaluator((MatchesPredicate) 
predicate, dataType);
+        default:
             throw new UnsupportedOperationException("Unsupported predicate 
type: " + predicate.getType());
         }
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to