You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemall.apache.org by my...@apache.org on 2018/11/06 10:42:37 UTC
[1/2] incubator-hivemall git commit: Fixed failing test
Repository: incubator-hivemall
Updated Branches:
refs/heads/master 037a96c6a -> 880ee8a2a
Fixed failing test
Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/d13ac418
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/d13ac418
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/d13ac418
Branch: refs/heads/master
Commit: d13ac4185872478ddc9fac71060cd018e7e991fd
Parents: 037a96c
Author: Makoto Yui <my...@apache.org>
Authored: Tue Nov 6 19:41:15 2018 +0900
Committer: Makoto Yui <my...@apache.org>
Committed: Tue Nov 6 19:41:15 2018 +0900
----------------------------------------------------------------------
.../test/java/hivemall/sketch/bloom/BloomContainsUDFTest.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/d13ac418/core/src/test/java/hivemall/sketch/bloom/BloomContainsUDFTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/hivemall/sketch/bloom/BloomContainsUDFTest.java b/core/src/test/java/hivemall/sketch/bloom/BloomContainsUDFTest.java
index 58e0db9..4478da8 100644
--- a/core/src/test/java/hivemall/sketch/bloom/BloomContainsUDFTest.java
+++ b/core/src/test/java/hivemall/sketch/bloom/BloomContainsUDFTest.java
@@ -33,7 +33,7 @@ import org.junit.Test;
public class BloomContainsUDFTest {
@Test
- public void test() throws IOException, HiveException {
+ public void testUDF() throws IOException, HiveException {
BloomContainsUDF udf = new BloomContainsUDF();
final long seed = 43L;
final int size = 100;
@@ -47,7 +47,8 @@ public class BloomContainsUDFTest {
double d = rnd1.nextGaussian();
String s = Double.toHexString(d);
key.set(s);
- Assert.assertEquals(Boolean.TRUE, udf.evaluate(bfstr, key));
+ Assert.assertEquals("Look up failed for key: " + key, Boolean.TRUE,
+ udf.evaluate(bfstr, key));
}
}
@@ -61,7 +62,7 @@ public class BloomContainsUDFTest {
double d = rnd1.nextGaussian();
String s = Double.toHexString(d);
Text t = new Text(s);
- key.set(t.getBytes(), 1.0);
+ key.set(t.copyBytes(), 1.0);
dbf.add(key);
}
[2/2] incubator-hivemall git commit: Fixed a possible Json
deserialize bug caused by illegal Text use
Posted by my...@apache.org.
Fixed a possible Json deserialize bug caused by illegal Text use
Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/880ee8a2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/880ee8a2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/880ee8a2
Branch: refs/heads/master
Commit: 880ee8a2a31b052323a19619ff437060536c4b7c
Parents: d13ac41
Author: Makoto Yui <my...@apache.org>
Authored: Tue Nov 6 19:42:28 2018 +0900
Committer: Makoto Yui <my...@apache.org>
Committed: Tue Nov 6 19:42:28 2018 +0900
----------------------------------------------------------------------
core/src/main/java/hivemall/utils/hadoop/JsonSerdeUtils.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/880ee8a2/core/src/main/java/hivemall/utils/hadoop/JsonSerdeUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/hivemall/utils/hadoop/JsonSerdeUtils.java b/core/src/main/java/hivemall/utils/hadoop/JsonSerdeUtils.java
index 1315537..562e9a4 100644
--- a/core/src/main/java/hivemall/utils/hadoop/JsonSerdeUtils.java
+++ b/core/src/main/java/hivemall/utils/hadoop/JsonSerdeUtils.java
@@ -380,7 +380,7 @@ public final class JsonSerdeUtils {
final Object result;
try {
JsonParser p =
- new JsonFactory().createJsonParser(new FastByteArrayInputStream(t.getBytes()));
+ new JsonFactory().createJsonParser(new FastByteArrayInputStream(t.getBytes(), t.getLength()));
final JsonToken token = p.nextToken();
if (token == JsonToken.START_OBJECT) {
result = parseObject(p, columnNames, columnTypes);