V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
linuxchild
V2EX  ›  Hadoop

请教一个 spark 初级问题, IsNotNull 怎么用?

  •  
  •   linuxchild · Oct 13, 2017 · 3040 views
    This topic created in 3127 days ago, the information mentioned may be changed or developed.

    创建好了 dataframe,想过滤一个某属性值为空的数据;

    例如:

    name age

    wang 12

    zhao null

    这个假如使用 IsNotNull 怎么使用?

    文档在这里,我尝试了一下没找到正确的用法,有用过的朋友没,欢迎指点一下;

    感谢大家

    PS:为什么没 spark 这个节点……

    1 replies    2017-10-13 20:10:08 +08:00
    linuxchild
        1
    linuxchild  
    OP
       Oct 13, 2017
    找到了一个用法,参考[这里]( http://blog.csdn.net/silentwolfyh/article/details/51879162)

    要在 where 语句中用,如下

    spark.sql("select * from abc where IsNotNull(colunm_name) limit x")
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5737 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 08:36 · PVG 16:36 · LAX 01:36 · JFK 04:36
    ♥ Do have faith in what you're doing.