Create a Column

post/servers/{serverName}/caslibs/{caslibName}/tables/{tableName}/columns
Internal-Use Only

Adds a new column to a table. Since adding a column to a table modifies the in-memory structure of the table, the addition of a column creates a copy of the original table, introducing the new column in the copy. The original table is then removed

Request Samples

1

Response Samples

1{
2 "version": 3,
3 "name": "Y",
4 "label": "New Column",
5 "type": "double",
6 "rawLength": 8,
7 "formattedLength": 8,
8 "format": "F",
9 "numberFormatLength": 8,
10 "numberFormatDecimals": 0,
11 "indexed": false,
12 "index": 11,
13 "links": [
14 {
15 "method": "GET",
16 "rel": "up",
17 "href": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns",
18 "uri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns",
19 "type": "application/vnd.sas.cas.table"
20 },
21 {
22 "method": "GET",
23 "rel": "self",
24 "href": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns/Y",
25 "uri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns/Y",
26 "type": "application/vnd.sas.cas.column"
27 },
28 {
29 "method": "GET",
30 "rel": "frequency",
31 "href": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns/Y/frequency",
32 "uri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns/Y/frequency",
33 "type": "application/vnd.sas.cas.column.frequency"
34 },
35 {
36 "method": "GET",
37 "rel": "distinctCount",
38 "href": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns/Y/distinctCount",
39 "uri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns/Y/distinctCount",
40 "type": "application/vnd.sas.cas.column.distinct.count"
41 },
42 {
43 "method": "GET",
44 "rel": "distinctValues",
45 "href": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns/Y/distinctValues",
46 "uri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns/Y/distinctValues",
47 "type": "application/vnd.sas.collection",
48 "itemType": "text/plain"
49 },
50 {
51 "method": "GET",
52 "rel": "summaryStatistics",
53 "href": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns/Y/summaryStatistics",
54 "uri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/CUSTOMERS_UNWRANGLED_DATA/columns/Y/summaryStatistics",
55 "type": "application/vnd.sas.cas.column.summary.statistics"
56 }
57 ]
58}

Path Parameters

NameTypeRequiredDescription
caslibName
string
true

The Caslib name containing the input table.

serverName
string
true

Server name for the operation.

tableName
string
true

The table name.

Query Parameters

NameTypeRequiredDescription
sessionId
string
false

Session ID (useful when session-specific Caslib is desired).

Request Body

Inputs when creating new column in a table.

NameTypeRequiredDescription
column
CAS Column
false

Column information.

outputTableName
string
false

Optional output table name. Defaults to the input table name being referenced.

replaceTable
boolean
false

If output table already exists, replace it. Defaults to false.

Responses

StatusMeaningDescription
201CreatedThe Column was created successfully. Information about the created Column is returned.HeadersSchema
400Bad RequestThe request was invalid.Schema
404Not FoundThe requested CAS server does not exist.
409ConflictThe request could not be completed due to a conflict with the current state of the resource. Details are included in the response body.