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

sorted-set is not supported and causes exceptions to be thrown #197

Open
jwr opened this issue Sep 18, 2018 · 0 comments
Open

sorted-set is not supported and causes exceptions to be thrown #197

jwr opened this issue Sep 18, 2018 · 0 comments

Comments

@jwr
Copy link
Contributor

jwr commented Sep 18, 2018

Attempting to insert an object which contains a sorted-set field (instead of a simple set) causes an exception to be thrown:

Exception in thread "async-dispatch-2" java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.Keyword
        at clojure.lang.Keyword.compareTo(Keyword.java:114)
        at clojure.lang.Util.compare(Util.java:153)
        at clojure.lang.RT$DefaultComparator.compare(RT.java:281)
        at clojure.lang.PersistentTreeMap.doCompare(PersistentTreeMap.java:327)
        at clojure.lang.PersistentTreeMap.entryAt(PersistentTreeMap.java:314)
        at clojure.lang.PersistentTreeMap.valAt(PersistentTreeMap.java:294)
        at clojure.lang.PersistentTreeMap.valAt(PersistentTreeMap.java:299)
        at clojure.lang.APersistentSet.get(APersistentSet.java:38)
        at clojure.lang.RT.getFrom(RT.java:766)
        at clojure.lang.RT.get(RT.java:754)
        at clojure.lang.KeywordLookupSite.get(KeywordLookupSite.java:38)
        at rethinkdb.query_builder$eval35708$fn__35709.invoke(query_builder.cljc:29)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.core$map$fn__5587.invoke(core.clj:2747)
        at clojure.lang.LazySeq.sval(LazySeq.java:40)
        at clojure.lang.LazySeq.seq(LazySeq.java:49)
        at clojure.lang.RT.seq(RT.java:528)
        at clojure.core$seq__5124.invokeStatic(core.clj:137)
        at clojure.core$zipmap.invokeStatic(core.clj:3063)
        at clojure.core$zipmap.invoke(core.clj:3063)
        at rethinkdb.query_builder$eval35724$fn__35725.invoke(query_builder.cljc:43)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.core$map$fn__5587.invoke(core.clj:2745)
        at clojure.lang.LazySeq.sval(LazySeq.java:40)
        at clojure.lang.LazySeq.seq(LazySeq.java:49)
        at clojure.lang.RT.seq(RT.java:528)
        at clojure.core$seq__5124.invokeStatic(core.clj:137)
        at clojure.core$seq__5124.invoke(core.clj:137)
        at cheshire.generate$generate.invokeStatic(generate.clj:130)
        at cheshire.generate$generate.invoke(generate.clj:116)
        at cheshire.generate$generate.invokeStatic(generate.clj:130)
        at cheshire.generate$generate.invoke(generate.clj:116)
        at cheshire.generate$generate.invokeStatic(generate.clj:124)
        at cheshire.generate$generate.invoke(generate.clj:116)
        at cheshire.core$generate_string.invokeStatic(core.clj:74)
        at cheshire.core$generate_string.invoke(core.clj:49)
        at rethinkdb.net$setup_producer$fn__35927$state_machine__16917__auto____35936$fn__35938.invoke(net.clj:150)
        at rethinkdb.net$setup_producer$fn__35927$state_machine__16917__auto____35936.invoke(net.clj:150)
        at clojure.core.async.impl.ioc_macros$run_state_machine.invokeStatic(ioc_macros.clj:973)
        at clojure.core.async.impl.ioc_macros$run_state_machine.invoke(ioc_macros.clj:972)
        at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invokeStatic(ioc_macros.clj:977)
        at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invoke(ioc_macros.clj:975)
        at clojure.core.async.impl.ioc_macros$take_BANG_$fn__16935.invoke(ioc_macros.clj:986)
        at clojure.core.async.impl.channels.ManyToManyChannel$fn__11818.invoke(channels.clj:135)
        at clojure.lang.AFn.run(AFn.java:22)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

To reproduce:

  (q (r/table-create "test"))
  
  (q (r/table "test")
     (r/insert {:id "test" :sorted-set (sorted-set 1 2 3 4)}))

My current workaround is to write data conversion functions that call vec on those sets when passing them into clj-rethinkdb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant