Skip to content

Commit 43fd10a

Browse files
committed
lines broken to maintain 80 char limit
1 parent b4fdf4e commit 43fd10a

File tree

1 file changed

+4
-2
lines changed
  • examples/src/main/python

1 file changed

+4
-2
lines changed

examples/src/main/python/sql.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@
2626
sqlContext = SQLContext(sc)
2727

2828
# RDD is created from a list of rows
29-
some_rdd = sc.parallelize([Row(name="John", age=19), Row(name="Smith", age=23), Row(name="Sarah", age=18)])
29+
some_rdd = sc.parallelize([Row(name="John", age=19), Row(name="Smith",
30+
age=23), Row(name="Sarah", age=18)])
3031
# Infer schema from the first row, create a SchemaRDD and print the schema
3132
some_schemardd = sqlContext.inferSchema(some_rdd)
3233
some_schemardd.printSchema()
3334

3435
# Another RDD is created from a list of tuples
3536
another_rdd = sc.parallelize([("John", 19), ("Smith", 23), ("Sarah", 18)])
3637
# Schema with two fields - person_name and person_age
37-
schema = StructType([StructField("person_name", StringType(), False), StructField("person_age", IntegerType(), False)])
38+
schema = StructType([StructField("person_name", StringType(), False),
39+
StructField("person_age", IntegerType(), False)])
3840
# Create a SchemaRDD by applying the schema to the RDD and print the schema
3941
another_schemardd = sqlContext.applySchema(another_rdd, schema)
4042
another_schemardd.printSchema()

0 commit comments

Comments
 (0)