> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# create_union

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_union.rs#L40-L55)
pub async fn [create\_union](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-union.md#method.create_union)( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), table\_names: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, input\_column\_names: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>>, output\_column\_names: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateUnionResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateUnionResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a table that is the merge of one or more tablesMerges data from one or more tables with comparable data types into a new table.The following merges are supported:UNION (DISTINCT/ALL) - For data set union details and examples, see Union. For limitations, see Union Limitations and Cautions.INTERSECT (DISTINCT/ALL) - For data set intersection details and examples, see Intersect. For limitations, see Intersect Limitations.EXCEPT (DISTINCT/ALL) - For data set subtraction details and examples, see Except. For limitations, see Except Limitations.

##### Arguments

<ul>
  <li>`table_name` - Name of the table to be created, in \[schema\_name.]table\_name format, using standard name resolution rules and meeting table naming criteria.</li>
  <li>`table_names` - The list of table names to merge, in \[schema\_name.]table\_name format, using standard name resolution rules. Must contain the names of one or more existing tables.</li>
  <li>`input_column_names` - The list of columns from each of the corresponding input tables.</li>
  <li>`output_column_names` - The list of names of the columns to be stored in the output table.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_union.rs#L87-L109)
pub async fn [create\_union\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-union.md#method.create_union_with_opts)( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), table\_names: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, input\_column\_names: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>>, output\_column\_names: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, options: [CreateUnionRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateUnionRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateUnionResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateUnionResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a table that is the merge of one or more tablesMerges data from one or more tables with comparable data types into a new table.The following merges are supported:UNION (DISTINCT/ALL) - For data set union details and examples, see Union. For limitations, see Union Limitations and Cautions.INTERSECT (DISTINCT/ALL) - For data set intersection details and examples, see Intersect. For limitations, see Intersect Limitations.EXCEPT (DISTINCT/ALL) - For data set subtraction details and examples, see Except. For limitations, see Except Limitations.

##### Arguments

<ul>
  <li>`table_name` - Name of the table to be created, in \[schema\_name.]table\_name format, using standard name resolution rules and meeting table naming criteria.</li>
  <li>`table_names` - The list of table names to merge, in \[schema\_name.]table\_name format, using standard name resolution rules. Must contain the names of one or more existing tables.</li>
  <li>`input_column_names` - The list of columns from each of the corresponding input tables.</li>
  <li>`output_column_names` - The list of names of the columns to be stored in the output table.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_union.rs#L112-L123)
pub async fn [create\_union\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-union.md#method.create_union_raw)( \&self, request: &[CreateUnionRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateUnionRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateUnionResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateUnionResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateUnionRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateUnionRequest) to the `/create/union` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_union.rs#L127-L139)
pub async fn [create\_union\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-union.md#method.create_union_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[CreateUnionRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateUnionRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateUnionResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateUnionResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateUnionRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateUnionRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.