eiiches / jackson-jq

jq for Jackson Java JSON Processor
Other
282 stars 37 forks source link

test with digit class of character throws an exception from jcodings #308

Closed Jiehong closed 1 year ago

Jiehong commented 1 year ago

Hello,

Given the following input json:

{
    "lines": [
      "hello",
      "contains a 4"
    ]
}

and the following query: .lines | map(select(. | test("\\d"))), jqplay or jq give the following result:

[
  "contains a 4"
]

However, jackson-jq throws the following exception:

org.jcodings.exception.InternalException: entry: /tables/CR_Digit.bin not found

Note that using [0-9] instead of \\d in the query works fine.

The jcodings library seems to be used by org.jruby.joni:joni:jar, itself a dependency of https://github.com/eiiches/jackson-jq/blob/develop/1.x/jackson-jq/pom.xml#L17

issue seems to only occur with graalvm, compiled as binary.

Jiehong commented 1 year ago

Closing this, as I've found the issue: you need to tell graalvm (or quarkus in my case) to actually keep the jcodings resources with:

quarkus.native.resources.includes=tables/*.bin