dengzhhu653 commented on code in PR #6595: URL: https://github.com/apache/hive/pull/6595#discussion_r4290852591
########## standalone-metastore/metastore-search/src/main/java/org/apache/hive/search/mapping/IndexMapping.java: ########## @@ -0,0 +1,138 @@ +/* + * 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.hive.search.mapping; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.apache.hadoop.conf.Configuration; +import org.apache.hive.search.config.IndexOptions; +import org.apache.hive.search.config.IndexStoreOptions; +import org.apache.hive.search.config.InferenceOptions; +import org.apache.hive.search.config.SearchOptions; +import org.apache.hive.search.exception.SearchException; +import org.apache.hive.search.metastore.MetastoreTableMapper; +import org.apache.hive.search.metastore.SearchTextSegment; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.core.KeywordAnalyzer; +import org.apache.lucene.analysis.miscellaneous.PerFieldAnalyzerWrapper; +import org.apache.lucene.analysis.standard.StandardAnalyzer; + +public record IndexMapping(Configuration configuration, Map<String, FieldSchema> fields) { Review Comment: This IndexMapping(logical) abstracts away from how the index is organized in the storage(physical), and the reader(Searcher) uses this mapping to validate the input or find the index fields the current query looks for. Another case is if we want to buy Solr/OpenSearch in the future, we don't need to care about how/what the real field for, as the mapping can be versioned, we just transform this mapping fields received to the layout the storage/persistence layer wants. -- 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]
