From df6b3ee074044eb17de297500cbe4c296e2d9162 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Sat, 28 Dec 2024 01:47:17 -0800 Subject: [PATCH] Update with comment. --- clients/redshift/dialect/dialect.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clients/redshift/dialect/dialect.go b/clients/redshift/dialect/dialect.go index 5e3bdf40..0f456472 100644 --- a/clients/redshift/dialect/dialect.go +++ b/clients/redshift/dialect/dialect.go @@ -36,6 +36,8 @@ func (rd RedshiftDialect) BuildIsNotToastValueExpression(tableAlias constants.Ta switch column.KindDetails { case typing.Struct, typing.Array: + // We need to use JSON_SIZE to check if the column can be serialized into a VARCHAR + // If the value is greater than 500 characters, it's likely not going to be toasted, so we can skip the check. return fmt.Sprintf(` COALESCE( CASE