You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mikael Koskinen <mi...@gmail.com> on 2023/04/17 06:31:04 UTC

JQ: Function strftime/1 does not exist

Hi,

When using the following JQ expression:

now | strftime("%Y-%d-%m")

I get the following error:

  CaughtExceptionType: org.apache.camel.RuntimeCamelException
CaughtExceptionMessage:
net.thisptr.jackson.jq.exception.JsonQueryException: Function
strftime/1 does not exist  StackTrace:
org.apache.camel.RuntimeCamelException:
net.thisptr.jackson.jq.exception.JsonQueryException: Function
strftime/1 does not exist
        at org.apache.camel.language.jq.JqExpression.evaluate(JqExpression.java:198)
        at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:45)

I checked the following project (which I think Camel uses?)
https://github.com/eiiches/jackson-jq and based on the documentation,
I think it should support strftime:

https://github.com/eiiches/jackson-jq/blob/ad9dba1eb618640cf8c72634a5ee99c04ddc8e5b/README.md?plain=1#L530

Also tested in this format but same issue:

strftime("yyyy-MM-dd")

Here's a link to jqplayground which shows how the function should work:

https://jqplay.org/s/tl0HuDi71wF

Best regards,
Mikael

Re: JQ: Function strftime/1 does not exist

Posted by James Netherton <ja...@gmail.com>.
I created a ticket for it:

https://issues.apache.org/jira/browse/CAMEL-19276

--
James

On Tue, 18 Apr 2023 at 12:57, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> Maybe we should include that -extra out of the box in camel-jq
>
> On Tue, Apr 18, 2023 at 1:02 PM James Netherton <ja...@gmail.com>
> wrote:
>
> > Hi,
> >
> > Have you added jackson-jq-extra to the application classpath?
> >
> > --
> > James
> >
> > On Mon, 17 Apr 2023 at 16:32, Mikael Koskinen <mi...@gmail.com>
> wrote:
> >
> > > Hi,
> > >
> > > When using the following JQ expression:
> > >
> > > now | strftime("%Y-%d-%m")
> > >
> > > I get the following error:
> > >
> > >   CaughtExceptionType: org.apache.camel.RuntimeCamelException
> > > CaughtExceptionMessage:
> > > net.thisptr.jackson.jq.exception.JsonQueryException: Function
> > > strftime/1 does not exist  StackTrace:
> > > org.apache.camel.RuntimeCamelException:
> > > net.thisptr.jackson.jq.exception.JsonQueryException: Function
> > > strftime/1 does not exist
> > >         at
> > >
> org.apache.camel.language.jq.JqExpression.evaluate(JqExpression.java:198)
> > >         at
> > >
> >
> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:45)
> > >
> > > I checked the following project (which I think Camel uses?)
> > > https://github.com/eiiches/jackson-jq and based on the documentation,
> > > I think it should support strftime:
> > >
> > >
> > >
> >
> https://github.com/eiiches/jackson-jq/blob/ad9dba1eb618640cf8c72634a5ee99c04ddc8e5b/README.md?plain=1#L530
> > >
> > > Also tested in this format but same issue:
> > >
> > > strftime("yyyy-MM-dd")
> > >
> > > Here's a link to jqplayground which shows how the function should work:
> > >
> > > https://jqplay.org/s/tl0HuDi71wF
> > >
> > > Best regards,
> > > Mikael
> > >
> >
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Re: JQ: Function strftime/1 does not exist

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Maybe we should include that -extra out of the box in camel-jq

On Tue, Apr 18, 2023 at 1:02 PM James Netherton <ja...@gmail.com>
wrote:

> Hi,
>
> Have you added jackson-jq-extra to the application classpath?
>
> --
> James
>
> On Mon, 17 Apr 2023 at 16:32, Mikael Koskinen <mi...@gmail.com> wrote:
>
> > Hi,
> >
> > When using the following JQ expression:
> >
> > now | strftime("%Y-%d-%m")
> >
> > I get the following error:
> >
> >   CaughtExceptionType: org.apache.camel.RuntimeCamelException
> > CaughtExceptionMessage:
> > net.thisptr.jackson.jq.exception.JsonQueryException: Function
> > strftime/1 does not exist  StackTrace:
> > org.apache.camel.RuntimeCamelException:
> > net.thisptr.jackson.jq.exception.JsonQueryException: Function
> > strftime/1 does not exist
> >         at
> > org.apache.camel.language.jq.JqExpression.evaluate(JqExpression.java:198)
> >         at
> >
> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:45)
> >
> > I checked the following project (which I think Camel uses?)
> > https://github.com/eiiches/jackson-jq and based on the documentation,
> > I think it should support strftime:
> >
> >
> >
> https://github.com/eiiches/jackson-jq/blob/ad9dba1eb618640cf8c72634a5ee99c04ddc8e5b/README.md?plain=1#L530
> >
> > Also tested in this format but same issue:
> >
> > strftime("yyyy-MM-dd")
> >
> > Here's a link to jqplayground which shows how the function should work:
> >
> > https://jqplay.org/s/tl0HuDi71wF
> >
> > Best regards,
> > Mikael
> >
>


-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: JQ: Function strftime/1 does not exist

Posted by James Netherton <ja...@gmail.com>.
Hi,

Have you added jackson-jq-extra to the application classpath?

--
James

On Mon, 17 Apr 2023 at 16:32, Mikael Koskinen <mi...@gmail.com> wrote:

> Hi,
>
> When using the following JQ expression:
>
> now | strftime("%Y-%d-%m")
>
> I get the following error:
>
>   CaughtExceptionType: org.apache.camel.RuntimeCamelException
> CaughtExceptionMessage:
> net.thisptr.jackson.jq.exception.JsonQueryException: Function
> strftime/1 does not exist  StackTrace:
> org.apache.camel.RuntimeCamelException:
> net.thisptr.jackson.jq.exception.JsonQueryException: Function
> strftime/1 does not exist
>         at
> org.apache.camel.language.jq.JqExpression.evaluate(JqExpression.java:198)
>         at
> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:45)
>
> I checked the following project (which I think Camel uses?)
> https://github.com/eiiches/jackson-jq and based on the documentation,
> I think it should support strftime:
>
>
> https://github.com/eiiches/jackson-jq/blob/ad9dba1eb618640cf8c72634a5ee99c04ddc8e5b/README.md?plain=1#L530
>
> Also tested in this format but same issue:
>
> strftime("yyyy-MM-dd")
>
> Here's a link to jqplayground which shows how the function should work:
>
> https://jqplay.org/s/tl0HuDi71wF
>
> Best regards,
> Mikael
>