0

I have two separate GridDB containers storing different databases. The two tables in the databases do not have columns in common. I want a way to concatenate them side by side so I can have a single container at the end, having a single table, with all the columns in the two separate tables. Is there a way I can do that in Python, with an Ubuntu machine?

For example, suppose I have two tables from the different containers, thus:

'''
table_1

column_1 | column_2 | column_3 | column_4
---------+----------+----------+----------
value_1a | value_2a | value_3a | value_4a
value_1b | value_2b | value_3b | value_4b
value_1c | value_2c | value_3c | value_4c
value_1d | value_2d | value_3d | value_4d
value_1e | value_2e | value_3e | value_4e

table_2

col_1 | col_2 | col_3
-------+--------+--------
val_1a | val_2a | val_3a
val_1b | val_2b | val_3b

==> output

column_1 | column_2 | column_3 | column_4 | col_1 | col_2 | col_3
---------+----------+----------+----------+--------+---------+--------
value_1a | value_2a | value_3a | value_4a | val_1a | val_2a | val_3a
value_1b | value_2b | value_3b | value_4b | val_1b | val_2b | val_3b
value_1c | value_2c | value_3c | value_4c | NULL | NULL | NULL
value_1d | value_2d | value_3d | value_4d | NULL | NULL | NULL
value_1e | value_2e | value_3e | value_4e | NULL | NULL | NULL
'''

As you can see, since the second table does not have up to 5 rows, the remaining 3 rows have null values in their respective cells. Thanks in advance for your help!

0 Answers0