Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): introduce the hidden column #863

Merged
merged 6 commits into from
Oct 30, 2024

Conversation

goldmedal
Copy link
Contributor

@goldmedal goldmedal commented Oct 30, 2024

Description

This PR introduces a new column property, is_hidden. A hidden column means this column is defined in the MDL but it can't be used in the query.
The main purpose of a hidden column is to infer the remote source column. Sometimes, we want to apply something on a remote column like, casting, lowercase, or trim. we may write the MDL like

{
    "name": "date_in_int_col",
    "type": "date",
    "expression": "cast(date_in_int_col as date)"
}

However, according to the rule of #844, we can get a remote column from a casting expression. So date_in_int_col won't be registered as a source column, the column expression isn't valid.

In this case, we should add another column for the column inferring but we don't want to expose this column. So we can invoke the is_hidden property

{
    "name": "date_in_int_col",
    "type": "int",
    "is_hidden": true
},
{
    "name": "date_in_int_col_date",
    "type": "date",
    "expression": "cast(date_in_int_col as date)"
}

Now, we can infer the remote column is an int column called date_in_int_col. We can use it in the expression of another column.

@github-actions github-actions bot added core rust Pull requests that update Rust code labels Oct 30, 2024
@goldmedal goldmedal marked this pull request as ready for review October 30, 2024 02:53
Copy link
Contributor

@grieve54706 grieve54706 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@grieve54706
Copy link
Contributor

Hey @goldmedal, some conflicts need to be resolved.

@goldmedal goldmedal merged commit 5641edb into Canner:main Oct 30, 2024
12 of 13 checks passed
@goldmedal goldmedal deleted the feature/hidden-column branch October 30, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants