aboutsummaryrefslogtreecommitdiff
path: root/examples/src/main/python/sql/hive.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/src/main/python/sql/hive.py')
-rw-r--r--examples/src/main/python/sql/hive.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/src/main/python/sql/hive.py b/examples/src/main/python/sql/hive.py
index 9b2a2c4e6a..98b48908b5 100644
--- a/examples/src/main/python/sql/hive.py
+++ b/examples/src/main/python/sql/hive.py
@@ -79,7 +79,7 @@ if __name__ == "__main__":
# You can also use DataFrames to create temporary views within a SparkSession.
Record = Row("key", "value")
- recordsDF = spark.createDataFrame(map(lambda i: Record(i, "val_" + str(i)), range(1, 101)))
+ recordsDF = spark.createDataFrame([Record(i, "val_" + str(i)) for i in range(1, 101)])
recordsDF.createOrReplaceTempView("records")
# Queries can then join DataFrame data with data stored in Hive.