You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hivemall.apache.org by maropu <gi...@git.apache.org> on 2017/02/08 10:30:14 UTC
[GitHub] incubator-hivemall pull request #41: [HIVEMALL-54][SPARK] Add a easy-to-use ...
GitHub user maropu opened a pull request:
https://github.com/apache/incubator-hivemall/pull/41
[HIVEMALL-54][SPARK] Add a easy-to-use script for spark-shell
## What changes were proposed in this pull request?
This pr added a script to automatically download the latest Spark version, compile Hivemall for the version, and invoke spark-shell with the compiled Hivemall binary.
## What type of PR is it?
Improvement
### What is the Jira issue?
https://issues.apache.org/jira/browse/HIVEMALL-54
## How was this patch tested?
Manually tested.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/maropu/incubator-hivemall AddScriptForSparkShell
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-hivemall/pull/41.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #41
----
commit 5433fd56db138880c9e0ed0f2d20cf7396d4e5e8
Author: Takeshi Yamamuro <ya...@apache.org>
Date: 2017-02-08T10:19:27Z
Add a script for spark-shell
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by myui <gi...@git.apache.org>.
Github user myui commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
@amaya382 Have you confirmed?
@maropu please merge this PR if he say fine.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by maropu <gi...@git.apache.org>.
Github user maropu commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
yea, I'll update just after this merged.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by maropu <gi...@git.apache.org>.
Github user maropu commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
Merged.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by amaya382 <gi...@git.apache.org>.
Github user amaya382 commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
@maropu okay, I'll do in a few days
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by myui <gi...@git.apache.org>.
Github user myui commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
@maropu Could you update `incubator-hivemall-site`? This feature should be documented.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall pull request #41: [HIVEMALL-54][SPARK] Add an easy-to-use...
Posted by maropu <gi...@git.apache.org>.
Github user maropu commented on a diff in the pull request:
https://github.com/apache/incubator-hivemall/pull/41#discussion_r100307575
--- Diff: docs/gitbook/spark/getting_started/installation.md ---
@@ -0,0 +1,49 @@
+<!--
+ 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.
+-->
+
+Prerequisites
+============
+
+* Spark v2.0 or later
+* Java 7 or later
+* hivemall-spark-xxx-with-dependencies.jar
+* [define-all.spark](https://github.com/apache/incubator-hivemall/blob/master/resources/ddl/define-all.spark)
+* [import-packages.spark](https://github.com/apache/incubator-hivemall/blob/master/resources/ddl/import-packages.spark)
+
+Installation
+============
+
+First, you download a compiled Spark package from [the Spark official web page](http://spark.apache.org/downloads.html) and
+invoke spark-shell with a compiled Hivemall binary.
+
+```
+$ ./bin/spark-shell --jars hivemall-spark-xxx-with-dependencies.jar
+```
+
+> #### Notice
+> If you would like to try Hivemall functions on the latest release of Spark, you just say `bin/spark-shell` in a Hivemall package.
+> This command automatically downloads the latest Spark version, compiles Hivemall for the version, and invokes spark-shell with the compiled Hivemall binary.
+
+Then, you load scripts for Hivemall functions.
+
+```
+scala> :load define-all.spark
--- End diff --
okay, I added the entry in `val sqlContext = spark.sqlContext` in `define-all.spark`(https://github.com/apache/incubator-hivemall/pull/41/commits/17f2dcf375a1c4c0ad979c80c6591143aefe8a1b).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall pull request #41: [HIVEMALL-54][SPARK] Add an easy-to-use...
Posted by Lewuathe <gi...@git.apache.org>.
Github user Lewuathe commented on a diff in the pull request:
https://github.com/apache/incubator-hivemall/pull/41#discussion_r100302933
--- Diff: docs/gitbook/spark/getting_started/installation.md ---
@@ -0,0 +1,49 @@
+<!--
+ 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.
+-->
+
+Prerequisites
+============
+
+* Spark v2.0 or later
+* Java 7 or later
+* hivemall-spark-xxx-with-dependencies.jar
+* [define-all.spark](https://github.com/apache/incubator-hivemall/blob/master/resources/ddl/define-all.spark)
+* [import-packages.spark](https://github.com/apache/incubator-hivemall/blob/master/resources/ddl/import-packages.spark)
+
+Installation
+============
+
+First, you download a compiled Spark package from [the Spark official web page](http://spark.apache.org/downloads.html) and
+invoke spark-shell with a compiled Hivemall binary.
+
+```
+$ ./bin/spark-shell --jars hivemall-spark-xxx-with-dependencies.jar
+```
+
+> #### Notice
+> If you would like to try Hivemall functions on the latest release of Spark, you just say `bin/spark-shell` in a Hivemall package.
+> This command automatically downloads the latest Spark version, compiles Hivemall for the version, and invokes spark-shell with the compiled Hivemall binary.
+
+Then, you load scripts for Hivemall functions.
+
+```
+scala> :load define-all.spark
--- End diff --
I found current `define-all.spark` assumes `sqlContext` is imported in advance. But the latest spark-shell imports `sqlContext` under Spark session. So it is necessary to rewrite `define-all.spark` or documentation.
```
scala> :load resources/ddl/define-all.spark
Loading resources/ddl/define-all.spark...
<console>:28: error: not found: value sqlContext
sqlContext.sql("DROP TEMPORARY FUNCTION IF EXISTS hivemall_version")
^
```
I think adding below in doc is sufficient.
```
scala> val sqlContext = spark.sqlContext
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by maropu <gi...@git.apache.org>.
Github user maropu commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
@amaya382 Can you make prs to fix them?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
[](https://coveralls.io/builds/10099761)
Coverage remained the same at 35.814% when pulling **ff03adf1de142fb9cdbe373bed718dda2e8e840e on maropu:AddScriptForSparkShell** into **247e1aef87ddc789dacfb74e469263e7e2ab603e on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by amaya382 <gi...@git.apache.org>.
Github user amaya382 commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
Looks mostly good, but I found minor issues not directly related to this PR.
Some declarations in `define-all.spark` are incorrect and duplicated.
e.g. `train_arowh`: https://github.com/maropu/incubator-hivemall/blob/AddScriptForSparkShell/resources/ddl/define-all.spark#L32-L36
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by amaya382 <gi...@git.apache.org>.
Github user amaya382 commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
@myui \U0001f44c
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by myui <gi...@git.apache.org>.
Github user myui commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
@maropu BTW, better to update `incubator-hivemall-site` once this PR is merged.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
[](https://coveralls.io/builds/10059505)
Coverage increased (+0.3%) to 36.142% when pulling **5433fd56db138880c9e0ed0f2d20cf7396d4e5e8 on maropu:AddScriptForSparkShell** into **85f8e173a2a97005c00b84140f4b9150060c4a56 on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by maropu <gi...@git.apache.org>.
Github user maropu commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
@amaya382 I made a JIRA ticket: https://issues.apache.org/jira/browse/HIVEMALL-65
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
[](https://coveralls.io/builds/10076952)
Coverage remained the same at 35.844% when pulling **17f2dcf375a1c4c0ad979c80c6591143aefe8a1b on maropu:AddScriptForSparkShell** into **85f8e173a2a97005c00b84140f4b9150060c4a56 on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall issue #41: [HIVEMALL-54][SPARK] Add an easy-to-use script...
Posted by myui <gi...@git.apache.org>.
Github user myui commented on the issue:
https://github.com/apache/incubator-hivemall/pull/41
@amaya382 @Lewuathe Could you confirm that the updated `bin/spark-shell` properly works if your spare time?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hivemall pull request #41: [HIVEMALL-54][SPARK] Add an easy-to-use...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-hivemall/pull/41
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---