Extends dbplyr's base translation so that an R expression computes in Trino what it computes in R, or fails, rather than quietly computing something else:
Details
/divides as a double, where Trino would truncate the quotient of two integers;%%takes the sign of the divisor, as in R.as.integer()andas.integer64()truncate towards zero, where a cast would round.paste(),paste0()andstr_c()cast every argument toVARCHAR, which Trino'sCONCAT_WSrequires.grepl(),sub()andgsub()honourfixedandignore.case, and rewrite R's\\1back-references into Trino's$1;sub()replaces the first match only.days(),weeks(),months(),years(),hours(),minutes()andseconds()build intervals, sodate + days(1)works wheredate + 1does not.Casts name Trino types, and
median()andquantile()useapprox_percentile, which is the percentile Trino offers over an arbitrary number of rows. Null-safe comparison uses Trino's nativeIS DISTINCT FROMrather than dbplyr's portableCASE WHENspelling.