zabetak commented on code in PR #3628:
URL: https://github.com/apache/hive/pull/3628#discussion_r984763146
##########
ql/src/test/org/apache/hadoop/hive/ql/io/parquet/convert/TestETypeConverter.java:
##########
@@ -212,23 +216,61 @@ public void
testGetInt64NanosAdjustedToUTCTimestampConverter() throws Exception
}
@Test
- public void testGetTextConverter() throws Exception {
+ public void testGetTextConverterForString() throws Exception {
PrimitiveType primitiveType = Types.optional(PrimitiveTypeName.BINARY)
- .as(LogicalTypeAnnotation.stringType()).named("value");
- Writable writable = getWritableFromBinaryConverter(new VarcharTypeInfo(),
primitiveType,
- Binary.fromString("this_is_a_value"));
- Text textWritable = (Text) writable;
- assertEquals("this_is_a_value", textWritable.toString());
+ .as(LogicalTypeAnnotation.stringType()).named("value");
+ String value = "this_is_a_value";
+ Text textWritable = (Text) getWritableFromBinaryConverter(stringTypeInfo,
primitiveType,
+ Binary.fromString(value));
+ assertEquals(value, textWritable.toString());
}
@Test
- public void testGetTextConverterNoHiveTypeInfo() throws Exception {
+ public void testGetTextConverterForCharPadsValueWithSpacesTillLen() {
+ PrimitiveType primitiveType = Types.optional(PrimitiveTypeName.BINARY)
+ .as(LogicalTypeAnnotation.stringType()).named("value");
+ String value = "this_is_a_value";
+ HiveCharWritable textWritable = (HiveCharWritable)
getWritableFromBinaryConverter(
+ new CharTypeInfo(value.length() + 2), primitiveType,
Binary.fromString(value));
+ assertEquals(value + " ", textWritable.toString());
+ }
+
+ public void testGetTextConverterForCharTruncatesValueExceedingLen() {
Review Comment:
Probably the `@Test` annotations needs to be added here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]