我正在尝试过滤出一个配置单元数据库df
project schedule timestamp
p1 1 t1
p1 2 t1
p1 3 t1
p2 1 t2
p2 2 t2
我希望以这样的方式替换此数据中的行,结果数据集如下所示:
project schedule timestamp
p1 2 t1
p1 3 t1
p2 1 t2
p2 2 t2
我尝试使用的查询是:
Insert overwrite table df Select * from df where project != p1 and schedule != 1.
这不起作用,因为我过滤掉了项目p1的所有行。我觉得我在这里漏掉了一些微不足道的东西。
发布于 2020-07-28 12:03:13
我认为你想要的逻辑是:
where project <> 'p1' or schedule <> 1
或者等效地:
where not (project = 'p1' and schedule = 1)
https://stackoverflow.com/questions/63133690
复制相似问题