---
cases:
  - data:
      a:
        - 1
        - 2
        - 3
        - 4
      g:
        a:
          - 1
          - 0
          - 0
          - 0
        b:
          - 0
          - 2
          - 0
          - 0
        c:
          - 0
          - 0
          - 0
          - 4
    modules:
      - |
        package generated

        p[k] = v {
          data.a[i] = v
          data.g[k][i] = v
        }
    note: partialobjectdoc/body/join var
    query: data.generated.p = x
    want_result:
      - x:
          a: 1
          b: 2
          c: 4
