hivemall-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lewuathe <...@git.apache.org>
Subject [GitHub] incubator-hivemall pull request #41: [HIVEMALL-54][SPARK] Add an easy-to-use...
Date Thu, 09 Feb 2017 13:20:39 GMT
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.
---

Mime
View raw message