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

Same name fields conflict in parent/child documents #33088

Open
zygisx opened this issue Jan 7, 2025 · 0 comments
Open

Same name fields conflict in parent/child documents #33088

zygisx opened this issue Jan 7, 2025 · 0 comments
Assignees
Labels
Milestone

Comments

@zygisx
Copy link

zygisx commented Jan 7, 2025

Describe the bug
in parent/child related schemas if I import field with same name, deployment fails. Here is minimal example

To Reproduce

users.sd:
schema users {
    document users {
        field id type long {
            indexing: summary | attribute
        }
        field city_ref type reference<cities> {
            indexing: attribute
        }
    }

     import field city_ref.id as city_id {}
}

cities.sd:
schema cities {
    document cities {
        field id type int {
            indexing: summary | attribute
        }
    }
}

service.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<services version="1.0">
  <container id="default" version="1.0">
    <search>
    </search>
    <document-api/>
    <accesslog type="disabled"/>
    <model-evaluation/>
  </container>

  <content id="content" version="1.0">
    <redundancy>1</redundancy>
    <documents>
      <document type="cities" mode="index" global="true" />
      <document type="users" mode="index" />
    </documents>
  </content>
</services>

gives error:

For schema 'users', field 'id':
Incompatible types. Expected long for attribute 'id', got int.

So seems users.id and cities.id fields conflicting. If i remove this line import field city_ref.id as city_id {} deployment completes without error.

Expected behavior
I expect that fields would not conflict.

Environment (please complete the following information):

  • Infrastructure: self-hosted / docker

Vespa version
8.458.13

Additional context
Slack thread:
https://vespatalk.slack.com/archives/C01QNBPPNT1/p1736246549128649

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

No branches or pull requests

4 participants