Repository: incubator-hivemall
Updated Branches:
  refs/heads/master a89b9b8c1 -> 19d472b54


Close #50: [HIVEMALL-80] Fix incorrect typeInfo checks in evaluation UDAFs


Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/19d472b5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/19d472b5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/19d472b5

Branch: refs/heads/master
Commit: 19d472b54d611273f6a88d0a8e17eb277fc0e729
Parents: a89b9b8
Author: Takuya Kitazawa <k.tak...@gmail.com>
Authored: Fri Feb 24 16:00:01 2017 +0900
Committer: myui <yuin...@gmail.com>
Committed: Fri Feb 24 16:00:01 2017 +0900

----------------------------------------------------------------------
 core/src/main/java/hivemall/evaluation/AUCUDAF.java       | 5 ++---
 core/src/main/java/hivemall/evaluation/MAPUDAF.java       | 7 +++----
 core/src/main/java/hivemall/evaluation/MRRUDAF.java       | 7 +++----
 core/src/main/java/hivemall/evaluation/NDCGUDAF.java      | 7 +++----
 core/src/main/java/hivemall/evaluation/PrecisionUDAF.java | 7 +++----
 core/src/main/java/hivemall/evaluation/RecallUDAF.java    | 7 +++----
 6 files changed, 17 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/19d472b5/core/src/main/java/hivemall/evaluation/AUCUDAF.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/hivemall/evaluation/AUCUDAF.java 
b/core/src/main/java/hivemall/evaluation/AUCUDAF.java
index 26f1fbc..bc39b4c 100644
--- a/core/src/main/java/hivemall/evaluation/AUCUDAF.java
+++ b/core/src/main/java/hivemall/evaluation/AUCUDAF.java
@@ -64,15 +64,14 @@ public final class AUCUDAF extends 
AbstractGenericUDAFResolver {
         }
 
         ListTypeInfo arg1type = HiveUtils.asListTypeInfo(typeInfo[0]);
-        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())
-                && 
!HiveUtils.isStructTypeInfo(arg1type.getListElementTypeInfo())) {
+        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(0,
                 "The first argument `array rankItems` is invalid form: " + 
typeInfo[0]);
         }
         ListTypeInfo arg2type = HiveUtils.asListTypeInfo(typeInfo[1]);
         if (!HiveUtils.isPrimitiveTypeInfo(arg2type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(1,
-                "The first argument `array rankItems` is invalid form: " + 
typeInfo[1]);
+                "The second argument `array correctItems` is invalid form: " + 
typeInfo[1]);
         }
 
         return new Evaluator();

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/19d472b5/core/src/main/java/hivemall/evaluation/MAPUDAF.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/hivemall/evaluation/MAPUDAF.java 
b/core/src/main/java/hivemall/evaluation/MAPUDAF.java
index 1b2f055..a7fe5a9 100644
--- a/core/src/main/java/hivemall/evaluation/MAPUDAF.java
+++ b/core/src/main/java/hivemall/evaluation/MAPUDAF.java
@@ -63,15 +63,14 @@ public final class MAPUDAF extends 
AbstractGenericUDAFResolver {
         }
 
         ListTypeInfo arg1type = HiveUtils.asListTypeInfo(typeInfo[0]);
