union

There are other concepts named union. See the entire list.

union, table creation

The union table creation form concatenates the rows of two tables. By default, the schema of the left table is used; all vectors of the left table must also exist in the right table with matching types. Extra vectors found only in the right table are ignored.

table A = extend.range(2)
A.Label = "A"

table B = extend.range(2)
B.Label = "B"
B.Ignored = "X"

table C = union(A, B)

show table "C" with
  C.N
  C.Label

The union result is a new table with its own primary dimension; any source dimension vectors (such as N) become regular vectors in the result.

Schema selection

Use schema to select and order the columns to keep. All columns listed in the schema must exist in both tables and match the schema types.

schema S with
  N : number
  Label : text

table A = extend.range(2)
A.Label = "A"
A.Other = "left"

table B = extend.range(2)
B.Label = "B"
B.Other = "right"

table C = union(A, B) schema S

show table "C" with
  C.N
  C.Label

Errors

The union fails at compile time if:

User Contributed Notes
0 notes + add a note