This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-02
Channels
- # announcements (6)
- # babashka (21)
- # beginners (38)
- # biff (2)
- # calva (14)
- # cider (5)
- # clerk (4)
- # cljdoc (2)
- # clojure (11)
- # clojure-europe (2)
- # clojure-norway (5)
- # clojure-spec (4)
- # core-typed (8)
- # data-science (5)
- # deps-new (15)
- # events (1)
- # fulcro (2)
- # graalvm (33)
- # holy-lambda (3)
- # hyperfiddle (19)
- # kaocha (1)
- # portal (5)
- # test-check (1)
- # xtdb (9)
- # yamlscript (2)
Hello XTDB team! I'm exploring XTDB 2.0 and am encountering some challenges with Datalog.
Can I pass a Datetime value to the :for-valid-time [:at ]
clause in Datalog?
Below is an example:
(xt/q node ['{:find [title xt/id]
:where [($ :todos [{:title title
:xt/id xt/id}]
{:for-valid-time [:at #inst "2023-09-03"]})]}])
I'd like to use either an Instant or ZonedDateTime value instead:
(xt/q node ['{:find [title]
:in [dt]
:where [($ :todos [{:title title}]
{:for-valid-time [:at dt]})]}
(java.time.Instant/now)])
However, this approach seems to be incorrect. The exception I encounter is:
java.lang.NullPointerException: Cannot invoke "xtdb.vector.IIndirectVector.getVecter()" becuase "col" is null
Hey @U01CNN12HNY I'm not sure on exactly what should be working here currently - but do you get the same result with a more precise #inst literal? e.g. #inst "2023-09-02T16:00:00"
? This could equally be an issue with parameterising the :at
value (in which case you could work around it with quoting / constructing the query as data)
hi thanks for answering. I've tried parameterizing the Datetime, so I can't use parameterization with :in. Are you suggesting that I construct the query as data? Is that correct?
> Are you suggesting that I construct the query as data? Is that correct? yes, that should unblock you for now, at least
but I'll check with the team about the expected behaviour next week - and potentially open an issue
hey again @U01CNN12HNY we just opened an issue to track the resolution on this https://github.com/xtdb/xtdb/issues/2754 - thanks again for flagging it π