org.apache.hadoop.hive.accumulo.LazyAccumuloMap Maven / Gradle / Ivy
The newest version!
/*
* 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.hadoop.hive.accumulo;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.hadoop.hive.accumulo.AccumuloHiveRow.ColumnTuple;
import org.apache.hadoop.hive.accumulo.columns.ColumnEncoding;
import org.apache.hadoop.hive.accumulo.columns.HiveAccumuloMapColumnMapping;
import org.apache.hadoop.hive.serde2.lazy.ByteArrayRef;
import org.apache.hadoop.hive.serde2.lazy.LazyFactory;
import org.apache.hadoop.hive.serde2.lazy.LazyMap;
import org.apache.hadoop.hive.serde2.lazy.LazyObject;
import org.apache.hadoop.hive.serde2.lazy.LazyPrimitive;
import org.apache.hadoop.hive.serde2.lazy.objectinspector.LazyMapObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import com.google.common.base.Charsets;
/**
* A Hive Map created from some collection of Key-Values from one to many column families with one
* to many column qualifiers.
*/
public class LazyAccumuloMap extends LazyMap {
protected AccumuloHiveRow sourceRow;
protected HiveAccumuloMapColumnMapping columnMapping;
public LazyAccumuloMap(LazyMapObjectInspector oi) {
super(oi);
}
public void init(AccumuloHiveRow row, HiveAccumuloMapColumnMapping columnMapping) {
this.sourceRow = row;
this.columnMapping = columnMapping;
this.setParsed(false);
}
protected void parse() {
if (null == this.cachedMap) {
this.cachedMap = new LinkedHashMap
© 2015 - 2025 Weber Informatics LLC | Privacy Policy