Skip to content

Commit 9c41656

Browse files
committed
MB-70908 Remove the limit on the number of...
... keyspaces that can be included in the natural_context request parameter. Change-Id: I6b3c5f36e5451736be96412cae1c2df6a7df9a4a Reviewed-on: https://review.couchbase.org/c/query/+/241575 Tested-by: Gaurav J <gaurav.jayaraj@couchbase.com> Well-Formed: Restriction Checker Reviewed-by: Sitaram Vemulapalli <sitaram.vemulapalli@couchbase.com>
1 parent 405c5e5 commit 9c41656

5 files changed

Lines changed: 1 addition & 26 deletions

File tree

errors/codes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ const (
630630
E_NL_TOO_MANY_WAITERS ErrorCode = 19220
631631
E_NL_TIMEOUT ErrorCode = 19221
632632
E_NL_REQ_FEAT_DISABLED ErrorCode = 19222
633-
E_NL_TOO_MANY_KEYSPACES ErrorCode = 19223
633+
_RETIRED_19223 ErrorCode = 19223
634634
E_AUS_NOT_SUPPORTED ErrorCode = 20000
635635
E_AUS_NOT_INITIALIZED ErrorCode = 20001
636636
E_AUS_STORAGE ErrorCode = 20002

errors/messages.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8011,22 +8011,6 @@ var errData = []ErrData{
80118011
"Server",
80128012
},
80138013
},
8014-
{
8015-
Code: E_NL_TOO_MANY_KEYSPACES, // 19223
8016-
symbol: "E_NL_TOO_MANY_KEYSPACES",
8017-
Description: "Too many keyspaces specified.",
8018-
IsUser: YES,
8019-
Reason: []string{
8020-
"The \"natural_context\" parameter specifies more than the maximum permitted number of keyspaces.",
8021-
"The \"keyspaces\" option specifies more than the maximum permitted number of keyspaces.",
8022-
},
8023-
Action: []string{
8024-
"Revise the \"natural_context\" parameter or \"keyspaces\" option.",
8025-
},
8026-
AppliesTo: []string{
8027-
"Server",
8028-
},
8029-
},
80308014
{
80318015
Code: E_AUS_NOT_SUPPORTED, // 20000
80328016
symbol: "E_AUS_NOT_SUPPORTED",

errors/natural.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ var naturalErrMap = map[ErrorCode][2]string{
4747
E_NL_TOO_MANY_WAITERS: {RATE_LIMIT, "Too many waiters, dropping the request"},
4848
E_NL_TIMEOUT: {RATE_LIMIT, "Timed out waiting to be processed."},
4949
E_NL_REQ_FEAT_DISABLED: {SERVE_NATURAL, "Natural language request processing is disabled."},
50-
E_NL_TOO_MANY_KEYSPACES: {NLCONTEXT_IKEY, "Too many keyspaces specified."},
5150
}
5251

5352
func NewNaturalLanguageRequestError(code ErrorCode, args ...interface{}) Error {

server/server.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,6 @@ func (this *Server) serviceNaturalRequest(request Request) (bool, bool) {
807807
}
808808

809809
elems, err = algebra.ParseAndValidatePathList(request.NaturalContext(), "default", request.QueryContext())
810-
if err == nil && len(elems) > natural.MAX_KEYSPACES {
811-
err = errors.NewNaturalLanguageRequestError(errors.E_NL_TOO_MANY_KEYSPACES)
812-
}
813810
if err != nil {
814811
request.Fail(errors.NewNaturalLanguageRequestError(errors.E_NL_CONTEXT, err))
815812
request.Failed(this)

test/gsi/test_cases/natural/testcases.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
"statements": "USING AI WITH {\"keyspaces\":\"a.c.c.d\"} Show few documents",
55
"errorCode": 19215
66
},
7-
{
8-
"testcase":"incorrect Natural context: too many keyspaces",
9-
"statements": "USING AI WITH {\"keyspaces\":[\"k1\", \"k2\", \"k3\", \"k4\", \"k5\"]} Show few documents",
10-
"errorCode":19215
11-
},
127
{
138
"testcase":"prompt requesting for a sql statement",
149
"statements":"USING AI WITH {\"keyspaces\":\"orders\"} documents with mana more than 200",

0 commit comments

Comments
 (0)