美文网首页pyspark学习
PySpark NoteBook-12. Read Data f

PySpark NoteBook-12. Read Data f

作者: 7125messi | 来源:发表于2018-01-14 15:28 被阅读25次
    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|
    +------------+---------+-----------+
    

    相关文章

      网友评论

        本文标题:PySpark NoteBook-12. Read Data f

        本文链接:https://www.haomeiwen.com/subject/dtikoxtx.html