You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by gu...@apache.org on 2013/10/25 07:28:54 UTC
svn commit: r1535641 - in /hive/branches/tez: ./
hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/
hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/schema/
hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/
hcatalog/c...
Author: gunther
Date: Fri Oct 25 05:28:53 2013
New Revision: 1535641
URL: http://svn.apache.org/r1535641
Log:
Merge latest trunk into branch. (Gunther Hagleitner)
Modified:
hive/branches/tez/ (props changed)
hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/HCatRecord.java
hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/schema/HCatSchema.java
hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/HCatReader.java
hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/HCatWriter.java
hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/HCatOutputFormat.java
hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/InputJobInfo.java
hive/branches/tez/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatLoader.java
hive/branches/tez/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatStorer.java
hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java
hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/PigDelegator.java
hive/branches/tez/ivy/libraries.properties
hive/branches/tez/metastore/src/test/org/apache/hadoop/hive/metastore/TestMetastoreVersion.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java
hive/branches/tez/ql/src/test/queries/clientpositive/import_exported_table.q
hive/branches/tez/ql/src/test/queries/clientpositive/udf_concat.q
hive/branches/tez/ql/src/test/results/clientpositive/udf_concat.q.out
hive/branches/tez/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java
Propchange: hive/branches/tez/
------------------------------------------------------------------------------
Merged /hive/trunk:r1535145-1535640
Modified: hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/HCatRecord.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/HCatRecord.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/HCatRecord.java (original)
+++ hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/HCatRecord.java Fri Oct 25 05:28:53 2013
@@ -22,6 +22,8 @@ package org.apache.hive.hcatalog.data;
import java.util.List;
import java.util.Map;
+import org.apache.hadoop.hive.common.classification.InterfaceAudience;
+import org.apache.hadoop.hive.common.classification.InterfaceStability;
import org.apache.hive.hcatalog.common.HCatException;
import org.apache.hive.hcatalog.data.schema.HCatSchema;
@@ -31,6 +33,8 @@ import org.apache.hive.hcatalog.data.sch
* HCatRecord is designed only to be used as in-memory representation only.
* Don't use it to store data on the physical device.
*/
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
public abstract class HCatRecord implements HCatRecordable {
public abstract Object get(String fieldName, HCatSchema recordSchema) throws HCatException;
Modified: hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/schema/HCatSchema.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/schema/HCatSchema.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/schema/HCatSchema.java (original)
+++ hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/schema/HCatSchema.java Fri Oct 25 05:28:53 2013
@@ -25,12 +25,15 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.apache.hadoop.hive.common.classification.InterfaceAudience;
+import org.apache.hadoop.hive.common.classification.InterfaceStability;
import org.apache.hive.hcatalog.common.HCatException;
/**
* HCatSchema. This class is NOT thread-safe.
*/
-
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
public class HCatSchema implements Serializable {
private static final long serialVersionUID = 1L;
Modified: hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/HCatReader.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/HCatReader.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/HCatReader.java (original)
+++ hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/HCatReader.java Fri Oct 25 05:28:53 2013
@@ -24,6 +24,8 @@ import java.util.Map;
import java.util.Map.Entry;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.common.classification.InterfaceAudience;
+import org.apache.hadoop.hive.common.classification.InterfaceStability;
import org.apache.hive.hcatalog.common.HCatException;
import org.apache.hive.hcatalog.data.HCatRecord;
import org.apache.hive.hcatalog.data.transfer.state.StateProvider;
@@ -32,7 +34,8 @@ import org.apache.hive.hcatalog.data.tra
* This abstract class is internal to HCatalog and abstracts away the notion of
* underlying system from which reads will be done.
*/
-
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
public abstract class HCatReader {
/**
Modified: hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/HCatWriter.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/HCatWriter.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/HCatWriter.java (original)
+++ hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/HCatWriter.java Fri Oct 25 05:28:53 2013
@@ -24,6 +24,8 @@ import java.util.Map;
import java.util.Map.Entry;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.common.classification.InterfaceAudience;
+import org.apache.hadoop.hive.common.classification.InterfaceStability;
import org.apache.hive.hcatalog.common.HCatException;
import org.apache.hive.hcatalog.data.HCatRecord;
import org.apache.hive.hcatalog.data.transfer.state.StateProvider;
@@ -33,7 +35,8 @@ import org.apache.hive.hcatalog.data.tra
* HCatalog from external systems. Don't try to instantiate this directly.
* Instead, use {@link DataTransferFactory}
*/
-
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
public abstract class HCatWriter {
protected Configuration conf;
Modified: hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/HCatOutputFormat.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/HCatOutputFormat.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/HCatOutputFormat.java (original)
+++ hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/HCatOutputFormat.java Fri Oct 25 05:28:53 2013
@@ -28,6 +28,8 @@ import java.util.Map;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
+import org.apache.hadoop.hive.common.classification.InterfaceAudience;
+import org.apache.hadoop.hive.common.classification.InterfaceStability;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
import org.apache.hadoop.hive.metastore.HiveMetaStoreClient;
@@ -52,6 +54,8 @@ import org.slf4j.LoggerFactory;
/** The OutputFormat to use to write data to HCatalog. The key value is ignored and
* should be given as null. The value is the HCatRecord to write.*/
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
public class HCatOutputFormat extends HCatBaseOutputFormat {
static final private Logger LOG = LoggerFactory.getLogger(HCatOutputFormat.class);
Modified: hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/InputJobInfo.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/InputJobInfo.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/InputJobInfo.java (original)
+++ hive/branches/tez/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/InputJobInfo.java Fri Oct 25 05:28:53 2013
@@ -36,7 +36,7 @@ import java.util.zip.InflaterInputStream
* Container for metadata read from the metadata server.
* Prior to release 0.5, InputJobInfo was a key part of the public API, exposed directly
* to end-users as an argument to
- * {@link HCatInputFormat#setInput(org.apache.hadoop.mapreduce.Job, InputJobInfo)}.
+ * HCatInputFormat#setInput(org.apache.hadoop.mapreduce.Job, InputJobInfo).
* Going forward, we plan on treating InputJobInfo as an implementation detail and no longer
* expose to end-users. Should you have a need to use InputJobInfo outside HCatalog itself,
* please contact the developer mailing list before depending on this class.
Modified: hive/branches/tez/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatLoader.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatLoader.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatLoader.java (original)
+++ hive/branches/tez/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatLoader.java Fri Oct 25 05:28:53 2013
@@ -27,6 +27,8 @@ import java.util.Map.Entry;
import java.util.Properties;
import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.common.classification.InterfaceAudience;
+import org.apache.hadoop.hive.common.classification.InterfaceStability;
import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hadoop.hive.ql.metadata.Table;
import org.apache.hadoop.mapreduce.InputFormat;
@@ -49,7 +51,8 @@ import org.apache.pig.impl.util.UDFConte
/**
* Pig {@link org.apache.pig.LoadFunc} to read data from HCat
*/
-
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
public class HCatLoader extends HCatBaseLoader {
private static final String PARTITION_FILTER = "partition.filter"; // for future use
Modified: hive/branches/tez/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatStorer.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatStorer.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatStorer.java (original)
+++ hive/branches/tez/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatStorer.java Fri Oct 25 05:28:53 2013
@@ -27,6 +27,8 @@ import java.util.Map.Entry;
import java.util.Properties;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.common.classification.InterfaceAudience;
+import org.apache.hadoop.hive.common.classification.InterfaceStability;
import org.apache.hadoop.hive.shims.ShimLoader;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.OutputFormat;
@@ -48,7 +50,8 @@ import org.apache.pig.impl.util.UDFConte
* HCatStorer.
*
*/
-
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
public class HCatStorer extends HCatBaseStorer {
// Signature for wrapped storer, see comments in LoadFuncBasedInputDriver.initialize
Modified: hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java (original)
+++ hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java Fri Oct 25 05:28:53 2013
@@ -28,6 +28,8 @@ import java.util.HashMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hive.common.classification.InterfaceAudience;
+import org.apache.hadoop.hive.common.classification.InterfaceStability;
import org.apache.hadoop.hdfs.web.AuthFilter;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.GenericOptionsParser;
@@ -45,6 +47,8 @@ import org.slf4j.bridge.SLF4JBridgeHandl
/**
* The main executable that starts up and runs the Server.
*/
+@InterfaceAudience.LimitedPrivate("Integration Tests")
+@InterfaceStability.Unstable
public class Main {
public static final String SERVLET_PATH = "templeton";
private static final Log LOG = LogFactory.getLog(Main.class);
Modified: hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/PigDelegator.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/PigDelegator.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/PigDelegator.java (original)
+++ hive/branches/tez/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/PigDelegator.java Fri Oct 25 05:28:53 2013
@@ -67,7 +67,7 @@ public class PigDelegator extends Launch
* @param usehcatalog whether the command uses hcatalog/needs to connect
* to hive metastore server
* @param completedUrl call back url
- * @return
+ * @return list of arguments
* @throws BadParam
* @throws IOException
* @throws InterruptedException
Modified: hive/branches/tez/ivy/libraries.properties
URL: http://svn.apache.org/viewvc/hive/branches/tez/ivy/libraries.properties?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/ivy/libraries.properties (original)
+++ hive/branches/tez/ivy/libraries.properties Fri Oct 25 05:28:53 2013
@@ -45,8 +45,8 @@ derby.version=10.4.2.0
guava.version=11.0.2
groovy.version=2.1.6
hbase.version=0.94.6.1
-httpclient.version=4.2.5
-httpcore.version=4.2.4
+httpclient.version=4.1.3
+httpcore.version=4.1.3
jackson.version=1.8.8
javaewah.version=0.3.2
jdo-api.version=3.0.1
Modified: hive/branches/tez/metastore/src/test/org/apache/hadoop/hive/metastore/TestMetastoreVersion.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/metastore/src/test/org/apache/hadoop/hive/metastore/TestMetastoreVersion.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/metastore/src/test/org/apache/hadoop/hive/metastore/TestMetastoreVersion.java (original)
+++ hive/branches/tez/metastore/src/test/org/apache/hadoop/hive/metastore/TestMetastoreVersion.java Fri Oct 25 05:28:53 2013
@@ -89,8 +89,9 @@ public class TestMetastoreVersion extend
// session creation should fail since the schema didn't get created
try {
SessionState.start(new CliSessionState(hiveConf));
+ fail("Expected exception");
} catch (RuntimeException re) {
- assertTrue(re.getCause().getCause() instanceof MetaException);
+ assertTrue(re.getCause().getCause().getCause() instanceof MetaException);
}
}
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java Fri Oct 25 05:28:53 2013
@@ -289,6 +289,8 @@ public class SessionState {
ShimLoader.getHadoopShims().getUGIForConf(startSs.conf);
FileSystem.get(startSs.conf);
} catch (Exception e) {
+ // catch-all due to some exec time dependencies on session state
+ // that would cause ClassNoFoundException otherwise
throw new RuntimeException(e);
}
Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java Fri Oct 25 05:28:53 2013
@@ -61,7 +61,6 @@ public class GenericUDFConcat extends Ge
public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
// Loop through all the inputs to determine the appropriate return type/length.
- // Either all arguments are binary, or all columns are non-binary.
// Return type:
// All VARCHAR inputs: return VARCHAR
// All BINARY inputs: return BINARY
@@ -85,21 +84,16 @@ public class GenericUDFConcat extends Ge
case BINARY:
fixedLengthReturnValue = false;
if (returnType != currentCategory) {
- throw new UDFArgumentException(
- "CONCAT cannot take a mix of binary and non-binary arguments");
+ // mix of binary/non-binary args
+ returnType = PrimitiveCategory.STRING;
}
break;
case VARCHAR:
- if (returnType == PrimitiveCategory.BINARY) {
- throw new UDFArgumentException(
- "CONCAT cannot take a mix of binary and non-binary arguments");
+ if (!fixedLengthReturnValue) {
+ returnType = PrimitiveCategory.STRING;
}
break;
default:
- if (returnType == PrimitiveCategory.BINARY) {
- throw new UDFArgumentException(
- "CONCAT cannot take a mix of binary and non-binary arguments");
- }
returnType = PrimitiveCategory.STRING;
fixedLengthReturnValue = false;
break;
Modified: hive/branches/tez/ql/src/test/queries/clientpositive/import_exported_table.q
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/queries/clientpositive/import_exported_table.q?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/queries/clientpositive/import_exported_table.q (original)
+++ hive/branches/tez/ql/src/test/queries/clientpositive/import_exported_table.q Fri Oct 25 05:28:53 2013
@@ -6,5 +6,5 @@ IMPORT FROM '/tmp/test/exported_table';
DESCRIBE j1_41;
SELECT * from j1_41;
-dfs -rmr hdfs:///tmp/test/exported_table;
+dfs -rmr hdfs:///tmp/test;
Modified: hive/branches/tez/ql/src/test/queries/clientpositive/udf_concat.q
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/queries/clientpositive/udf_concat.q?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/queries/clientpositive/udf_concat.q (original)
+++ hive/branches/tez/ql/src/test/queries/clientpositive/udf_concat.q Fri Oct 25 05:28:53 2013
@@ -13,3 +13,9 @@ SELECT
concat(1),
concat('1234', 'abc', 'extra argument')
FROM src LIMIT 1;
+
+-- binary/mixed
+SELECT
+ concat(cast('ab' as binary), cast('cd' as binary)),
+ concat('ab', cast('cd' as binary))
+FROM src LIMIT 1;
Modified: hive/branches/tez/ql/src/test/results/clientpositive/udf_concat.q.out
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/results/clientpositive/udf_concat.q.out?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/ql/src/test/results/clientpositive/udf_concat.q.out (original)
+++ hive/branches/tez/ql/src/test/results/clientpositive/udf_concat.q.out Fri Oct 25 05:28:53 2013
@@ -43,3 +43,20 @@ POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
#### A masked pattern was here ####
ab abc NULL NULL a NULL 123a 12 1 1234abcextra argument
+PREHOOK: query: -- binary/mixed
+SELECT
+ concat(cast('ab' as binary), cast('cd' as binary)),
+ concat('ab', cast('cd' as binary))
+FROM src LIMIT 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: -- binary/mixed
+SELECT
+ concat(cast('ab' as binary), cast('cd' as binary)),
+ concat('ab', cast('cd' as binary))
+FROM src LIMIT 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+abcd abcd
Modified: hive/branches/tez/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java?rev=1535641&r1=1535640&r2=1535641&view=diff
==============================================================================
--- hive/branches/tez/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java (original)
+++ hive/branches/tez/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java Fri Oct 25 05:28:53 2013
@@ -21,6 +21,7 @@ package org.apache.hadoop.hive.serde2.ob
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
+import java.nio.charset.CharacterCodingException;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.HashMap;
@@ -773,6 +774,16 @@ public final class PrimitiveObjectInspec
case VOID:
result = null;
break;
+ case BINARY:
+ try {
+ byte[] bytes = ((BinaryObjectInspector) oi).getPrimitiveWritableObject(o).getBytes();
+ int byteLen = ((BinaryObjectInspector) oi).getPrimitiveWritableObject(o).getLength();
+ result = Text.decode(bytes, 0, byteLen);
+ } catch (CharacterCodingException err) {
+ // we tried ..
+ result = null;
+ }
+ break;
case BOOLEAN:
result = String.valueOf((((BooleanObjectInspector) oi).get(o)));
break;