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

Try removing SQLALchemy code in DataChain.compare() with our own API #721

Open
ilongin opened this issue Dec 17, 2024 · 0 comments
Open
Assignees

Comments

@ilongin
Copy link
Contributor

ilongin commented Dec 17, 2024

Try refactoring DataChain.compare() without using SQLAlchemy. So, it would be something like this:

from datachain.func import _case, _if

l = dc1.mutate(ldiff=1)
r = dc2.mutate(rdiff=1)

dc_diff = (
 l.join(r, on="id")
 .mutate(d1=_case(_isnon(ldiff), "A", "D") )
 .mutate(d2=_case(_isnon(rdiff), "A", "D") )
 .mutate(diff=_case(d1!=d2, "A", "D") )
 .select_except("d1", "d2", "ldiff", "rdiff")
)

Important: test performance on large dataset and compare with current implementation

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