[
https://issues.apache.org/jira/browse/HIVEMALL-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16859732#comment-16859732
]
ASF GitHub Bot commented on HIVEMALL-253:
-----------------------------------------
myui commented on pull request #192: [HIVEMALL-253]UDF map_roulette() created
URL: https://github.com/apache/incubator-hivemall/pull/192#discussion_r291890409
##########
File path: core/src/main/java/hivemall/tools/map/MapRouletteUDF.java
##########
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package hivemall.tools.map;
+
+import hivemall.utils.hadoop.HiveUtils;
+import org.apache.hadoop.hive.ql.exec.*;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.udf.UDFType;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
+import org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
+import
org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils;
+import java.util.*;
+import static hivemall.HivemallConstants.*;
+
+/**
+ * The map_roulette() can be use to do roulette, according to each map.entry
's weight.
+ *
+ * @author Wang, Yizheng
Review comment:
"@ author" tag is not used in ASF coding conversion. Commit history shows
you as a contributor as seen in
https://github.com/apache/incubator-hivemall/graphs/contributors
see
https://www.theinquirer.net/inquirer/news/1037207/apache-enforces-the-removal-of-author-tags
https://github.com/apache/dubbo/issues/2317
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
> UDF map_roulette() created
> --------------------------
>
> Key: HIVEMALL-253
> URL: https://issues.apache.org/jira/browse/HIVEMALL-253
> Project: Hivemall
> Issue Type: New Feature
> Affects Versions: 0.6.0
> Reporter: Aaron Wong
> Assignee: Makoto Yui
> Priority: Major
>
> In data processing process, we usually encounter the problem that we have
> some selection and their probably(or weight), we should select one of them
> according to their probably(or weight).
> UDF map_roulette() is a implement of roulette. It can select a Key from a map
> according to key's weight value.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)