Closed nehanene15 closed 3 months ago
/gcbrun
Below are the results of first_keys_table.compile()
here. This change only adds and RTRIM to the string PK columns
WITH t0 AS (
SELECT rtrim(t2."name") AS "name", t2."id",
(row_number() OVER (ORDER BY t2."name" ASC, t2."id" ASC) - 1) + 1 AS "dvt_pos_num"
FROM udfs.pk_bug t2
)
SELECT t1.*
FROM (
SELECT t0.*
FROM t0
WHERE (((t0."dvt_pos_num" * 2) - (floor((t0."dvt_pos_num" * 2) / 3) * 3)) <= 2) AND
(((t0."dvt_pos_num" * 2) - (floor((t0."dvt_pos_num" * 2) / 3) * 3)) > 0)
) t1
ORDER BY t1."name" ASC, t1."id" ASC
With -tsp
:
WITH t0 AS (
SELECT t2."name", t2."id",
(row_number() OVER (ORDER BY t2."name" ASC, t2."id" ASC) - 1) + 1 AS "dvt_pos_num"
FROM udfs.pk_bug t2
)
SELECT t1.*
FROM (
SELECT t0.*
FROM t0
WHERE (((t0."dvt_pos_num" * 2) - (floor((t0."dvt_pos_num" * 2) / 3) * 3)) <= 2) AND
(((t0."dvt_pos_num" * 2) - (floor((t0."dvt_pos_num" * 2) / 3) * 3)) > 0)
) t1
ORDER BY t1."name" ASC, t1."id" ASC
Closes Issue #1179
Applies RTRIM on string PKs when generating partitions with the
--trim-string-pks
flag. With this, the YAML configs will have trimmed whitespace from the string value in the WHERE clause. i.e