Skip to content

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

@taunometsalu

Description

@taunometsalu

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions