yutannihilation opened a new pull request, #1171:
URL: https://github.com/apache/sedona-db/pull/1171

   Fix #1169 
   
   Translate an R expression `a$b` as SQL `get_field(a, 'b')`. 
   
   ``` r
   library(sdplyr)
   #> ── Attaching sdplyr packages ───────────────────────────────────── 
0.4.0.9000 ──
   #> ✔ sedonadb  0.4.0.9000
   #> ✔ sedonafns 0.4.0.9000
   #> ✔ dplyr     1.2.0
   
   df <- sedonadb::sd_sql(
     "SELECT named_struct('bar', named_struct('baz', 1)) AS foo"
   )
   
   df |> 
     filter(foo$bar$baz > 0) |>
     transmute(value = foo$bar$baz) |>
     collect()
   #> # A tibble: 1 × 1
   #>   value
   #>   <dbl>
   #> 1     1
   ```
   
   <sup>Created on 2026-08-16 with [reprex 
v2.1.1](https://reprex.tidyverse.org)</sup>
   
   I was thinking the implementation would be simpler than this, but it seems 
`sd_eval_expr_inner()` needs to be executed recursively in order to support a 
mixed case like this.
   
   ```r
   df |> 
     transmute(value = .fns$get_field(foo, 'bar')$baz)
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to