This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-19
Channels
- # announcements (1)
- # asami (75)
- # beginners (16)
- # calva (14)
- # cider (4)
- # clj-kondo (11)
- # cljs-dev (3)
- # clojure (110)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (38)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-sg (1)
- # clojure-spec (1)
- # clojure-taiwan (1)
- # clojure-uk (2)
- # clojurescript (34)
- # conjure (1)
- # data-science (9)
- # datahike (7)
- # datalevin (1)
- # datascript (1)
- # datomic (5)
- # etaoin (1)
- # fulcro (23)
- # graalvm (50)
- # helix (4)
- # hyperfiddle (8)
- # introduce-yourself (1)
- # jobs (3)
- # kaocha (10)
- # malli (8)
- # mid-cities-meetup (1)
- # minecraft (1)
- # off-topic (13)
- # pathom (14)
- # polylith (38)
- # reitit (1)
- # releases (1)
- # sci (65)
- # shadow-cljs (28)
- # specter (12)
- # tools-deps (8)
- # vim (1)
- # vscode (11)
- # xtdb (31)
tablecloth (and tech.ml.dataset) has a surprising behavior (to me) on join. Why would I want the right.id
? Isn't it guaranteed to be equal to id
?
(def ds1 (tc/dataset {:id [1 2] :name [:foo :bar]}))
(def ds2 (tc/dataset {:id [2 3] :value [100 200]}))
(tc/full-join ds1 ds2 :id)
full-join [3 4]:
| :id | :name | :right.id | :value |
|----:|-------|----------:|-------:|
| 2 | :bar | 2 | 100 |
| 1 | :foo | | |
| | | 3 | 200 |
There is no id=1 in the ds2 and no id=3 in the ds1. This produces missing values for each case.
Right, yes, it does make sense in full-join. I originally found the problem with left-join, where it's not as clear
left-outer-join [2 4]:
| :id | :name | :right.id | :value |
|----:|-------|----------:|-------:|
| 2 | :bar | 2 | 100 |
| 1 | :foo | | |