Skip to content

bracket filter in summarize not work in MS SQL after update 2.0.0 #546

@coponhub

Description

@coponhub

bracket filter not work on dbplyr 2.0.0 on MS SQL like berow
tbl(con, "HOGE") %>% group_by(City_ID) %>% summarise(userVisit = n_distinct(visit_id[isUser == 1L]))

Error: nanodbc/nanodbc.cpp:1617: 00000: [FreeTDS][SQL Server]Statement(s) could not be prepared. [FreeTDS][SQL Server]An expression of non-boolean type specified in a context where a condition is expected, near 'THEN'.
'SELECT TOP 11 "City_ID", COUNT(DISTINCT CASE WHEN ("isUser") THEN ("visit_id") END) AS "usrVisit"
FROM "HOGE"
GROUP BY "City_ID"'

It worked on dbplyr 1.4.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorfunc trans 🌍Translation of individual functions to SQL

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions