【问题标题】:Is there a way to replace empty array structs with nulls in Spark SQL?有没有办法在 Spark SQL 中用空值替换空数组结构?
【发布时间】:2021-07-25 06:40:59
【问题描述】:

我尝试使用以下方法在 spark sql 中查找空数组结构:

spark.sql(""" 从表 1 中选择计数(*) 其中大小(arraycolumn1)= 0 """).show()

但没有运气。还有其他方法吗?

【问题讨论】:

    标签: sql apache-spark apache-spark-sql


    【解决方案1】:

    试试这个:

    spark.sql(""" select count(*) from table1 where arraycolumn1 is null """).show()
    

    【讨论】:

      猜你喜欢
      • 2017-10-21
      • 2022-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-29
      • 2020-12-20
      • 2021-03-05
      • 2020-08-03
      相关资源
      最近更新 更多