Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hadrian] JSON datum "Inf" does not match type "double" #46

Open
taunometsalu opened this issue Dec 19, 2017 · 0 comments
Open

[Hadrian] JSON datum "Inf" does not match type "double" #46

taunometsalu opened this issue Dec 19, 2017 · 0 comments

Comments

@taunometsalu
Copy link

If I use "Inf" value in a cell, it works with Titus:

library(aurelius)
pfaDocument = pfa_document(
  input = avro_double,
  output = avro_boolean,
  cells = list(x = pfa_cell(avro_double, Inf)),
  action = expression(
    input < x
  )
)

library(jsonlite)
engine = pfa_engine(pfaDocument)
x = 1
engine$action(x)

But Hadrian gives error:

f = "/usr/local/src/gdrive/results/pfa/inf_example.pfa"
write_pfa(pfaDocument, file = f, pretty = TRUE)

library(jsonlite)
tmp1 = tempfile(fileext = ".json")
tmp2 = tempfile(fileext = ".json")
write(minify(toJSON(x, auto_unbox = TRUE)), file = tmp1)
cmd = paste0("cd /usr/local/src/gdrive/; touch ", tmp2, "; ",
             "java -jar scripts/hadrian/hadrian-standalone-0.8.1-jar-with-dependencies.jar -i json -o json ",
             f, " ", tmp1, " > ", tmp2)
system(cmd)

I expected that Titus and Hadrian should behave identically. Is it a bug of Titus or Hadrian?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant