Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some queries that use simple-subject-crawl strategy throw an error #269

Closed
mpoffald opened this issue Nov 28, 2022 · 3 comments · Fixed by #274
Closed

Some queries that use simple-subject-crawl strategy throw an error #269

mpoffald opened this issue Nov 28, 2022 · 3 comments · Fixed by #274
Assignees
Labels
bug Something isn't working as expected
Milestone

Comments

@mpoffald
Copy link
Contributor

mpoffald commented Nov 28, 2022

The following query:

{:select {"?s" ["*"]} 
:where  [["?s" :ex/favColor "?color"]]}

Throws this error:

#error {	  
	   :cause "class clojure.lang.PersistentArrayMap cannot be cast to class java.lang.Number (clojure.lang.PersistentArrayMap is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')"
	   :via
	   [{:type java.lang.ClassCastException
	     :message "class clojure.lang.PersistentArrayMap cannot be cast to class java.lang.Number (clojure.lang.PersistentArrayMap is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')"
	     :at [fluree.db.flake$cmp_long invokeStatic "flake.cljc" 310]}]
	   :trace
	   [[fluree.db.flake$cmp_long invokeStatic "flake.cljc" 310]
	    [fluree.db.flake$cmp_long invoke "flake.cljc" 309]
	    [fluree.db.flake$cmp_pred invokeStatic "flake.cljc" 321]
	    [fluree.db.flake$cmp_pred invoke "flake.cljc" 320]
	    [fluree.db.flake$cmp_flakes_psot invokeStatic "flake.cljc" 382]
	    [fluree.db.flake$cmp_flakes_psot invoke "flake.cljc" 380]
	    [clojure.lang.AFunction compare "AFunction.java" 51]
	    [clojure.data.avl$insert_BANG_ invokeStatic "avl.clj" 797]
	    [clojure.data.avl$insert_BANG_ invoke "avl.clj" 791]
	    [clojure.data.avl.AVLTransientMap assoc "avl.clj" 1606]
	    [clojure.data.avl.AVLTransientSet conj "avl.clj" 1810]
	    [clojure.core$conj_BANG_ invokeStatic "core.clj" 3367]
	    [clojure.core$conj_BANG_ invoke "core.clj" 3359]
	    [clojure.lang.ArraySeq reduce "ArraySeq.java" 119]
	    [clojure.core$reduce invokeStatic "core.clj" 6885]
	    [clojure.core$reduce invoke "core.clj" 6868]
	    [clojure.data.avl$sorted_set_by invokeStatic "avl.clj" 1933]
	    [clojure.data.avl$sorted_set_by doInvoke "avl.clj" 1928]
	    [clojure.lang.RestFn applyTo "RestFn.java" 139]
	    [clojure.core$apply invokeStatic "core.clj" 669]
	    [clojure.core$apply invoke "core.clj" 662]
	    [fluree.db.flake$sorted_set_by invokeStatic "flake.cljc" 526]
	    [fluree.db.flake$sorted_set_by doInvoke "flake.cljc" 524]
	    [clojure.lang.RestFn invoke "RestFn.java" 439]
	    [fluree.db.query.subject_crawl.subject$subjects_chan invokeStatic "subject.cljc" 42]
	    [fluree.db.query.subject_crawl.subject$subjects_chan invoke "subject.cljc" 15]
	    [fluree.db.query.subject_crawl.subject$subj_crawl$fn__26529$state_machine__7578__auto____26554$fn__26557 invoke "subject.cljc" 155]
	    [fluree.db.query.subject_crawl.subject$subj_crawl$fn__26529$state_machine__7578__auto____26554 invoke "subject.cljc" 143]
	    [clojure.core.async.impl.runtime$run_state_machine invokeStatic "runtime.clj" 62]
	    [clojure.core.async.impl.runtime$run_state_machine invoke "runtime.clj" 61]
	    [clojure.core.async.impl.runtime$run_state_machine_wrapped invokeStatic "runtime.clj" 66]
	    [clojure.core.async.impl.runtime$run_state_machine_wrapped invoke "runtime.clj" 64]
	    [fluree.db.query.subject_crawl.subject$subj_crawl$fn__26529 invoke "subject.cljc" 143]
	    [clojure.lang.AFn run "AFn.java" 22]
	    [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1136]
	    [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 635]
	    [clojure.core.async.impl.concurrent$counted_thread_factory$reify__1977$fn__1978 invoke "concurrent.clj" 29]
	    [clojure.lang.AFn run "AFn.java" 22]
	    [java.lang.Thread run "Thread.java" 833]]}

Given the appropriate context/data, this query should run (and in fact, when I remove this or and allow this to run with the default strategy, it does).

Unsure if this is relevant, but: other tests exist which successfully utilize the simple-subject-crawl strategy. I found several in this test ns. All of them use a :from key, none use a :where.

@mpoffald mpoffald changed the title Some queries Some queries that use simple-subject-crawl strategy throw an error Nov 28, 2022
@mpoffald mpoffald added the bug Something isn't working as expected label Nov 28, 2022
@mpoffald
Copy link
Contributor Author

Things I tried so far that still resulted in the same error:

  • using symbols and strings for the vars
  • using :* instead of "*"

@bplatz
Copy link
Contributor

bplatz commented Nov 29, 2022

Hi, is this being worked on? I can take a quick look if not.

@mpoffald
Copy link
Contributor Author

I'd like to take this one, I already started looking into it a bit yesterday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants