Expected `rel_to_altrep(rel)` to equal `df1`.
Differences:
  `attr(actual, 'row.names')`: NA -1
`attr(expected, 'row.names')`:  1

Expected `rel_to_altrep(rel)` to equal `expected_result`.
Differences:
  `attr(actual, 'row.names')`: NA -3  
`attr(expected, 'row.names')`:  1  2 3

Expected `rel_to_altrep(rel)` to equal `expected_result`.
Differences:
  `attr(actual, 'row.names')`: NA -4    
`attr(expected, 'row.names')`:  1  2 3 4

Expected `res` to equal `expected_result`.
Differences:
  `attr(actual, 'row.names')`: NA -3  
`attr(expected, 'row.names')`:  1  2 3

expr_window() supports nulls_first in order_bys

Expected `rel_to_altrep(rel3)` to be identical to `expected`.
Differences:
  `attr(actual, 'row.names')`: NA -3  
`attr(expected, 'row.names')`:  1  2 3

  `attr(actual$e, 'row.names')`: NA -3  
`attr(expected$e, 'row.names')`:  1  2 3

  `attr(actual$e$d, 'row.names')`: NA -3  
`attr(expected$e$d, 'row.names')`:  1  2 3

res <- dbGetQuery(con, "SELECT {'x': 100, 'y': 'hello', 'z': 3.14} AS s")
s = vctrs::data_frame(x = 100L, y = "hello", z = 3.14)
res <- dbGetQuery(con, "SELECT 1 AS n, {'x': 100, 'y': 'hello', 'z': 3.14} AS s")
col1 = vctrs::data_frame(x = c(100L, 200L, NA))
y = vctrs::data_frame(a = c(1L, NA, NA), b = c(2L, NA, NA))
res <- dbGetQuery(con, "select 100 AS other, [{'x': 1, 'y': 'a'}, {'x': 2, 'y': 'b'}] AS s")
vctrs::data_frame(x = c(1L, 2L), y = c("a", "b"))
vctrs::data_frame(x = c(1L, 2L), y = c("a", "b")),
vctrs::data_frame(x = integer(0), y = character(0)),
test_that("structs give the same results via Arrow", {
res <- dbGetQuery(con, "SELECT {'x': 100, 'y': 'hello', 'z': 3.14::double} AS s", arrow = TRUE)
s = tibble::tibble(x = 100L, y = "hello", z = 3.14)
res <- dbGetQuery(con, "SELECT 1 AS n, {'x': 100, 'y': 'hello', 'z': 3.14::double} AS s", arrow = TRUE)
col1 = tibble::tibble(x = c(100L, 200L, NA))
y = tibble::tibble(a = c(1L, NA, NA), b = c(2L, NA, NA))
res <- dbGetQuery(con, "select 100 AS other, [{'x': 1, 'y': 'a'}, {'x': 2, 'y': 'b'}] AS s", arrow = TRUE)
tibble::tibble(x = c(1L, 2L), y = c("a", "b"))
ptype = tibble::tibble(x = integer(), y = character()),
tibble::tibble(x = c(1L, 2L), y = c("a", "b")),
tibble::tibble(x = integer(0), y = character(0)),
test_that("nested lists of atomic values can be written", {
df2 <- vctrs::data_frame(a = 1:2, b = list(4:6, letters[2:3]))
test_that("nested and packed columns work in full", {
u = structure(as.numeric(19577:19578), class = "Date"),
v = structure(19577:19578, class = "Date"),
w = structure(1691507820, class = c("POSIXct", "POSIXt"), tzone = "UTC") + 0:1
# TIME_MINUTES, TIME_MINUTES_INTEGER, TIME_HOURS, ... etc.: Loss ok
d = structure(as.numeric(13:16), class = "difftime", units = "secs"),
u = structure(17:20, class = "difftime", units = "secs"),
h = vctrs::data_frame(u = 1:4, v = 5:8, w = list(vctrs::data_frame(s = 9:10)))
test_that("packed columns work with ALTREP", {
tmp_expr <- expr_function("struct_pack", list(expr_reference("a"), expr_reference("b")))
tmp_expr <- expr_function("struct_pack", list(expr_reference("d"), expr_reference("c")))
test_that("nested columns work with ALTREP", {
skip_if(getRversion() < "4.3.0", "ALTREP for lists not supported")
list(d = data.frame(a = 3L, b = 4L), c = 5L),