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

Ability to add column alias #213

Closed
moseleyi opened this issue May 30, 2023 · 3 comments · Fixed by #257
Closed

Ability to add column alias #213

moseleyi opened this issue May 30, 2023 · 3 comments · Fixed by #257
Labels
enhancement New feature or request triage
Milestone

Comments

@moseleyi
Copy link

Describe the feature

When defining a column for an external table, I would like to add metadata columns like metadata$filename, which are not correct column names.

Describe alternatives you've considered

I don't think there are any?

Additional context

I'm using Snowflake and stage tables have useful metadata that I would like to be in the external tables. At the moment I'm getting the error:

  'METADATA$FILE_LAST_MODIFIED' cannot be used as a column name for external tables.

I think it would be great to be able to add alias to column definition:

- name: metadata$file_content_key
  alias: file_content_key
  description: "Unique key for each file"
  data_type: varchar
@moseleyi moseleyi added enhancement New feature or request triage labels May 30, 2023
@natej-eb
Copy link

Another use case I've run into is when the column name in the source file happens to be value, which Snowflake doesn't allow because of their external table value column. I'd like to alias this column name specifically.

{
 "key": {...},
 "value": {...},
 "meta": {...}
}

@cakkinep
Copy link
Contributor

cakkinep commented Feb 27, 2024

@natej-eb take a look at the enhancements i am proposing on this PR and let me know if this solves your needs.

@cakkinep
Copy link
Contributor

Describe the feature

When defining a column for an external table, I would like to add metadata columns like metadata$filename, which are not correct column names.

Describe alternatives you've considered

I don't think there are any?

Additional context

I'm using Snowflake and stage tables have useful metadata that I would like to be in the external tables. At the moment I'm getting the error:

  'METADATA$FILE_LAST_MODIFIED' cannot be used as a column name for external tables.

I think it would be great to be able to add alias to column definition:

- name: metadata$file_content_key
  alias: file_content_key
  description: "Unique key for each file"
  data_type: varchar

Can you explain more about why you want to have the filename as a named column in the table when you can use the metadata$filename in a table? I am trying to understand the usecase better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants