io.prestosql.spi.PrestoException: Invalid JSON path: '$.root[::].a'
at io.prestosql.operator.scalar.JsonPathTokenizer.invalidJsonPath(JsonPathTokenizer.java:196)
at io.prestosql.operator.scalar.JsonPathTokenizer.matchUnquotedSubscript(JsonPathTokenizer.java:109)
at io.prestosql.operator.scalar.JsonPathTokenizer.computeNext(JsonPathTokenizer.java:63)
at io.prestosql.operator.scalar.JsonPathTokenizer.computeNext(JsonPathTokenizer.java:26)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
When we execute :
or
or
we expect result : (As per documentation)
But we get :
Possible reason:
https://github.com/prestosql/presto/blob/f92c6c39404e602c38bbd5e88b818fffea77111f/presto-main/src/main/java/io/prestosql/operator/scalar/JsonPathTokenizer.java#L107-L110
Correct Json path specification :
https://goessner.net/articles/JsonPath/ And emulation at https://jsonpath.com/