The right way to generate rows with redshift is to use WITH RECURSIVE CTEs, like that:
with recursive t(n) as (
select 0::integer
union all
select n+1 from t where n <= 100
)
select n*2 as two_times_n from t;
You can join t with whatever real table you want.
See https://docs.aws.amazon.com/redshift/latest/dg/r_WITH_clause.html