How to increase Infer timeout

Hi.
Keep getting such error Schema may be incomplete. Stopped schema inferencing after exceeding infer_timeout of 60 seconds. Is there a way to increase this timeout ?

https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/infer.html

infer collections with {“infer_timeout”:5};
value in seconds.

cc @eben

1 Like

@Kessler2009 Schema inferencing can take a long time with very large or complex documents. Is that the case for your data?

Yes, i’m creating schema for all documents in bucket (around 3500000).
Also wanted to ask , is there a way to infer documents chosen with “where” like this:
INFER DOCS b WITH {"sample_size":500000,"num_sample_values":5,"similarity_metric":0.9,"infer_timeout":120, "max_schema_MB":100} WHERE META(b).id LIKE "TestDocument%"
?

Unfortunately the INFER command does not support a WHERE clause (though it has been requested before - doing random sampling on a subset of the data is not yet supported).

However, you could create a temporary bucket/collection for the subset of documents, and then run infer on that bucket/collection. E.g.

  • create bucket ‘test’
  • insert documents:
INSERT INTO test (KEY id, VALUE b)
SELECT meta(b).id id, b
FROM DOCS b
WHERE META(b).id LIKE "TestDocument%"
  • run infer on ‘test’
2 Likes