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

Schema field names 'id' and 'version' should be reserved #33316

Open
yuvalshimron opened this issue Feb 13, 2025 · 0 comments
Open

Schema field names 'id' and 'version' should be reserved #33316

yuvalshimron opened this issue Feb 13, 2025 · 0 comments

Comments

@yuvalshimron
Copy link

Describe the bug
When I define schemas with the fields "id" and "version" this seems to be accepted by the platform.
However, it generates sources which do not compile because the getters/setters of these fields collide with parent classes.

E.g. in clear() method we get:
'setId(com.yahoo.document.DocumentId)' in 'com.yahoo.document.Document' cannot be applied to '(java.lang.Long)'

And in getStructType() we get:
'getVersion()' in 'com.taboola.vespa.document.Campaign_base.Embedding_meta_data' clashes with 'getVersion()' in 'com.yahoo.document.datatypes.Struct'; attempting to use incompatible return type

To Reproduce
Create a schema with these fields:

field id type long {
  indexing: attribute | summary
  rank:filter
}

...

struct embedding_meta_data {
  field end_point_name type string {}
  field version type string {} # <------------ Here
  field update_time type long {}
}

And then generate sources.
The sources should show the compilation errors.

Vespa version
8.457.32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant