Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
Fix bugs in define-all-as-permanent.hive
Browse files Browse the repository at this point in the history
  • Loading branch information
maropu committed May 10, 2016
1 parent e5ca6bc commit 9080a9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/hivemall/xgboost/XGBoostUDTF.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils;

import hivemall.UDTFWithOptions;
import hivemall.utils.hadoop.HadoopUtils;
import hivemall.utils.hadoop.HiveUtils;

/**
Expand Down Expand Up @@ -265,8 +266,7 @@ public void process(Object[] args) throws HiveException {
* does not work in there.
*/
protected String generateUniqueModelId() {
// return String.valueOf(HadoopUtils.getTaskId());
return UUID.randomUUID().toString();
return String.valueOf(HadoopUtils.getTaskId());
}

private static Booster createXGBooster(
Expand Down
20 changes: 10 additions & 10 deletions resources/ddl/define-all-as-permanent.hive
Original file line number Diff line number Diff line change
Expand Up @@ -607,17 +607,17 @@ CREATE FUNCTION guess_attribute_types as 'hivemall.smile.tools.GuessAttributesUD
-- XGBoost related features --
------------------------------

DROP TEMPORARY FUNCTION train_xgboost_regr;
CREATE TEMPORARY FUNCTION train_xgboost_regr AS 'hivemall.xgboost.regression.XGBoostRegressionUDTF';
DROP FUNCTION train_xgboost_regr;
CREATE FUNCTION train_xgboost_regr AS 'hivemall.xgboost.regression.XGBoostRegressionUDTF' USING JAR '${hivemall_jar}';

DROP TEMPORARY FUNCTION train_xgboost_classifier;
CREATE TEMPORARY FUNCTION train_xgboost_classifier AS 'hivemall.xgboost.classification.XGBoostBinaryClassifierUDTF';
DROP FUNCTION train_xgboost_classifier;
CREATE FUNCTION train_xgboost_classifier AS 'hivemall.xgboost.classification.XGBoostBinaryClassifierUDTF' USING JAR '${hivemall_jar}';

DROP TEMPORARY FUNCTION train_multiclass_xgboost_classifier;
CREATE TEMPORARY FUNCTION train_multiclass_xgboost_classifier AS 'hivemall.xgboost.classification.XGBoostMulticlassClassifierUDTF';
DROP FUNCTION train_multiclass_xgboost_classifier;
CREATE FUNCTION train_multiclass_xgboost_classifier AS 'hivemall.xgboost.classification.XGBoostMulticlassClassifierUDTF' USING JAR '${hivemall_jar}';

DROP TEMPORARY FUNCTION xgboost_predict;
CREATE TEMPORARY FUNCTION xgboost_predict AS 'hivemall.xgboost.tools.XGBoostPredictUDTF';
DROP FUNCTION xgboost_predict;
CREATE FUNCTION xgboost_predict AS 'hivemall.xgboost.tools.XGBoostPredictUDTF' USING JAR '${hivemall_jar}';

DROP TEMPORARY FUNCTION xgboost_multiclass_predict;
CREATE TEMPORARY FUNCTION xgboost_multiclass_predict AS 'hivemall.xgboost.tools.XGBoostMulticlassPredictUDTF';
DROP FUNCTION xgboost_multiclass_predict;
CREATE FUNCTION xgboost_multiclass_predict AS 'hivemall.xgboost.tools.XGBoostMulticlassPredictUDTF' USING JAR '${hivemall_jar}';

0 comments on commit 9080a9f

Please sign in to comment.