बनाते समय नहीं मिला मैं केस क्लास ऑब्जेक्ट्स का आरडीडी बनाने की कोशिश कर रहा हूं। ।स्पार्क त्रुटि आरडीडी प्रकार आरडीडी
<console>:28: error: not found: type RDD
val people: RDD[Person] =sc.textFile("/user/root/people.txt").map(_.split(",")).map(p => Person(p(0), p(1).trim.toInt))
क्या गलत हुआ पर कोई विचार: उदाहरण के लिए,
// sqlContext from the previous example is used in this example.
// createSchemaRDD is used to implicitly convert an RDD to a SchemaRDD.
import sqlContext.createSchemaRDD
val people: RDD[Person] = ... // An RDD of case class objects, from the previous example.
// The RDD is implicitly converted to a SchemaRDD by createSchemaRDD, allowing it to be stored using Parquet.
people.saveAsParquetFile("people.parquet")
मैं
case class Person(name: String, age: Int)
// Create an RDD of Person objects and register it as a table.
val people: RDD[Person] = sc.textFile("/user/root/people.txt").map(_.split(",")).map(p => Person(p(0), p(1).trim.toInt))
people.registerAsTable("people")
मैं निम्नलिखित त्रुटि मिलती देकर पिछले उदाहरण से भाग पूरा करने के लिए कोशिश कर रहा हूँ? अग्रिम धन्यवाद!
धन्यवाद एक टन, जोश। – user1189851