Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
add_table_column [2015/10/13 20:27] admin |
add_table_column [2026/08/28 03:09] (current) hermann Sync from local documentation review |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Description ===== | ===== Description ===== | ||
| - | This functor creates a new column in the given table. The position where the new column is inserted determines whether the new column is a key or data column. | + | Creates a new column in the given table. The position where the new column is inserted determines whether the new column is a key column or a data column. |
| ===== Inputs ===== | ===== Inputs ===== | ||
| - | ^ Name ^ Type ^ Description ^ | + | ^ Name ^ Type ^ Description ^ |
| | Table | [[Table Type]] | Table where the new column will be created. | | | Table | [[Table Type]] | Table where the new column will be created. | | ||
| - | | Column Name | [[Name Type]] | The new column name. | | + | | Column Name | [[Name Type]] | The new column's name. | |
| - | | Column Type | [[Table Cell Type]] | The new column cell type. | | + | | Column Type | [[Table Cell Type]] | The new column's cell type. | |
| ===== Optional Inputs ===== | ===== Optional Inputs ===== | ||
| - | ^ Name ^ Type ^ Description ^ Default Value ^ | + | ^ Name ^ Type ^ Description ^ Default Value ^ |
| - | | Column Index | [[Non Negative Integer Value Type]] | Index representing the position where the column will be inserted. If the index is zero or greater than the last column index, the column is placed as the last table column. | 0 | | + | | Column Index | [[Non Negative Integer Value Type]] | Position where the new column will be inserted. If zero or greater than the last column index, the column is placed as the last table column. If the column already exists, its existing index is kept. This is an advanced port. | 0 | |
| - | | Column Should Be Key | [[Boolean Value Type]] | This flag is meaningful only when the column is created after the last key column and before the first data column. If true, the new column represents a key column, otherwise, it represents a data one. | True | | + | | Column Should Be Key | [[Boolean Value Type]] | Meaningful only when the new column is created between the last key column and the first data column: True makes it a key column, False makes it a data column. This is an advanced port. | False | |
| + | | Column Values | [[Table Type]] | Table whose data column holds the initial values of the new data column, keyed the same way. Must have the same key columns (and types) as the table being modified, and exactly one data column; column names are ignored. Must not be provided when the new column is a key column. If the column already exists, these values are merged with the existing ones, overriding conflicting definitions. This is an advanced port. | .none | | ||
| + | | Default Value | [[Table Value Type]] | Value assigned to cells of the new column not covered by Column Values. If not provided, 0 or "" is used, depending on the column type. Using this setting may degrade performance. This is an advanced port. | .none | | ||
| ===== Outputs ===== | ===== Outputs ===== | ||
| - | ^ Name ^ Type ^ Description ^ | + | ^ Name ^ Type ^ Description ^ |
| | Result | [[Table Type]] | The resulting table containing the new column. | | | Result | [[Table Type]] | The resulting table containing the new column. | | ||
| ===== Group ===== | ===== Group ===== | ||
| - | [[Functor List#Table|Table]] | + | [[Functor List#Table | Table]] |
| ===== Notes ===== | ===== Notes ===== | ||
| - | This functor adds an empty column of the given type at the given position. | + | For best performance, avoid specifying a default value and always insert data columns as the last column. |
| **Example:** | **Example:** | ||
| Line 43: | Line 46: | ||
| ^ Key1* ^ New_Column* ^ Key2* ^ Value1 ^ Value2 ^ | ^ Key1* ^ New_Column* ^ Key2* ^ Value1 ^ Value2 ^ | ||
| - | | 1 |@green: 0.0 | 2 | 2.2 | 3.1 | | + | | 1 |@#C5D9FF: 0.0 | 2 | 2.2 | 3.1 | |
| - | | 1 |@green: 0.0 | 3 | 2.1 | 3.1 | | + | | 1 |@#C5D9FF: 0.0 | 3 | 2.1 | 3.1 | |
| - | | 1 |@green: 0.0 | 6 | 1.2 | 4.2 | | + | | 1 |@#C5D9FF: 0.0 | 6 | 1.2 | 4.2 | |
| - | | 2 |@green: 0.0 | 2 | 3.2 | 6.1 | | + | | 2 |@#C5D9FF: 0.0 | 2 | 3.2 | 6.1 | |
| ===== Internal Name ===== | ===== Internal Name ===== | ||
| AddTableColumn | AddTableColumn | ||
| + | |||