Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HIVE-28585]: Ensure SerDes is case insensitive for data type-'string' to align with HQL and SQL #5515

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
Original file line number Diff line number Diff line change
Expand Up @@ -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());
shivjha30 marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
12 changes: 12 additions & 0 deletions serde/src/test/org/apache/hadoop/hive/serde2/TestOpenCSVSerde.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> row = (List<String>) 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);
Expand Down
Loading