Fork me on GitHub
#xtdb
<
2022-03-25
>
tatut06:03:17

I did find one regression in 1.21.0 (I think), related to query that has to workaround https://github.com/xtdb/xtdb/issues/1533 I had a where clause with clauses [[(get-attr ?c :type) [?type]] [(= ?type :some-value)]] that cause Clause refers to unknown variable: ?type {:op =, :sym ?type, :val :some-value}

πŸ™ 1
tatut06:03:16

that worked in earlier version, I changed the latter clause to [(identity :some-value) ?type] and it works now

tatut07:03:31

related note, is there anything users could do to help progress that bug ? fixing it might be too difficult for someone not versed in the internals

tatut07:03:56

but it is quite cumbersome to workaround, needing to split complicated queries to multiple queries... especially when dynamically generating where clauses

tatut12:03:36

^ by the above I mean the gh issue 1533

refset22:03:38

(noted - will circle back to this in the next day or so)

jarohen10:03:12

hey @U11SJ6Q0K πŸ‘‹ thanks for the report. I'm afraid I can't repro this though - I'm doing the following: tx: [[::xt/put {:xt/id :foo, :type :some-value}]] q:

(t/is (= #{[:foo]}
         (xt/q (xt/db *api*)
               '{:find [?e]
                 :where [[?e :xt/id]
                         [(get-attr ?e :type) [?type]]
                         [(= ?type :some-value)]]})))

jarohen10:03:24

is that what you're seeing?

tatut10:03:40

I'll try

πŸ™ 1
tatut10:03:33

that particular example works... I'll double check what is the difference in my actual query

tatut10:03:35

might be related to or perhaps, here is a failing example

(xt/submit-tx node [[::xt/put {:xt/id :foo, :type :some-value :term "search by this"}]])

(xt/q (xt/db node)
      '{:find [?e]
        :where [[(get-attr ?e :type) [?type]]
                [(= ?type :some-value)]

                (or [(text-search :term term) [[?e]]]
                    [(text-search :term other) [[?e]]])]
        :in [term other]}
      "search" "this")

tatut10:03:12

seems to happen with regular triple clauses in or as well, not related to text-search

tatut10:03:42

simpler example that fails as well

(xt/q (xt/db node)
      '{:find [?e]
        :where [[(get-attr ?e :type) [?type]]
                [(= ?type :some-value)]

                (or [?e :type :some-value]
                    [?e :type :other])]})

jarohen10:03:50

great, cheers πŸ™‚

jarohen10:03:48

yeah, this does seem related to some refactoring that happened as part of 1.21.0. will take a look

oxalorg (Mitesh)14:03:51

Slightly off-topic, but some force in the universe really wants me to attend todays session! :rolling_on_the_floor_laughing:

☺️ 1
refset16:03:12

suspicious πŸ˜… thanks for joining!

oxalorg (Mitesh)16:03:32

Thanks for the warm session learnt some really cool things which I can explore! bowtie

πŸ™Œ 1