Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-3915

Correction in the documentation for spark-shell

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 2.1.0
    • hive-integration
    • None
    • 3 node ANT cluster one track.

    Description

      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.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Prasanna Ravichandran Prasanna Ravichandran
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h
                2h