Skip to content
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.

support hive 3 serde interfaces/remove deprecated hive api references #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ apply plugin: 'com.github.ben-manes.versions'
ext.configDir = new File(rootDir, 'config')
ext.hadoopBinaries = "${rootDir}/hadoop-binaries".toString()
ext.javaDriverVersion = '3.2.1'
ext.hiveVersion = System.getenv("HIVE_VERSION") ?: '1.2.1'
ext.hiveVersion = System.getenv("HIVE_VERSION") ?: '3.1.1'
ext.pigVersion = System.getenv("PIG_VERSION") ?: '0.15.0'
ext.hadoopVersion = System.getenv("HADOOP_VERSION") ?: '2.7.2'
ext.hadoopVersion = System.getenv("HADOOP_VERSION") ?: '3.1.0'
ext.sparkVersion = System.getenv("SPARK_VERSION") ?: '1.6.0'
ext.scalaVersion = System.getenv("SCALA_VERSION") ?: '2.11'
ext.isHadoopV1 = "$hadoopVersion".startsWith("1.")
Expand Down
4 changes: 2 additions & 2 deletions hive/src/main/java/com/mongodb/hadoop/hive/BSONSerDe.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.serde.serdeConstants;
import org.apache.hadoop.hive.serde2.SerDe;
import org.apache.hadoop.hive.serde2.AbstractSerDe;
import org.apache.hadoop.hive.serde2.SerDeException;
import org.apache.hadoop.hive.serde2.SerDeStats;
import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
Expand Down Expand Up @@ -62,7 +62,7 @@
* The BSONSerDe class deserializes (parses) and serializes object from BSON to Hive represented object. It's initialized with the hive
* columns and hive recognized types as well as other config variables mandated by the StorageHanders.
*/
public class BSONSerDe implements SerDe {
public class BSONSerDe extends AbstractSerDe {
private static final Log LOG = LogFactory.getLog(BSONSerDe.class);

// stores the 1-to-1 mapping of MongoDB fields to hive columns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.metastore.HiveMetaHook;
import org.apache.hadoop.hive.metastore.MetaStoreUtils;
import org.apache.hadoop.hive.metastore.utils.MetaStoreUtils;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.Table;
import org.apache.hadoop.hive.ql.index.IndexPredicateAnalyzer;
Expand All @@ -36,8 +36,8 @@
import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
import org.apache.hadoop.hive.ql.plan.TableDesc;
import org.apache.hadoop.hive.serde.serdeConstants;
import org.apache.hadoop.hive.serde2.AbstractSerDe;
import org.apache.hadoop.hive.serde2.Deserializer;
import org.apache.hadoop.hive.serde2.SerDe;
import org.apache.hadoop.mapred.InputFormat;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.OutputFormat;
Expand Down Expand Up @@ -84,7 +84,7 @@ public HiveMetaHook getMetaHook() {
}

@Override
public Class<? extends SerDe> getSerDeClass() {
public Class<? extends AbstractSerDe> getSerDeClass() {
return BSONSerDe.class;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.ql.exec.Utilities;
import org.apache.hadoop.hive.ql.exec.SerializationUtilities;
import org.apache.hadoop.hive.ql.index.IndexPredicateAnalyzer;
import org.apache.hadoop.hive.ql.index.IndexSearchCondition;
import org.apache.hadoop.hive.ql.io.HiveInputFormat;
Expand Down Expand Up @@ -131,7 +131,7 @@ DBObject getFilter(
String serializedExpr = conf.get(TableScanDesc.FILTER_EXPR_CONF_STR);
if (serializedExpr != null) {
ExprNodeGenericFuncDesc expr =
Utilities.deserializeExpression(serializedExpr);
SerializationUtilities.deserializeExpression(serializedExpr);
IndexPredicateAnalyzer analyzer =
IndexPredicateAnalyzer.createAnalyzer(false);

Expand Down