Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

311
Views
Vespa.ai: How to make an array of floats handle null values?

I am trying to make a simple Vespa application, where one of my data fields are an Array. However the array contains some null values. For instance an array like: [2.0,1.4,null,5.6,...].

What can I use instead of float to represent elements in the array?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Seems like you want to use a sparse tensor field instead since some addresses does not have a value. x{} denotes a sparse tensor, x[128] is an example of a dense tensor. See https://docs.vespa.ai/documentation/tensor-user-guide.html for an intro to vespa tensor fields.

field stuff type tensor<float>(x{}) {
  indexing: summary |attribute
}
[
  { "put": "id:example:example::0", "fields": {
      "stuff" : {
        "cells": [
          { "address" : { "x" : "0" }, "value": 2.0 },
          { "address" : { "x" : "1" }, "value": 1.4 },
          { "address" : { "x" : "3" }, "value": 5.6 },
        
        ]
      }
    }
  }
]
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!