Skip to content

Commit fa1c75b

Browse files
craig[bot]ZhouXing19rafiss
committed
149898: sql: INVERTED JOIN acceleration for `json ? string`, `json ?& array`, `json ?| array` and `array && array` r=ZhouXing19 a=ZhouXing19 fixes #81642 fixes #81643 ref: #81253 This commit adds support for accelerating the json ? string, json ?& array, json ?| array and array && array operators for INVERTED JOIN when the json/array argument is a column that has an inverted index over it. Release note (sql change): the json ? string, json ?& array, json ?| array and array && array operators are now index accelerated for INVERTED JOIN statement if there is an inverted index over the json column referred to on the left hand side of the expression. 150253: tabledesc: allow TTL storage params to be set to 0 r=rafiss a=rafiss Epic: None Release note (bug fix): Fixed a bug that prevented the row-level TTL table storage parameters (e.g. ttl_select_batch_size, ttl_delete_batch_size, ttl_delete_rate_limit, and ttl_select_rate_limit) from being set to 0, which is their default value. Co-authored-by: ZhouXing19 <[email protected]> Co-authored-by: Rafi Shamim <[email protected]>
3 parents b98a0ae + cb51054 + 28e1c52 commit fa1c75b

File tree

7 files changed

+588
-50
lines changed

7 files changed

+588
-50
lines changed

pkg/sql/catalog/tabledesc/ttl.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ func ValidateTTLExpirationColumn(desc catalog.TableDescriptor) error {
131131

132132
// ValidateTTLBatchSize validates the batch size of a TTL.
133133
func ValidateTTLBatchSize(key string, val int64) error {
134-
if val <= 0 {
134+
if val < 0 {
135135
return pgerror.Newf(
136136
pgcode.InvalidParameterValue,
137-
`"%s" must be at least 1`,
137+
`"%s" must be at least 0`,
138138
key,
139139
)
140140
}
@@ -157,10 +157,10 @@ func ValidateTTLCronExpr(key string, str string) error {
157157
// ValidateTTLRowStatsPollInterval validates the automatic statistics field
158158
// of TTL.
159159
func ValidateTTLRowStatsPollInterval(key string, val time.Duration) error {
160-
if val <= 0 {
160+
if val < 0 {
161161
return pgerror.Newf(
162162
pgcode.InvalidParameterValue,
163-
`"%s" must be at least 1`,
163+
`"%s" must be at least 0`,
164164
key,
165165
)
166166
}
@@ -169,10 +169,10 @@ func ValidateTTLRowStatsPollInterval(key string, val time.Duration) error {
169169

170170
// ValidateTTLRateLimit validates the rate limit parameters of TTL.
171171
func ValidateTTLRateLimit(key string, val int64) error {
172-
if val <= 0 {
172+
if val < 0 {
173173
return pgerror.Newf(
174174
pgcode.InvalidParameterValue,
175-
`"%s" must be at least 1`,
175+
`"%s" must be at least 0`,
176176
key,
177177
)
178178
}

pkg/sql/catalog/tabledesc/validate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2852,7 +2852,7 @@ func TestValidateTableDesc(t *testing.T) {
28522852
DurationExpr: catpb.Expression("INTERVAL '2 minutes'"),
28532853
},
28542854
}},
2855-
{err: `"ttl_select_batch_size" must be at least 1`,
2855+
{err: `"ttl_select_batch_size" must be at least 0`,
28562856
desc: descpb.TableDescriptor{
28572857
ID: 2,
28582858
ParentID: 1,

0 commit comments

Comments
 (0)