amrishlal commented on a change in pull request #7876:
URL: https://github.com/apache/pinot/pull/7876#discussion_r765026000



##########
File path: 
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/creator/JsonIndexers.java
##########
@@ -0,0 +1,54 @@
+/**
+ * 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.segment.spi.index.creator;
+
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Function;
+
+
+/**
+ * Registration point to allow overriding of JsonIndexing
+ */
+public final class JsonIndexers {
+
+  private JsonIndexers() {
+  }
+
+  private static final DefaultJsonIndexer DEFAULT_JSON_INDEXER = new 
DefaultJsonIndexer();
+  private static final Function<JsonIndexer, JsonIndexer> DEFAULT = 
Function.identity();
+  private static final AtomicReference<Function<JsonIndexer, JsonIndexer>> 
REGISTERED = new AtomicReference<>(DEFAULT);
+
+  /**
+   * Register a decorator which gets wraps the default JSON indexer so that it 
can intercept requests to

Review comment:
       We don't need to assume that. Whatever is in the `JSON` datatype column 
has to be JSON. The reason we want to do this is to make subsequent query 
processing and indexing simpler (just like only integer values can be in INT 
columns). If we introduce Protobuf support later on, I really hope that we 
would do so by introducing a new datatype as well. JSON specification is very 
specific, so we should not overload the use of term JSON to mean things that 
JSON specification isn't.
   
   The plugin concept, in my view, would be useful to have different 
implementations of JSON index. For example a tree based JSON index or a 
Hashtable based JSON index which could help in optimizing particular types of 
JSON queries. However, we should keep these a JSON index, separate from 
ComplexType index, or a Protobuf index.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to