Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-3284

saveAsParquetFile not working on windows

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 1.0.2
    • None
    • Windows
    • None
    • Windows

    Description

      object parquet {
      
        case class Person(name: String, age: Int)
      
        def main(args: Array[String]) {
      
          val sparkConf = new SparkConf().setMaster("local").setAppName("HdfsWordCount")
          val sc = new SparkContext(sparkConf)
          val sqlContext = new org.apache.spark.sql.SQLContext(sc)
          // createSchemaRDD is used to implicitly convert an RDD to a SchemaRDD.
          import sqlContext.createSchemaRDD
      
          val people = sc.textFile("C:/Users/pravesh.jain/Desktop/people/people.txt").map(_.split(",")).map(p => Person(p(0), p(1).trim.toInt))
          people.saveAsParquetFile("C:/Users/pravesh.jain/Desktop/people/people.parquet")
      
          val parquetFile = sqlContext.parquetFile("C:/Users/pravesh.jain/Desktop/people/people.parquet")
        }
      }
      

      gives the error

      Exception in thread "main" java.lang.NullPointerException at org.apache.spark.parquet$.main(parquet.scala:16)

      which is the line saveAsParquetFile.

      This works fine in linux but using in eclipse in windows gives the error.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              praveshjain1991 Pravesh Jain
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: