ropensci / jqr

R interface to jq
https://docs.ropensci.org/jqr
Other
143 stars 13 forks source link

Unhandled exception #72

Closed SymbolixAU closed 3 years ago

SymbolixAU commented 6 years ago

The code I've written is almost certainly not valid, but, I'm pointing out this issue as it may be something to resolve at the C level to prevent a crash?

While playing about with this SO question I wrote the following which crashes my R / RStudio

library(jqr)
js1 <- '{"value": ["1","2","3"]}'
js2 <- '{"value": ["4","5","6"]}'
js <- paste(js1, js2)
jqr::jq(js, '[inputs]')
# Session info --------------------------------------------------------------------------------------------------------------------------
#   setting  value                       
# version  R version 3.4.4 (2018-03-15)
# system   x86_64, darwin15.6.0        
# ui       RStudio (1.1.414)           
# language (EN)                        
# collate  en_AU.UTF-8                 
# tz       Australia/Melbourne         
# date     2018-04-26                  
# 
# Packages ------------------------------------------------------------------------------------------------------------------------------
#   package   * version date       source                          
# base      * 3.4.4   2018-03-15 local                           
# compiler    3.4.4   2018-03-15 local                           
# datasets  * 3.4.4   2018-03-15 local                           
# devtools    1.13.4  2017-11-09 CRAN (R 3.4.2)                  
# digest      0.6.15  2018-01-28 cran (@0.6.15)                  
# graphics  * 3.4.4   2018-03-15 local                           
# grDevices * 3.4.4   2018-03-15 local                           
# jqr       * 1.0.0   2017-09-28 CRAN (R 3.4.2)                  
# lazyeval    0.2.1   2017-10-29 cran (@0.2.1)                   
# magrittr    1.5     2014-11-22 CRAN (R 3.4.0)                  
# memoise     1.1.0   2018-01-08 Github (hadley/memoise@611cfad) 
# methods   * 3.4.4   2018-03-15 local                           
# stats     * 3.4.4   2018-03-15 local                           
# tools       3.4.4   2018-03-15 local                           
# utils     * 3.4.4   2018-03-15 local                           
# withr       2.1.2   2018-04-25 Github (jimhester/withr@79d7b0d)
# yaml        2.1.18  2018-03-08 cran (@2.1.18) 
sckott commented 6 years ago

not sure why that fails. it does seem to be in the jq documentation.

jeroen commented 6 years ago

What is the expected output of this jq program?

SymbolixAU commented 6 years ago

I've no idea. I was just messing about with commands to see what they did.

sckott commented 5 years ago

seems inputs is usually used along with the -n flag https://github.com/stedolan/jq/wiki/FAQ - not sure what to do about this though