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

Fix map assertion in TestLazyMap #20337

Merged
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 @@ -28,7 +28,7 @@
import static org.apache.hadoop.hive.serde2.lazy.LazyFactory.createLazyObject;
import static org.apache.hadoop.hive.serde2.lazy.objectinspector.LazyObjectInspectorFactory.getLazySimpleMapObjectInspector;
import static org.apache.hadoop.hive.serde2.lazy.objectinspector.primitive.LazyPrimitiveObjectInspectorFactory.getLazyStringObjectInspector;
import static org.testng.Assert.assertEquals;
import static org.assertj.core.api.Assertions.assertThat;

public class TestLazyMap
{
Expand All @@ -45,7 +45,7 @@ public void test()
assertMapDecode("\\N\u0003ignored\u0002\u0003", ImmutableMap.of(lazyString(""), lazyString("")));

HashMap<Object, Object> expectedMap = new HashMap<>();
expectedMap.put("null", null);
expectedMap.put(lazyString("null"), null);
assertMapDecode("\\N\u0003ignored\u0002null\u0003\\N", expectedMap);
}

Expand All @@ -63,7 +63,7 @@ public static void assertMapDecode(String encodedMap, Map<? extends Object, ? ex
lazyMap.init(newByteArrayRef(encodedMap), 0, encodedMap.length());

Map<Object, Object> map = lazyMap.getMap();
assertEquals(map, expectedMap);
assertThat(map).isEqualTo(expectedMap);
}

private static LazyString lazyString(String string)
Expand Down
Loading