from pyspark.sql import HiveContext
ourHiveContext = HiveContext(sc)
FilamentDataFrame = ourHiveContext.table('apress.filamenttable')
FilamentDataFrame.show(5)
+------------+---------+-----------+
|filamenttype|bulbpower|lifeinhours|
+------------+---------+-----------+
| filamentA| 100W| 605.0|
| filamentB| 100W| 683.0|
| filamentB| 100W| 691.0|
| filamentB| 200W| 561.0|
| filamentA| 200W| 530.0|
+------------+---------+-----------+
网友评论