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

Cannot set metadata.description #299

Closed
NielsZeilemaker opened this issue Jan 9, 2020 · 6 comments
Closed

Cannot set metadata.description #299

NielsZeilemaker opened this issue Jan 9, 2020 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@NielsZeilemaker
Copy link

Hi, I'm trying to figure out how to set the description of a delta table. Table.comment is used for non-delta tables (https://github.com/delta-io/delta/blob/master/src/main/scala/org/apache/spark/sql/delta/commands/DescribeDeltaDetailsCommandBase.scala#L126), but for delta tables it uses metadata.description (https://github.com/delta-io/delta/blob/master/src/main/scala/org/apache/spark/sql/delta/commands/DescribeDeltaDetailsCommandBase.scala#L170).

However, it seems impossible to set metadata.description. Or am I missing something?

@marmbrus
Copy link
Contributor

marmbrus commented Jan 9, 2020

Hmm, you are probably right. We should add DDL that lets you set the table description.

@marmbrus marmbrus added the enhancement New feature or request label Jan 9, 2020
@NielsZeilemaker
Copy link
Author

I can actually add a comment to a table while creating a delta table. So maybe we can implement a fallback to table.comment if the metadata.description is not set

@marmbrus
Copy link
Contributor

marmbrus commented Jan 9, 2020

I can actually add a comment to a table while creating a delta table.

This is probably because we don't yet really integrate with the metastore (this is coming soon #85), so you are just getting the default Spark behavior for create table.

We could implement a fallback, but in general we try to keep the transaction log as the source of truth with the metastore only being a "symlink" to the table. Some users access the same table from multiple systems / metastores and it might be confusing if they diverge.

@NielsZeilemaker
Copy link
Author

@marmbrus is this something I can help you with? Seems like a small issue I could probably implement/fix myself.

@marmbrus
Copy link
Contributor

Yeah sure! The first question I would look at is if Spark has an extension point here that would allow us to intercept existing DDL to set the comment for a table. @brkyvz might know.

@brkyvz
Copy link
Collaborator

brkyvz commented Jan 21, 2020

With Spark 3.0, there is a new COMMENT ON syntax. You should be able to do it with COMMENT ON TABLE x IS 'my comment' once Spark 3.0 is released

@brkyvz brkyvz added this to the 0.7.0 milestone Mar 13, 2020
@tdas tdas closed this as completed Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants