[jira] [Created] (CARBONDATA-3915) Correction in the documentation for spark-shell

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (CARBONDATA-3915) Correction in the documentation for spark-shell

Akash R Nilugal (Jira)
Prasanna Ravichandran created CARBONDATA-3915:
-------------------------------------------------

             Summary: Correction in the documentation for spark-shell
                 Key: CARBONDATA-3915
                 URL: https://issues.apache.org/jira/browse/CARBONDATA-3915
             Project: CarbonData
          Issue Type: Bug
          Components: hive-integration
    Affects Versions: 2.0.0
         Environment: 3 node ANT cluster one track.
            Reporter: Prasanna Ravichandran


Spark-Shell program is not working, which is given in the [https://github.com/apache/carbondata/blob/master/docs/hive-guide.md]

 

Working program is given as below:

import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.CarbonSession._
 val newSpark = SparkSession.builder().config(sc.getConf).enableHiveSupport.config("spark.sql.extensions","org.apache.spark.sql.CarbonExtensions").getOrCreate()
 newSpark.sql("drop table if exists hive_carbon").show
newSpark.sql("create table hive_carbon(id int, name string, scale decimal, country string, salary double) STORED AS carbondata").show
newSpark.sql("LOAD DATA INPATH 'hdfs://hacluster/user/prasanna/samplehive.csv' INTO TABLE hive_carbon").show
newSpark.sql("SELECT * FROM hive_carbon").show()

so could update the above working program in the [https://github.com/apache/carbondata/blob/master/docs/hive-guide.md] page, under the "Start Spark shell by running the following command in the Spark directory" section.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)