-        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())
-                && 
!HiveUtils.isStructTypeInfo(arg1type.getListElementTypeInfo())) {
+        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(0,
-                "The first argument `array rankItems` is invalid form: " + 
typeInfo[0]);
+                    "The first argument `array rankItems` is invalid form: " + 
typeInfo[0]);
         }
         ListTypeInfo arg2type = HiveUtils.asListTypeInfo(typeInfo[1]);
         if (!HiveUtils.isPrimitiveTypeInfo(arg2type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(1,
-                "The first argument `array rankItems` is invalid form: " + 
typeInfo[1]);
+                    "The second argument `array correctItems` is invalid form: 
" + typeInfo[1]);
         }
 
         return new Evaluator();

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/19d472b5/core/src/main/java/hivemall/evaluation/MRRUDAF.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/hivemall/evaluation/MRRUDAF.java 
b/core/src/main/java/hivemall/evaluation/MRRUDAF.java
index 8778c18..68b1df5 100644
--- a/core/src/main/java/hivemall/evaluation/MRRUDAF.java
+++ b/core/src/main/java/hivemall/evaluation/MRRUDAF.java
@@ -63,15 +63,14 @@ public final class MRRUDAF extends 
AbstractGenericUDAFResolver {
         }
 
         ListTypeInfo arg1type = HiveUtils.asListTypeInfo(typeInfo[0]);
-        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())
-                && 
!HiveUtils.isStructTypeInfo(arg1type.getListElementTypeInfo())) {
+        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(0,
-                "The first argument `array rankItems` is invalid form: " + 
typeInfo[0]);
+                    "The first argument `array rankItems` is invalid form: " + 
typeInfo[0]);
         }
         ListTypeInfo arg2type = HiveUtils.asListTypeInfo(typeInfo[1]);
         if (!HiveUtils.isPrimitiveTypeInfo(arg2type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(1,
-                "The first argument `array rankItems` is invalid form: " + 
typeInfo[1]);
+                    "The second argument `array correctItems` is invalid form: 
" + typeInfo[1]);
         }
 
         return new Evaluator();

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/19d472b5/core/src/main/java/hivemall/evaluation/NDCGUDAF.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/hivemall/evaluation/NDCGUDAF.java 
b/core/src/main/java/hivemall/evaluation/NDCGUDAF.java
index e94e26c..6151edb 100644
--- a/core/src/main/java/hivemall/evaluation/NDCGUDAF.java
+++ b/core/src/main/java/hivemall/evaluation/NDCGUDAF.java
@@ -64,15 +64,14 @@ public final class NDCGUDAF extends 
AbstractGenericUDAFResolver {
         }
 
         ListTypeInfo arg1type = HiveUtils.asListTypeInfo(typeInfo[0]);
-        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())
-                && 
!HiveUtils.isStructTypeInfo(arg1type.getListElementTypeInfo())) {
+        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(0,
-                "The first argument `array rankItems` is invalid form: " + 
typeInfo[0]);
+                    "The first argument `array rankItems` is invalid form: " + 
typeInfo[0]);
         }
         ListTypeInfo arg2type = HiveUtils.asListTypeInfo(typeInfo[1]);
         if (!HiveUtils.isPrimitiveTypeInfo(arg2type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(1,
-                "The first argument `array rankItems` is invalid form: " + 
typeInfo[1]);
+                    "The second argument `array correctItems` is invalid form: 
" + typeInfo[1]);
         }
 
         return new Evaluator();

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/19d472b5/core/src/main/java/hivemall/evaluation/PrecisionUDAF.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/hivemall/evaluation/PrecisionUDAF.java 
b/core/src/main/java/hivemall/evaluation/PrecisionUDAF.java
index 335a155..69d901a 100644
--- a/core/src/main/java/hivemall/evaluation/PrecisionUDAF.java
+++ b/core/src/main/java/hivemall/evaluation/PrecisionUDAF.java
@@ -63,15 +63,14 @@ public final class PrecisionUDAF extends 
AbstractGenericUDAFResolver {
         }
 
         ListTypeInfo arg1type = HiveUtils.asListTypeInfo(typeInfo[0]);
-        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())
-                && 
!HiveUtils.isStructTypeInfo(arg1type.getListElementTypeInfo())) {
+        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(0,
-                "The first argument `array rankItems` is invalid form: " + 
typeInfo[0]);
+                    "The first argument `array rankItems` is invalid form: " + 
typeInfo[0]);
         }
         ListTypeInfo arg2type = HiveUtils.asListTypeInfo(typeInfo[1]);
         if (!HiveUtils.isPrimitiveTypeInfo(arg2type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(1,
-                "The first argument `array rankItems` is invalid form: " + 
typeInfo[1]);
+                    "The second argument `array correctItems` is invalid form: 
" + typeInfo[1]);
         }
 
         return new Evaluator();

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/19d472b5/core/src/main/java/hivemall/evaluation/RecallUDAF.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/hivemall/evaluation/RecallUDAF.java 
b/core/src/main/java/hivemall/evaluation/RecallUDAF.java
index e268fd7..c908a49 100644
--- a/core/src/main/java/hivemall/evaluation/RecallUDAF.java
+++ b/core/src/main/java/hivemall/evaluation/RecallUDAF.java
@@ -63,15 +63,14 @@ public final class RecallUDAF extends 
AbstractGenericUDAFResolver {
         }
 
         ListTypeInfo arg1type = HiveUtils.asListTypeInfo(typeInfo[0]);
-        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())
-                && 
!HiveUtils.isStructTypeInfo(arg1type.getListElementTypeInfo())) {
+        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(0,
-                "The first argument `array rankItems` is invalid form: " + 
typeInfo[0]);
+                    "The first argument `array rankItems` is invalid form: " + 
typeInfo[0]);
         }
         ListTypeInfo arg2type = HiveUtils.asListTypeInfo(typeInfo[1]);
         if (!HiveUtils.isPrimitiveTypeInfo(arg2type.getListElementTypeInfo())) 
{
             throw new UDFArgumentTypeException(1,
-                "The first argument `array rankItems` is invalid form: " + 
typeInfo[1]);
+                    "The second argument `array correctItems` is invalid form: 
" + typeInfo[1]);
         }
 
         return new Evaluator();

Reply via email to