You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemall.apache.org by ta...@apache.org on 2017/07/04 02:13:40 UTC

incubator-hivemall git commit: Close #94: [HIVEMALL-80] Allow array type as the first parameter to ndcg

Repository: incubator-hivemall
Updated Branches:
  refs/heads/master ec6d945fe -> 5a1e79d9d


Close #94: [HIVEMALL-80] Allow array<struct> type as the first parameter to ndcg


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

Branch: refs/heads/master
Commit: 5a1e79d9dce0a05274014e2906b096b1c2aa62d2
Parents: ec6d945
Author: Uhyon Chung <uh...@gmail.com>
Authored: Tue Jul 4 11:13:07 2017 +0900
Committer: Takuya Kitazawa <k....@gmail.com>
Committed: Tue Jul 4 11:13:07 2017 +0900

----------------------------------------------------------------------
 core/src/main/java/hivemall/evaluation/NDCGUDAF.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/5a1e79d9/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 6151edb..8c0d590 100644
--- a/core/src/main/java/hivemall/evaluation/NDCGUDAF.java
+++ b/core/src/main/java/hivemall/evaluation/NDCGUDAF.java
@@ -64,7 +64,8 @@ public final class NDCGUDAF extends AbstractGenericUDAFResolver {
         }
 
         ListTypeInfo arg1type = HiveUtils.asListTypeInfo(typeInfo[0]);
-        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo())) {
+        if (!HiveUtils.isPrimitiveTypeInfo(arg1type.getListElementTypeInfo()) 
+            && !HiveUtils.isStructTypeInfo(arg1type.getListElementTypeInfo())) {
             throw new UDFArgumentTypeException(0,
                     "The first argument `array rankItems` is invalid form: " + typeInfo[0]);
         }