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

Bind tables by columns? #30

Closed
juba opened this issue Nov 27, 2020 · 3 comments
Closed

Bind tables by columns? #30

juba opened this issue Nov 27, 2020 · 3 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@juba
Copy link

juba commented Nov 27, 2020

Is there a way to bind tables by columns, in the same way as concat bind them by rows ?

For the moment the only way I found to do it is with something like :

let tmp1 = dt1.derive({ tmp: op.row_number() });
let tmp2 = dt2.derive({ tmp: op.row_number() });
tmp1
    .join(tmp2)
    .select(aq.not("tmp"));

But maybe there is a simpler way to do it ?

Thanks !

@jheer
Copy link
Member

jheer commented Nov 27, 2020

You can do this:

aq.table({ ...t1.columns(), ...t2.columns() })

Though maybe a helper method might be helpful?

@jheer jheer added the question Further information is requested label Nov 27, 2020
@juba
Copy link
Author

juba commented Nov 27, 2020

Well, this way is not complicated by itself, but I wouldn't have thought of it even after searching a bit in the documentation. So an helper method, for me at least, could definitely be useful.

Many thanks for you answer !

@jheer jheer changed the title Bind tables by columns Bind tables by columns? Dec 4, 2020
@jheer jheer added the documentation Improvements or additions to documentation label Dec 4, 2020
@jheer jheer closed this as completed in fc3e268 Dec 4, 2020
@jheer
Copy link
Member

jheer commented Dec 4, 2020

I've updated the table() documentation to include an example of binding columns together into a new table instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants