amrishlal commented on a change in pull request #7876: URL: https://github.com/apache/pinot/pull/7876#discussion_r765080186
########## 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: It seems like you have more things in mind than what is coming through across this PR and your last PR on JSON. It almost seems like we should have a design document here so that the path you are perusing is clear. My original question still remains unanswered: Why do we need to intercept requests to index JSON column? Just registering the indexer should be sufficient, right? > With the right plugins, I should be able to store destructured JSON in a JSON column With the right "storage" plugin, you could store destructured JSON into a JSON column or store destructed JSON into multiple columns, etc. An "indexing" plugin may then be associated with a corresponding storage plugin if needed. (and still not sure where protobuf comes into this). I really think we need to take the time to create a design document here, as to what you are trying to do and what the end goal is, before we move forward with further changes. -- 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]
