Skip to content
Snippets Groups Projects
Commit e6e44e46 authored by wangfei's avatar wangfei Committed by Reynold Xin
Browse files

add note of how to support table with more than 22 fields

Author: wangfei <wangfei1@huawei.com>

Closes #564 from scwf/patch-6 and squashes the following commits:

a331876 [wangfei] Update sql-programming-guide.md
685135b [wangfei] Update sql-programming-guide.md
10b3dc0 [wangfei] Update sql-programming-guide.md
1c40480 [wangfei] add note of how to support table with 22 fields
parent 058797c1
No related branches found
No related tags found
No related merge requests found
...@@ -114,6 +114,8 @@ val sqlContext = new org.apache.spark.sql.SQLContext(sc) ...@@ -114,6 +114,8 @@ val sqlContext = new org.apache.spark.sql.SQLContext(sc)
import sqlContext._ import sqlContext._
// Define the schema using a case class. // Define the schema using a case class.
// Note: Case classes in Scala 2.10 can support only up to 22 fields. To work around this limit,
// you can use custom classes that implement the Product interface.
case class Person(name: String, age: Int) case class Person(name: String, age: Int)
// Create an RDD of Person objects and register it as a table. // Create an RDD of Person objects and register it as a table.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment