-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Description
Running the below query on a snowflake database returns the NULL values of grp, where I would expect it would return the max val for which grp is not NULL
tmp <-
tibble(
grp = c(NA, "grp1", "grp2", "grp2"),
val = c(4, 3, 2, 1)
) %>%
mutate(id = "abc") %>%
relocate(id)
tmp_con <- copy_to(con, tmp, I("DATABASE.SCHEMA.TMP"), overwrite = TRUE)
tmp_con %>%
group_by(id) %>%
slice_max(val[!is.na(grp)], with_ties = FALSE) %>%
ungroup()
Currently results from the above query
I would have expected this to return the 2nd row in tmp, which is the one with the largest val in which grp is not NA
Metadata
Metadata
Assignees
Labels
No labels
