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

Automatic columns selector for joins function #168

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

pcbldi
Copy link

@pcbldi pcbldi commented Sep 2, 2024

This changes introduces an automatic column selector as discussed in #133 .

All the common columns in two datasets are used as the column selectors.

prakash-defnx and others added 4 commits August 22, 2024 01:35
Find out common columns between the 2 datasets and use the common columns
in them as column-selector
This change introduces a new arity in left-join function
Copy link
Member

@genmeblog genmeblog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to change api.clj file since it's generated. https://github.com/scicloj/tablecloth/blob/master/src/tablecloth/api/api_template.clj#L182

@@ -53,22 +53,35 @@
(impl [(first cols-left) (first cols-right)] ds-left ds-right (or options {}))
(multi-join impl ds-left ds-right cols-left cols-right options))))

(defn- automatic-columns-selector [ds-left ds-right]
(let [cols-l (set (column-names ds-left :all))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:all can be skipped.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,thanks.

@@ -53,22 +53,35 @@
(impl [(first cols-left) (first cols-right)] ds-left ds-right (or options {}))
(multi-join impl ds-left ds-right cols-left cols-right options))))

(defn- automatic-columns-selector [ds-left ds-right]
(let [cols-l (set (column-names ds-left :all))
cols-r (set (column-names ds-right :all))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:all can be skipped.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thanks

@pcbldi pcbldi force-pushed the joins-automatic-column-selector branch from a32c8af to 6702403 Compare September 16, 2024 14:05
@prakash-defnx
Copy link

You don't have to change api.clj file since it's generated. https://github.com/scicloj/tablecloth/blob/master/src/tablecloth/api/api_template.clj#L182

thanks, should I revert the changes in that ns completely? or its ok to leave what changes are there?

@pcbldi pcbldi marked this pull request as ready for review September 16, 2024 20:44
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

Successfully merging this pull request may close these issues.

3 participants