apache / apache/gravitino

[FEATURE] Support resolute sql expression for Lance add column request

Open
#9,637 0 comments 0 reactions 0 assignees View on GitHub
2.0.0 feature
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 16h
Merged PRs (30d)
298

Description

### Describe the feature

Currently, `AlterTableAddColumnsRequest` only supports passing a SQL string when adding new columns

```
public class AlterTableAddColumnsRequest {
public static final String JSON_PROPERTY_ID = "id";
@Nullable
private List id = new ArrayList();
public static final String JSON_PROPERTY_NEW_COLUMNS = "new_columns";
@Nonnull
private List newColumns = new ArrayList();

public AlterTableAddColumnsRequest() {
}

public class NewColumnTransform {
public static final String JSON_PROPERTY_NAME = "name";
@Nonnull
private String name;
public static final String JSON_PROPERTY_EXPRESSION = "expression";
@Nonnull
private String expression;

public NewColumnTransform() {
}
}
```

Then SQL expresison can be `CAST(NULL AS int)`, `cast((id + 1) as int)`

### Motivation

_No response_

### Describe the solution

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Locate AlterTableAddColumnsRequest and NewColumnTransform, then trace the Lance add-column request path that consumes their expression field. Confirm how SQL expressions such as CAST(NULL AS int) and cast((id + 1) as int) should be represented and validated; the work is done when those expressions are supported for adding Lance columns.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.