split_column
Split column values by delimiter to extract specific parts or expand into multiple columns for data transformation and organization.
Instructions
Split column values by delimiter.
Returns: ColumnOperationResult with split details
Examples: # Keep first part of split split_column(ctx, "full_name", " ", part_index=0)
# Keep last part
split_column(ctx, "email", "@", part_index=1)
# Expand into multiple columns
split_column(ctx, "address", ",", expand_to_columns=True)
# Expand with custom column names
split_column(ctx, "name", " ", expand_to_columns=True,
new_columns=["first_name", "last_name"])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| column | Yes | Column name to split values in | |
| delimiter | No | String delimiter to split on | |
| part_index | Yes | Which part to keep (0-based index, None for first part) | |
| expand_to_columns | Yes | Whether to expand splits into multiple columns | |
| new_columns | Yes | Names for new columns when expanding |
Input Schema (JSON Schema)
{
"properties": {
"column": {
"description": "Column name to split values in",
"type": "string"
},
"delimiter": {
"default": " ",
"description": "String delimiter to split on",
"type": "string"
},
"expand_to_columns": {
"description": "Whether to expand splits into multiple columns",
"type": "boolean"
},
"new_columns": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Names for new columns when expanding"
},
"part_index": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"description": "Which part to keep (0-based index, None for first part)"
}
},
"required": [
"column",
"part_index",
"expand_to_columns",
"new_columns"
],
"type": "object"
}