Closed
Description
Currently, Define
adds any new columns at the end of the current column list. This is fine as the default behavior, but it should be possible to insert them at the beginning or at any particular position.
Definitions that are replacing existing columns currently retain their positions. It should be possible to re-position them as if they are new columns.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
clarkevans commentedon Mar 28, 2024
Databricks "ADD COLUMN" has two options:
xitology commentedon Mar 28, 2024
I'm thinking of the following interface:
@funsql define(x => f())
: ifx
already present, preserve its position, otherwise, add it to the end. This is the current behavior.@funsql define(x => f(), after = true)
: add or movex
to the end.@funsql define(x => f(), after = y)
: add or movex
to the next position after fieldy
, an error ify
does not exist.@funsql define(x => f(), before = true)
: add or movex
to the beginning.@funsql define(x => f(), before = y)
: add or morex
to the position right beforey
, an error ify
does not exist.before
andafter
cannot be both set.xitology commentedon Sep 23, 2024
Added in 2459dd0