twdsilva commented on a change in pull request #428: PHOENIX-374: Enable access to dynamic columns in * or cf.* selection URL: https://github.com/apache/phoenix/pull/428#discussion_r250334775
########## File path: phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DynamicColumnWildcard.java ########## @@ -0,0 +1,141 @@ +/* + * 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.phoenix.coprocessor; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.client.Mutation; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.coprocessor.ObserverContext; +import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor; +import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; +import org.apache.hadoop.hbase.coprocessor.RegionObserver; +import org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.phoenix.coprocessor.generated.DynamicColumnMetaDataProtos; +import org.apache.phoenix.coprocessor.generated.PTableProtos; +import org.apache.phoenix.schema.PColumn; +import org.apache.phoenix.schema.PColumnImpl; +import org.apache.phoenix.util.ServerUtil; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.NavigableMap; +import java.util.Optional; + +/** + * Coprocessor for exposing dynamic columns in wildcard queries. This coprocessor will be registered + * to physical HBase tables only i.e. PTableType.TABLE and is driven by the client-side config + * QueryServices.WILDCARD_QUERY_DYNAMIC_COLS_ATTRIB + * See PHOENIX-374 + */ +public class DynamicColumnWildcard implements RegionObserver, RegionCoprocessor { + + private static final Log LOG = LogFactory.getLog(DynamicColumnWildcard.class); + // Scan attribute that is set in case we want to project dynamic columns + public static final String WILDCARD_SCAN_INCLUDES_DYNAMIC_COLUMNS = + "_WildcardScanIncludesDynCols"; + public static final byte[] DYN_COLS_METADATA_CELL_QUALIFIER = Bytes.toBytes("#Dyn_"); Review comment: Can you change this to something shorter to save space maybe "D#" ? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
