diff --git a/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java b/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java index c61b4c3c581c..c595fdb8e543 100644 --- a/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java +++ b/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java @@ -384,7 +384,7 @@ public static PrimitiveTypeEntry getTypeEntryFromPrimitiveWritableClass( * Get the TypeEntry for the given base type name (int, varchar, etc). */ public static PrimitiveTypeEntry getTypeEntryFromTypeName(String typeName) { - return typeNameToTypeEntry.get(typeName); + return typeNameToTypeEntry.get(typeName.toLowerCase()); } /** diff --git a/serde/src/test/org/apache/hadoop/hive/serde2/TestOpenCSVSerde.java b/serde/src/test/org/apache/hadoop/hive/serde2/TestOpenCSVSerde.java index 7bba591f7e99..f4aa949777ca 100644 --- a/serde/src/test/org/apache/hadoop/hive/serde2/TestOpenCSVSerde.java +++ b/serde/src/test/org/apache/hadoop/hive/serde2/TestOpenCSVSerde.java @@ -39,6 +39,18 @@ public void setup() throws Exception { props.setProperty(serdeConstants.LIST_COLUMN_TYPES, "string,string,string"); } + + @Test + public void testColumnDeserializeCase() throws Exception { + props.setProperty(serdeConstants.LIST_COLUMN_TYPES, "STRING,String,string"); + csv.initialize(null, props, null); + final Text in = new Text("hello,\"yes, okay\",1"); + final List row = (List) csv.deserialize(in); + assertEquals("hello", row.get(0)); + assertEquals("yes, okay", row.get(1)); + assertEquals("1", row.get(2)); + } + @Test public void testDeserialize() throws Exception { csv.initialize(null, props, null);