Skip to content

ABORT THROWN BY INTERNAL EXCEPTION: Attempting to initialize state of expression of unknown type! #4180

@fuzzerofducks

Description

@fuzzerofducks

Issue found by SQLSmith on git commit hash 5506e using seed 58712102.

To Reproduce

create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
MERGE INTO main.all_types as target_0
USING main.all_types as ref_0
ON target_0.time = ref_0.time 
WHEN NOT MATCHED AND EXISTS (
    select  
        subq_0.c3 as c0, 
        cast(nullif(subq_0.c1,
          (select timestamptz_array from main.all_types limit 1 offset 1)
            ) as timestamp with time zone[]) as c1, 
        subq_0.c1 as c2, 
        subq_0.c4 as c3, 
        subq_0.c4 as c4, 
        53 as c5, 
        (select utinyint from main.all_types limit 1 offset 1)
           as c6, 
        subq_0.c3 as c7
      from 
        (select  
              51 as c0, 
              sample_0.timestamptz_array as c1, 
              (select double_array from main.all_types limit 1 offset 3)
                 as c2, 
              sample_0.varchar_array as c3, 
              ref_1.struct_of_arrays as c4
            from 
              main.all_types as ref_1
                right join main.all_types as sample_0 tablesample system (9.4) 
                on (1)
            where ref_1.timestamptz_array is NULL
            limit 157) as subq_0
      where cast(null as varchar) !~~* json_type(
          cast(cast(coalesce(cast(null as varchar),
            (select varchar from main.all_types limit 1 offset 5)
              ) as varchar) as varchar))
      limit 40)
   THEN INSERT VALUES ( 1, cast(null as tinyint), case when 46 is NULL then (select bit_xor(smallint) from main.all_types)
       else (select bit_xor(smallint) from main.all_types)
       end
    , 21, cast(null as bigint), cast(null as hugeint), (select uhugeint from main.all_types limit 1 offset 5)
    , cast(null as utinyint), cast(null as usmallint), cast(null as uinteger), cast(null as ubigint), cast(coalesce(cast(null as varint),
    cast(null as varint)) as varint), current_date(), cast(null as time), cast(null as timestamp), (select timestamp_s from main.all_types limit 1 offset 1)
    , cast(null as timestamp_ms), cast(null as timestamp_ns), get_current_time(), cast(null as timestamp with time zone), (select float from main.all_types limit 1 offset 6)
    , cast(null as double), cast(null as decimal(4,1)), cast(null as decimal(9,4)), cast(null as decimal(18,6)), cast(null as decimal(38,10)), cast(null as uuid), cast(null as interval), cast(null as varchar), cast(null as blob), case when cast(null as varchar) ^@ cast(null as varchar) then cast(null as bit) else cast(null as bit) end
    , cast(null as integer[]), (select double_array from main.all_types limit 1 offset 2)
    , cast(null as date[]), cast(null as timestamp[]), cast(null as timestamp with time zone[]), cast(null as varchar[]), cast(null as integer[][]), cast(null as struct(a integer, b varchar)), cast(null as struct(a integer[], b varchar[])), (select array_of_structs from main.all_types limit 1 offset 4)
    , cast(null as map(varchar, varchar)), cast(null as union("name" varchar, age smallint)), cast(null as integer[3]), cast(null as varchar[3]), (select fixed_nested_int_array from main.all_types limit 1 offset 54)
    , cast(null as varchar[3][3]), cast(null as struct(a integer, b varchar)[3]), cast(null as struct(a integer[3], b varchar[3])), cast(null as integer[][3]), cast(null as integer[3][]));
select  
  sample_0.array_of_structs as c0, 
  sample_0.utinyint as c1, 
  sample_0.ubigint as c2, 
  (select list_of_fixed_int_array from main.all_types limit 1 offset 5)
     as c3, 
  
    arg_min_null(
      cast(sample_0.double as double),
      cast(sample_0.double as double)) over (partition by sample_0.usmallint order by sample_0.array_of_structs) as c4
from 
  main.all_types as sample_0 tablesample system (2.3) 
where sample_0.varchar ~~* sample_0.varchar;
select  
  subq_0.c1 as c0, 
  case when EXISTS (
      select  
          ref_0.date_array as c0, 
          (select struct_of_fixed_array from main.all_types limit 1 offset 4)
             as c1, 
          subq_1.c0 as c2, 
          subq_0.c2 as c3
        from 
          main.all_types as ref_0,
          lateral (select distinct 
                ref_1.varint as c0, 
                subq_0.c2 as c1, 
                ref_1.usmallint as c2, 
                ref_1.tinyint as c3, 
                ref_0.uint as c4
              from 
                main.all_types as ref_1
              where 0) as subq_1
        where ref_0.varchar !~~* ref_0.varchar
        limit 64) then (select struct_of_arrays from main.all_types limit 1 offset 4)
       else (select struct_of_arrays from main.all_types limit 1 offset 4)
       end
     as c1, 
  subq_0.c3 as c2, 
  subq_0.c1 as c3, 
  subq_0.c0 as c4, 
  subq_0.c2 as c5, 
  current_date() as c6
from 
  (select  
        sample_0.dec_9_4 as c0, 
        sample_0.smallint as c1, 
        sample_0.uint as c2, 
        sample_0.nested_int_array as c3, 
        
          quantile_cont(
            cast(sample_1.bigint as bigint),
            cast(sample_1.bigint as bigint)) over (partition by sample_1.map,sample_1.float,sample_1.varchar,sample_1.time order by sample_0.float) as c4
      from 
        main.all_types as sample_0 tablesample system (2.8) 
          left join main.all_types as sample_1 tablesample system (8.1) 
          on (sample_0.ubigint is not NULL)
      where case when (58 is not NULL) 
            or ((sample_0.varchar ~~ sample_1.varchar) 
              and ((cast(null as t[]) && cast(null as t[])) 
                or (sample_1.varchar ~~ sample_1.varchar))) then cast(null as t[]) else cast(null as t[]) end
           <@ case when sample_1.varchar ~~* sample_1.varchar then array_where(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) else array_where(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) end
          ) as subq_0
where subq_0.c3 is not NULL;
WITH 
jennifer_0 AS (select  
    cast(coalesce(ref_0.bigint,
      ref_0.bigint) as bigint) as c0, 
    ref_0.timestamp_ns as c1, 
    ref_0.struct_of_arrays as c2, 
    case when array_select(
          cast(cast(null as t[]) as t[]),
          cast(
            list(
              cast(cast(null as t) as t)) over (partition by ref_0.timestamp order by ref_0.dec_9_4) as t[])) && case when ref_0.varchar ~~~ ref_0.varchar then cast(null as t[]) else cast(null as t[]) end
           then ref_0.bit else ref_0.bit end
       as c3, 
    ref_0.tinyint as c4, 
    ref_0.fixed_varchar_array as c5, 
    ref_0.usmallint as c6, 
    ref_0.list_of_fixed_int_array as c7, 
    
      arg_max(
        cast(case when (cast(null as t[]) <@ cast(null as t[])) 
            and (ref_0.varchar ^@ (select varchar from main.all_types limit 1 offset 1)
                ) then cast(null as any) else cast(null as any) end
           as any),
        cast(case when (ref_0.list_of_fixed_int_array is not NULL) 
            or (ref_0.dec38_10 is NULL) then cast(null as any) else cast(null as any) end
           as any)) over (partition by ref_0.varchar order by ref_0.nested_int_array,ref_0.float) as c8
  from 
    main.all_types as ref_0
  where version() !~~ (select varchar from main.all_types limit 1 offset 5)
      
  limit 146), 

jennifer_1 AS (select  
    ref_1.tinyint as c0
  from 
    main.all_types as ref_1
      inner join (select  
                47 as c0, 
                ref_2.fixed_struct_array as c1, 
                ref_2.varchar as c2, 
                ref_2.uint as c3
              from 
                main.all_types as ref_2
              where (ref_2.varchar ~~~ ref_2.varchar) 
                and (1)) as subq_0
          right join main.all_types as ref_3
            inner join main.all_types as sample_0 tablesample bernoulli (7.1) 
            on (cast(null as varchar) !~~* sample_0.varchar)
          on (subq_0.c2 ~~ (select varchar from main.all_types limit 1 offset 3)
                )
        left join (select  
              sample_1.date_array as c0, 
              sample_1.timestamp_ms as c1, 
              sample_1.fixed_varchar_array as c2
            from 
              main.all_types as sample_1 tablesample system (7.6) 
            where sample_1.varchar ^@ sample_1.varchar
            limit 124) as subq_1
        on (0)
      on (ref_1.varchar !~~ sample_0.varchar)
  where (EXISTS (
      select  
          sample_0.timestamp_s as c0, 
          (select dec38_10 from main.all_types limit 1 offset 1)
             as c1, 
          sample_0.dec_18_6 as c2
        from 
          main.all_types as ref_4
            inner join main.all_types as sample_2 tablesample system (3.5) 
            on ((subq_1.c2 is NULL) 
                and (EXISTS (
                  select  
                      sample_2.timestamp_ns as c0, 
                      sample_3.varchar as c1, 
                      sample_2.timestamp_ns as c2, 
                      14 as c3, 
                      sample_2.blob as c4, 
                      subq_1.c0 as c5, 
                      ref_4.fixed_array_of_int_list as c6, 
                      sample_2.fixed_array_of_int_list as c7, 
                      sample_3.dec38_10 as c8, 
                      ref_4.date_array as c9, 
                      sample_3.smallint as c10, 
                      ref_4.fixed_nested_varchar_array as c11, 
                      (select ubigint from main.all_types limit 1 offset 3)
                         as c12, 
                      ref_3.time as c13, 
                      sample_0.array_of_structs as c14, 
                      sample_0.interval as c15, 
                      subq_0.c1 as c16
                    from 
                      main.all_types as sample_3 tablesample bernoulli (6.2) 
                    where cast(null as varchar) ^@ (select varchar from main.all_types limit 1 offset 5)
                        
                    limit 101)))
        where (ref_4.varchar ~~~ sample_0.varchar) 
          and ((ref_4.varchar !~~ sample_2.varchar) 
            or ((ref_1.varchar ~~~ ref_3.varchar) 
              and (sample_0.varchar ~~~ ref_4.varchar))))) 
    or (case when ref_3.varchar ^@ cast(null as varchar) then sample_0.varchar else sample_0.varchar end
         ~~~ version())), 

jennifer_2 AS (select  
    subq_2.c2 as c0, 
    subq_2.c2 as c1, 
    
      min_by(
        cast(subq_2.c3 as date),
        cast(case when cast(null as varchar) ~~ (select varchar from main.all_types limit 1 offset 35)
               then (select date from main.all_types limit 1 offset 16)
             else (select date from main.all_types limit 1 offset 16)
             end
           as date)) over (partition by subq_2.c3,subq_2.c3,subq_2.c1 order by subq_2.c0) as c2, 
    subq_2.c0 as c3, 
    subq_2.c0 as c4, 
    cast(coalesce(subq_2.c2,
      subq_2.c2) as uuid) as c5, 
    subq_2.c3 as c6, 
    subq_2.c3 as c7, 
    subq_2.c0 as c8
  from 
    (select  
          sample_4.uint as c0, 
          (select dec_18_6 from main.all_types limit 1 offset 1)
             as c1, 
          sample_4.uuid as c2, 
          sample_4.date as c3
        from 
          main.all_types as sample_4 tablesample system (2.1) 
        where (EXISTS (
            select  
                sample_4.timestamp as c0, 
                ref_5.varchar as c1, 
                ref_5.union as c2
              from 
                main.all_types as ref_5
              where EXISTS (
                select  
                    sample_5.utinyint as c0, 
                    ref_5.timestamp_s as c1, 
                    sample_4.fixed_array_of_int_list as c2, 
                    ref_5.fixed_int_array as c3, 
                    sample_4.fixed_nested_int_array as c4, 
                    sample_5.blob as c5, 
                    sample_5.uint as c6
                  from 
                    main.all_types as sample_5 tablesample bernoulli (1.7) 
                  where sample_4.hugeint is not NULL))) 
          and (sample_4.varchar ~~~ sample_4.varchar)
        limit 62) as subq_2
  where case when cast(null as t[]) <@ cast(nullif(cast(null as t[]),
          case when subq_2.c3 is not NULL then cast(null as t[]) else cast(null as t[]) end
            ) as t[]) then current_database() else current_database() end
       ~~ (select varchar from main.all_types limit 1 offset 6)
      
  limit 88), 

jennifer_3 AS (select  
    sample_6.fixed_nested_varchar_array as c0, 
    list_value() as c1, 
    sample_8.uuid as c2, 
    sample_7.date as c3, 
    subtract(
      cast(ref_6.time_tz as time with time zone),
      cast(ref_9.time_tz as time with time zone)) as c4, 
    ref_9.tinyint as c5, 
    ref_6.bigint as c6
  from 
    main.all_types as sample_6 tablesample system (6.1) 
      inner join main.all_types as ref_6
          right join main.all_types as sample_7 tablesample system (2.4) 
            right join main.all_types as sample_8 tablesample bernoulli (7.3) 
            on (sample_8.varchar ~~ (select varchar from main.all_types limit 1 offset 2)
                  )
          on (EXISTS (
              select  
                  subq_3.c2 as c0, 
                  sample_8.varint as c1, 
                  ref_7.bool as c2, 
                  sample_7.bool as c3, 
                  sample_8.dec38_10 as c4, 
                  ref_6.dec_9_4 as c5, 
                  subq_3.c2 as c6, 
                  (select varchar_array from main.all_types limit 1 offset 2)
                     as c7
                from 
                  main.all_types as ref_7,
                  lateral (select  
                        ref_8.timestamp_ns as c0, 
                        sample_8.dec38_10 as c1, 
                        ref_7.timestamptz_array as c2, 
                        ref_6.varchar as c3, 
                        sample_7.double_array as c4
                      from 
                        main.all_types as ref_8
                      where cast(null as t[]) @> cast(null as t[])
                      limit 78) as subq_3
                where subq_3.c3 ~~ cast(null as varchar)
                limit 99))
        inner join main.all_types as ref_9
        on (cast(null as t[]) <@ cast(null as t[]))
      on (current_schema() ^@ ref_6.varchar)
  where (1) 
    or ((array_where(
          cast(array_where(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) as t[]),
          cast(case when sample_6.varchar !~~* sample_6.varchar then cast(null as t[]) else cast(null as t[]) end
             as t[])) <@ cast(nullif(cast(null as t[]),
          cast(null as t[])) as t[])) 
      and (cast(null as varchar) !~~ sample_7.varchar))), 

jennifer_4 AS (select  
    ref_10.fixed_array_of_int_list as c0, 
    __internal_compress_integral_utinyint(
      cast(ref_10.hugeint as hugeint),
      cast(ref_10.hugeint as hugeint)) as c1, 
    sample_9.uint as c2
  from 
    main.all_types as ref_10
        inner join main.all_types as ref_11
        on (0)
      inner join main.all_types as sample_9 tablesample system (6.8) 
      on ((ref_10.varchar ~~* ref_10.varchar) 
          and (cast(null as t[]) @> cast(null as t[])))
  where (current_schema() !~~* sample_9.varchar) 
    and (sample_9.uhugeint is NULL)
  limit 149), 

jennifer_5 AS (select  
    subq_4.c2 as c0, 
    subq_4.c2 as c1, 
    subq_4.c2 as c2, 
    subq_4.c1 as c3
  from 
    (select  
          ref_12.uhugeint as c0, 
          ref_12.timestamp_array as c1, 
          ref_12.double_array as c2
        from 
          main.all_types as ref_12
        where ref_12.varchar ~~* cast(null as varchar)
        limit 147) as subq_4
  where (icu_collate_en(
        cast((select varchar from main.all_types limit 1 offset 5)
           as varchar)) ~~ (select varchar from main.all_types limit 1 offset 2)
        ) 
    or (0)
  limit 60), 

jennifer_6 AS (select  
    to_json() as c0, 
    sample_14.fixed_struct_array as c1, 
    ref_16.blob as c2, 
    ref_19.timestamp_ms as c3, 
    ref_16.hugeint as c4
  from 
    main.all_types as ref_13
          right join main.all_types as sample_10 tablesample system (8.9) 
            inner join main.all_types as ref_14
              inner join main.all_types as sample_11 tablesample bernoulli (5.9) 
              on (ref_14.varchar ~~* ref_14.varchar)
            on (ref_14.tinyint is NULL)
          on (1)
        right join main.all_types as ref_15
          inner join main.all_types as sample_12 tablesample bernoulli (0.9) 
            right join main.all_types as ref_16
              left join main.all_types as ref_17
                  inner join main.all_types as ref_18
                  on (ref_17.timestamp_s = ref_18.timestamp_s )
                inner join main.all_types as ref_19
                on (0)
              on (ref_16.bigint = ref_17.bigint )
            on (sample_12.ubigint = ref_17.ubigint )
          on (ref_19.varchar ~~* ref_15.varchar)
        on (sample_12.varchar !~~ ref_15.varchar)
      inner join main.all_types as ref_20
            inner join main.all_types as sample_13 tablesample system (8.7) 
                left join main.all_types as sample_14 tablesample system (7.5) 
                on (sample_13.varchar !~~ sample_13.varchar)
              right join main.all_types as ref_21
              on (cast(null as t[]) @> cast(null as t[]))
            on ((cast(null as t[]) && cast(null as t[])) 
                or (sample_14.map is NULL))
          inner join main.all_types as ref_22
          on ((select double from main.all_types limit 1 offset 64)
                 is NULL)
        inner join main.all_types as sample_15 tablesample system (2.1) 
        on ((sample_13.varchar ~~~ ref_20.varchar) 
            or (sample_14.varchar ~~~ ref_21.varchar))
      on ((ref_19.varchar ^@ ref_21.varchar) 
          or ((ref_21.interval is not NULL) 
            or (ref_15.varchar ~~~ sample_12.varchar)))
  where list_where(
      cast(case when cast(null as t[]) && list_distinct(
            cast(cast(null as t[]) as t[])) then case when sample_15.varchar ~~* ref_21.varchar then cast(null as t[]) else cast(null as t[]) end
           else case when sample_15.varchar ~~* ref_21.varchar then cast(null as t[]) else cast(null as t[]) end
           end
         as t[]),
      cast(cast(null as t[]) as t[])) @> case when (1) 
        and (1) then cast(null as t[]) else cast(null as t[]) end
      ), 

jennifer_7 AS (select  
    subq_5.c0 as c0, 
    array_value() as c1, 
    add() as c2, 
    subq_5.c2 as c3, 
    subq_5.c3 as c4, 
    case when 
          list(
            cast(cast(null as t) as t)) over (partition by subq_5.c2 order by subq_5.c3) && cast(null as t[]) then case when case when subq_5.c3 is not NULL then cast(null as varchar) else cast(null as varchar) end
             !~~ icu_collate_kl(
            cast((select varchar from main.all_types limit 1 offset 62)
               as varchar)) then subq_5.c2 else subq_5.c2 end
         else case when case when subq_5.c3 is not NULL then cast(null as varchar) else cast(null as varchar) end
             !~~ icu_collate_kl(
            cast((select varchar from main.all_types limit 1 offset 62)
               as varchar)) then subq_5.c2 else subq_5.c2 end
         end
       as c5
  from 
    (select  
          20 as c0, 
          (select uuid from main.all_types limit 1 offset 2)
             as c1, 
          ref_23.timestamp_s as c2, 
          ref_23.bigint as c3
        from 
          main.all_types as ref_23
        where (0) 
          or ((ref_23.varchar ~~* ref_23.varchar) 
            or (cast(null as varchar) !~~ ref_23.varchar))) as subq_5
  where EXISTS (
    select  
        (select bit_xor(bigint) from main.all_types)
           as c0, 
        ref_24.ubigint as c1, 
        subq_5.c1 as c2, 
        sample_16.date_array as c3, 
        sample_16.time_tz as c4, 
        ref_24.timestamp_tz as c5
      from 
        main.all_types as sample_16 tablesample system (6) 
            right join main.all_types as sample_17 tablesample system (4.7) 
            on (sample_16.array_of_structs = sample_17.array_of_structs )
          inner join main.all_types as ref_24
          on (sample_16.timestamp_s = ref_24.timestamp_s )
      where case when 1 then sample_17.varchar else sample_17.varchar end
           !~~ ref_24.varchar
      limit 94)
  limit 153), 

jennifer_8 AS (select  
    sample_19.ubigint as c0, 
    round(
      cast(sample_19.smallint as smallint)) as c1, 
    
      min_by(
        cast(version() as varchar),
        cast(sample_19.varchar as varchar)) over (partition by sample_19.nested_int_array,sample_19.uint order by sample_18.map) as c2
  from 
    main.all_types as sample_18 tablesample system (2.8) 
      right join main.all_types as sample_19 tablesample system (2.6) 
      on (sample_18.smallint is not NULL)
  where 0)
select  
    subq_6.c0 as c0, 
    subq_6.c1 as c1
  from 
    (select  
          sample_20.uhugeint as c0, 
          case when sample_20.varchar ~~ sample_20.varchar then sample_20.array_of_structs else sample_20.array_of_structs end
             as c1
        from 
          main.all_types as sample_20 tablesample system (4.1) 
        where sample_20.varchar is not NULL
        limit 178) as subq_6,
    lateral (select  
          sample_21.float as c0, 
          ref_25.c0 as c1
        from 
          main.all_types as sample_21 tablesample bernoulli (1.9) 
            left join jennifer_0 as ref_25
            on (EXISTS (
                select  
                    subq_7.c12 as c0, 
                    (select timestamp_ms from main.all_types limit 1 offset 1)
                       as c1, 
                    subq_7.c9 as c2, 
                    sample_21.timestamp_array as c3, 
                    ref_25.c4 as c4, 
                    sample_21.timestamp_s as c5
                  from 
                    jennifer_0 as ref_26,
                    lateral (select  
                          sample_22.date as c0, 
                          subq_6.c1 as c1, 
                          subq_6.c0 as c2, 
                          ref_25.c0 as c3, 
                          ref_26.c7 as c4, 
                          subq_6.c0 as c5, 
                          ref_26.c5 as c6, 
                          subq_6.c0 as c7, 
                          sample_21.timestamptz_array as c8, 
                          subq_6.c0 as c9, 
                          sample_21.dec_9_4 as c10, 
                          (select utinyint from main.all_types limit 1 offset 2)
                             as c11, 
                          sample_21.fixed_varchar_array as c12, 
                          sample_22.nested_int_array as c13, 
                          sample_21.fixed_nested_varchar_array as c14
                        from 
                          main.all_types as sample_22 tablesample system (9.2) 
                        where cast(null as t[]) <@ cast(null as t[])
                        limit 143) as subq_7
                  where sample_21.time is not NULL
                  limit 99))
        where case when sample_21.varchar ~~* sample_21.varchar then cast(null as t[]) else cast(null as t[]) end
             && case when (1) 
              and ((cast(null as t[]) && cast(null as t[])) 
                and (cast(null as t[]) <@ cast(null as t[]))) then cast(null as t[]) else cast(null as t[]) end
            
        limit 102) as subq_8
  where cast(null as varchar) ~~ (select varchar from main.all_types limit 1 offset 5)
      
  limit 135;
select  
  sample_0.blob as c0, 
  (select varchar from main.all_types limit 1 offset 6)
     as c1, 
  sample_0.dec_18_6 as c2, 
  cast(coalesce(sample_0.tinyint,
    sample_0.tinyint) as tinyint) as c3, 
  
    approx_quantile(
      cast(sample_0.timestamp_tz as timestamp with time zone),
      cast(sample_0.timestamp_tz as timestamp with time zone)) over (partition by sample_0.uhugeint order by sample_0.nested_int_array) as c4, 
  sample_0.fixed_nested_varchar_array as c5
from 
  main.all_types as sample_0 tablesample system (6) 
where sample_0.varchar ~~* sample_0.varchar;
select  
  subq_0.c3 as c0, 
  (select fixed_nested_int_array from main.all_types limit 1 offset 6)
     as c1, 
  subq_0.c1 as c2, 
  subq_0.c5 as c3, 
  subq_0.c8 as c4, 
  (select union from main.all_types limit 1 offset 6)
     as c5, 
  subq_0.c10 as c6
from 
  (select  
        96 as c0, 
        sample_0.int_array as c1, 
        sample_0.timestamptz_array as c2, 
        sample_0.smallint as c3, 
        sample_0.dec_4_1 as c4, 
        sample_0.bool as c5, 
        sample_0.array_of_structs as c6, 
        sample_0.uhugeint as c7, 
        sample_0.varint as c8, 
        sample_0.ubigint as c9, 
        sample_0.usmallint as c10
      from 
        main.all_types as sample_0 tablesample bernoulli (6) 
      where array_select(
          cast(cast(coalesce(cast(null as t[]),
            cast(null as t[])) as t[]) as t[]),
          cast(case when sample_0.varchar ~~~ sample_0.varchar then cast(null as t[]) else cast(null as t[]) end
             as t[])) @> cast(null as t[])
      limit 165) as subq_0
where current_database() !~~* current_database()
limit 127;
select  
  (select uint from main.all_types limit 1 offset 6)
     as c0, 
  subq_0.c1 as c1, 
  sample_0.utinyint as c2, 
  subq_0.c5 as c3, 
  subq_0.c3 as c4, 
  subq_1.c1 as c5, 
  subq_0.c0 as c6, 
  
    arg_min_null(
      cast(cast(coalesce(cast(null as decimal),
        cast(coalesce(cast(null as decimal),
          cast(null as decimal)) as decimal)) as decimal) as decimal),
      cast(ceiling(
        cast(cast(null as decimal) as decimal)) as decimal)) over (partition by sample_0.struct_of_arrays,subq_1.c1 order by sample_0.timestamp_ms) as c7, 
  cast(nullif(sample_0.union,
    subq_0.c1) as union("name" varchar, age smallint)) as c8, 
  case when (0) 
      and (sample_0.varchar !~~ sample_0.varchar) then case when (
            array_agg(
              cast(cast(null as t) as t)) over (partition by subq_0.c0 order by subq_0.c6) && cast(null as t[])) 
        and (cast(null as varchar) ~~* sample_0.varchar) then subq_0.c2 else subq_0.c2 end
       else case when (
            array_agg(
              cast(cast(null as t) as t)) over (partition by subq_0.c0 order by subq_0.c6) && cast(null as t[])) 
        and (cast(null as varchar) ~~* sample_0.varchar) then subq_0.c2 else subq_0.c2 end
       end
     as c9, 
  subq_0.c6 as c10, 
  sample_0.fixed_array_of_int_list as c11, 
  cast(nullif(subq_0.c4,
    sample_0.struct_of_fixed_array) as struct(a integer[3], b varchar[3])) as c12, 
  subq_1.c0 as c13, 
  (select smallint from main.all_types limit 1 offset 3)
     as c14, 
  subq_1.c0 as c15
from 
  (select  
          (select usmallint from main.all_types limit 1 offset 4)
             as c0, 
          ref_0.union as c1, 
          89 as c2, 
          case when cast(null as t[]) @> cast(null as t[]) then ref_0.interval else ref_0.interval end
             as c3, 
          ref_0.struct_of_fixed_array as c4, 
          ref_0.utinyint as c5, 
          ref_0.array_of_structs as c6
        from 
          main.all_types as ref_0
        where ref_0.varchar ^@ ref_0.varchar
        limit 158) as subq_0
    right join main.all_types as sample_0 tablesample system (0.6) 
    on (subq_0.c0 = sample_0.usmallint ),
  lateral (select  
        subq_0.c6 as c0, 
        sample_0.array_of_structs as c1
      from 
        main.all_types as sample_1 tablesample system (5.3) 
      where ((sample_0.varchar ^@ sample_1.varchar) 
          or (((cast(null as t[]) && cast(null as t[])) 
              and ((((sample_0.varchar !~~* sample_0.varchar) 
                    and (0)) 
                  and (((cast(null as t[]) <@ cast(null as t[])) 
                      or (0)) 
                    or (1))) 
                or ((0) 
                  and ((1) 
                    and ((sample_0.date is NULL) 
                      and (cast(null as t[]) && cast(null as t[]))))))) 
            or (sample_0.varchar ^@ sample_1.varchar))) 
        and (sample_0.varchar ~~~ sample_0.varchar)) as subq_1
where cast(coalesce(sample_0.varchar,
    sample_0.varchar) as varchar) !~~ sample_0.varchar;
select  
  subq_1.c2 as c0, 
  subq_1.c2 as c1, 
  subq_1.c0 as c2, 
  subq_1.c2 as c3, 
  subq_1.c0 as c4, 
  case when (cast(null as varchar) ^@ case when ((select varchar from main.all_types limit 1 offset 11)
                 ~~* (select varchar from main.all_types limit 1 offset 1)
                ) 
            and ((cast(null as varchar) ^@ cast(null as varchar)) 
              or ((cast(null as t[]) && cast(null as t[])) 
                and (1))) then case when 0 then (select varchar from main.all_types limit 1 offset 1)
               else (select varchar from main.all_types limit 1 offset 1)
               end
             else case when 0 then (select varchar from main.all_types limit 1 offset 1)
               else (select varchar from main.all_types limit 1 offset 1)
               end
             end
          ) 
      or (1) then subq_1.c0 else subq_1.c0 end
     as c5, 
  case when ((select varchar from main.all_types limit 1 offset 6)
           !~~* 
          arg_max(
            cast((select varchar from main.all_types limit 1 offset 2)
               as varchar),
            cast(cast(null as varchar) as varchar)) over (partition by subq_1.c0 order by subq_1.c1)) 
      and (case when ((select varchar from main.all_types limit 1 offset 4)
                 ~~ (select varchar from main.all_types limit 1 offset 5)
                ) 
            and (EXISTS (
              select  
                  subq_1.c2 as c0, 
                  sample_1.struct as c1
                from 
                  main.all_types as sample_1 tablesample system (4.2) 
                where 0
                limit 120)) then cast(null as t[]) else cast(null as t[]) end
           @> cast(coalesce(cast(null as t[]),
          cast(null as t[])) as t[])) then subq_1.c0 else subq_1.c0 end
     as c6, 
  cast(nullif(subq_1.c1,
    subq_1.c1) as double[]) as c7, 
  subq_1.c0 as c8, 
  cast(nullif(subq_1.c2,
    subq_1.c2) as timestamp with time zone[]) as c9, 
  json_object() as c10, 
  today() as c11
from 
  (select  
        subq_0.c4 as c0, 
        subq_0.c4 as c1, 
        subq_0.c5 as c2
      from 
        (select  
              sample_0.uint as c0, 
              sample_0.timestamp_ns as c1, 
              sample_0.dec_9_4 as c2, 
              (select timestamptz_array from main.all_types limit 1 offset 5)
                 as c3, 
              sample_0.double_array as c4, 
              sample_0.timestamptz_array as c5, 
              sample_0.fixed_nested_varchar_array as c6
            from 
              main.all_types as sample_0 tablesample system (1.5) 
            where ((sample_0.timestamp_array is not NULL) 
                and (cast(null as t[]) && cast(null as t[]))) 
              and (sample_0.varchar ~~* sample_0.varchar)
            limit 79) as subq_0
      where (cast(null as t[]) <@ cast(null as t[])) 
        or ((select varchar from main.all_types limit 1 offset 1)
             ~~~ (select varchar from main.all_types limit 1 offset 4)
            )
      limit 182) as subq_1
where cast(coalesce(cast(null as varchar),
    (select varchar from main.all_types limit 1 offset 1)
      ) as varchar) ^@ (select varchar from main.all_types limit 1 offset 3);
update main.all_types set 
  tinyint = main.all_types.tinyint, 
  smallint = main.all_types.smallint, 
  int = main.all_types.int, 
  bigint = main.all_types.bigint, 
  hugeint = add(
    cast(main.all_types.hugeint as hugeint),
    cast(main.all_types.hugeint as hugeint)), 
  usmallint = main.all_types.usmallint, 
  uint = subtract(
    cast(main.all_types.uint as uinteger),
    cast(main.all_types.uint as uinteger)), 
  timestamp = case when (main.all_types.fixed_int_array is not NULL) 
      or (array_select(
          cast(case when cast(null as varchar) ~~ main.all_types.varchar then cast(null as t[]) else cast(null as t[]) end
             as t[]),
          cast(cast(null as t[]) as t[])) <@ case when main.all_types.varchar ~~ main.all_types.varchar then array_where(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) else array_where(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) end
          ) then main.all_types.timestamp else main.all_types.timestamp end
    , 
  timestamp_s = main.all_types.timestamp_s, 
  timestamp_ms = main.all_types.timestamp_ms, 
  timestamp_ns = main.all_types.timestamp_ns, 
  timestamp_tz = main.all_types.timestamp_tz, 
  float = (select float from main.all_types limit 1 offset 5)
    , 
  dec_4_1 = main.all_types.dec_4_1, 
  dec_9_4 = case when main.all_types.varchar !~~ main.all_types.varchar then case when main.all_types.list_of_fixed_int_array is not NULL then main.all_types.dec_9_4 else main.all_types.dec_9_4 end
       else case when main.all_types.list_of_fixed_int_array is not NULL then main.all_types.dec_9_4 else main.all_types.dec_9_4 end
       end
    , 
  dec38_10 = main.all_types.dec38_10, 
  blob = main.all_types.blob, 
  bit = main.all_types.bit, 
  timestamp_array = cast(nullif((select timestamp_array from main.all_types limit 1 offset 5)
      ,
    main.all_types.timestamp_array) as timestamp[]), 
  varchar_array = case when main.all_types.varchar !~~ main.all_types.varchar then main.all_types.varchar_array else main.all_types.varchar_array end
    , 
  nested_int_array = main.all_types.nested_int_array, 
  struct_of_arrays = main.all_types.struct_of_arrays, 
  array_of_structs = cast(null as struct(a integer, b varchar)[]), 
  map = main.all_types.map, 
  fixed_varchar_array = main.all_types.fixed_varchar_array, 
  fixed_nested_int_array = main.all_types.fixed_nested_int_array, 
  fixed_nested_varchar_array = main.all_types.fixed_nested_varchar_array, 
  fixed_struct_array = main.all_types.fixed_struct_array, 
  fixed_array_of_int_list = main.all_types.fixed_array_of_int_list, 
  list_of_fixed_int_array = main.all_types.list_of_fixed_int_array
returning 
  main.all_types.timestamp_array as c0, 
  (select fixed_nested_int_array from main.all_types limit 1 offset 5)
     as c1, 
  main.all_types.timestamp_tz as c2, 
  cast(nullif(main.all_types.fixed_int_array,
    main.all_types.fixed_int_array) as integer[3]) as c3, 
  cast(nullif(main.all_types.bit,
    main.all_types.bit) as bit) as c4, 
  main.all_types.varchar_array as c5;
select  
  sample_0.dec_18_6 as c0, 
  sample_0.map as c1, 
  replace(
    cast(sample_0.varchar as varchar),
    cast(
      argmax(
        cast(sample_0.varchar as varchar),
        cast(sample_0.varchar as varchar)) over (partition by sample_0.hugeint,sample_0.smallint order by sample_0.struct) as varchar),
    cast(sample_0.varchar as varchar)) as c2
from 
  main.all_types as sample_0 tablesample system (7.7) 
where bin(
    cast(sample_0.bigint as bigint)) !~~* md5(
    cast(sample_0.blob as blob))
limit 108;
select  
  sample_0.bool as c0, 
  sample_0.union as c1, 
  
    arg_min_null(
      cast(transaction_timestamp() as timestamp with time zone),
      cast(sample_0.timestamp_tz as timestamp with time zone)) over (partition by sample_0.timestamp_s,sample_0.int_array,sample_0.union,sample_0.list_of_fixed_int_array,sample_0.fixed_int_array order by sample_0.hugeint) as c2
from 
  main.all_types as sample_0 tablesample system (6.4) 
where EXISTS (
  select  
      96 as c0, 
      sample_0.struct as c1, 
      sample_0.bigint as c2
    from 
      (select  
            sample_1.struct as c0
          from 
            main.all_types as ref_0
              right join main.all_types as sample_1 tablesample system (1.5) 
              on (ref_0.varchar !~~ sample_1.varchar),
            lateral (select  
                  ref_1.fixed_nested_int_array as c0, 
                  (select dec_9_4 from main.all_types limit 1 offset 1)
                     as c1, 
                  sample_0.dec_18_6 as c2, 
                  sample_1.fixed_nested_int_array as c3, 
                  ref_0.array_of_structs as c4, 
                  ref_1.struct_of_arrays as c5, 
                  sample_1.struct_of_fixed_array as c6, 
                  ref_0.nested_int_array as c7, 
                  sample_1.time_tz as c8, 
                  ref_0.uhugeint as c9, 
                  ref_1.struct as c10, 
                  ref_1.fixed_array_of_int_list as c11, 
                  ref_0.union as c12, 
                  ref_0.uhugeint as c13, 
                  ref_1.time_tz as c14, 
                  sample_0.usmallint as c15, 
                  sample_1.dec38_10 as c16, 
                  ref_1.blob as c17, 
                  ref_1.smallint as c18
                from 
                  main.all_types as ref_1
                where 1
                limit 120) as subq_0
          where (ref_0.varchar !~~* sample_1.varchar) 
            or (sample_0.varchar !~~ sample_0.varchar)) as subq_1
    where list_select(
        cast(array_select(
          cast(case when 0 then cast(null as t[]) else cast(null as t[]) end
             as t[]),
          cast(cast(null as t[]) as t[])) as t[]),
        cast(cast(nullif(case when sample_0.varchar !~~ sample_0.varchar then cast(null as t[]) else cast(null as t[]) end
            ,
          case when sample_0.varchar ~~ sample_0.varchar then cast(null as t[]) else cast(null as t[]) end
            ) as t[]) as t[])) @> array_select(
        cast(list_distinct(
          cast(cast(null as t[]) as t[])) as t[]),
        cast(list_value(
          cast(cast(null as t) as t)) as t[])));
select  
  cast(nullif(subq_4.c0,
    sample_0.double) as double) as c0, 
  sample_0.timestamp_ns as c1, 
  subq_0.c0 as c2, 
  subq_1.c5 as c3, 
  case when sample_1.varchar ~~ sample_0.varchar then subq_4.c0 else subq_4.c0 end
     as c4, 
  sample_0.int_array as c5, 
  transaction_timestamp() as c6, 
  subq_0.c0 as c7
from 
  main.all_types as sample_0 tablesample system (2.8) 
      inner join main.all_types as sample_1 tablesample system (0.5) 
      on (sample_1.varchar !~~* sample_0.varchar)
    inner join (select  
            sample_2.ubigint as c0
          from 
            main.all_types as sample_2 tablesample system (2) 
          where (sample_2.varchar !~~ sample_2.varchar) 
            or (sample_2.union is NULL)
          limit 175) as subq_0
      right join (select  
            sample_3.timestamp as c0, 
            sample_3.usmallint as c1, 
            sample_3.struct_of_fixed_array as c2, 
            sample_3.time_tz as c3, 
            sample_3.double_array as c4, 
            sample_3.dec38_10 as c5, 
            23 as c6, 
            44 as c7, 
            sample_3.struct_of_arrays as c8, 
            sample_3.varchar_array as c9, 
            sample_3.fixed_int_array as c10, 
            sample_3.smallint as c11
          from 
            main.all_types as sample_3 tablesample system (6.7) 
          where (sample_3.varchar ~~* sample_3.varchar) 
            and (sample_3.varchar !~~ sample_3.varchar)) as subq_1
      on (((select varchar from main.all_types limit 1 offset 17)
               ~~* cast(null as varchar)) 
          and ((select varchar from main.all_types limit 1 offset 3)
               ^@ cast(null as varchar)))
    on (sample_0.varchar ~~ (select varchar from main.all_types limit 1 offset 1)
          ),
  lateral (select  
        (select avg(smallint) from main.all_types)
           as c0, 
        subq_1.c6 as c1, 
        10 as c2, 
        sample_0.hugeint as c3
      from 
        main.all_types as sample_4 tablesample bernoulli (1.2) ,
        lateral (select  
              subq_1.c1 as c0, 
              subq_1.c0 as c1, 
              sample_0.timestamp_array as c2, 
              (select double_array from main.all_types limit 1 offset 2)
                 as c3
            from 
              main.all_types as sample_5 tablesample system (4.1) 
            where sample_0.varchar ~~~ sample_4.varchar
            limit 36) as subq_2,
        lateral (select  
              sample_0.fixed_struct_array as c0
            from 
              main.all_types as sample_6 tablesample bernoulli (5.7) 
                right join main.all_types as sample_7 tablesample bernoulli (4.6) 
                on (cast(null as t[]) @> cast(null as t[]))
            where EXISTS (
              select  
                  (select double from main.all_types limit 1 offset 2)
                     as c0, 
                  subq_2.c3 as c1, 
                  sample_1.fixed_int_array as c2, 
                  sample_7.float as c3, 
                  subq_2.c0 as c4
                from 
                  main.all_types as sample_8 tablesample bernoulli (5.7) 
                where (((sample_1.varchar ~~* sample_7.varchar) 
                      and (sample_1.varchar !~~* sample_7.varchar)) 
                    and (subq_0.c0 is NULL)) 
                  or (sample_7.varchar ~~ sample_6.varchar))
            limit 29) as subq_3
      where cast(nullif(cast(null as t[]),
          cast(null as t[])) as t[]) <@ repeat(
          cast(case when (sample_0.varchar ~~~ (select varchar from main.all_types limit 1 offset 5)
                  ) 
              or (subq_3.c0 is not NULL) then cast(null as t[]) else cast(null as t[]) end
             as t[]),
          cast(cast(null as t[]) as t[]))) as subq_4
where map_concat() is not NULL
limit 102;
select  
  subq_1.c1 as c0, 
  current_localtime() as c1, 
  subq_0.c1 as c2, 
  subq_0.c1 as c3, 
  subq_0.c1 as c4, 
  struct_concat() as c5, 
  case when EXISTS (
      select  
          sample_4.nested_int_array as c0, 
          subq_3.c2 as c1, 
          sample_4.uint as c2, 
          subq_1.c1 as c3, 
          subq_0.c0 as c4, 
          subq_3.c3 as c5, 
          sample_4.interval as c6, 
          subq_1.c0 as c7, 
          (select ubigint from main.all_types limit 1 offset 100)
             as c8
        from 
          main.all_types as sample_4 tablesample system (3.8) ,
          lateral (select  
                ref_0.fixed_int_array as c0, 
                sample_4.fixed_nested_varchar_array as c1, 
                sample_4.dec38_10 as c2, 
                subq_1.c0 as c3
              from 
                main.all_types as ref_0,
                lateral (select  
                      sample_5.utinyint as c0, 
                      subq_0.c1 as c1, 
                      subq_0.c0 as c2, 
                      subq_1.c0 as c3, 
                      ref_0.dec_18_6 as c4, 
                      (select map from main.all_types limit 1 offset 2)
                         as c5, 
                      ref_0.int_array as c6, 
                      subq_1.c2 as c7, 
                      subq_0.c0 as c8, 
                      ref_0.struct_of_fixed_array as c9
                    from 
                      main.all_types as sample_5 tablesample system (3.9) 
                    where ref_0.timestamp is not NULL
                    limit 59) as subq_2
              where subq_0.c1 is NULL
              limit 119) as subq_3
        where 0) then get_current_time() else get_current_time() end
     as c6, 
  subq_0.c0 as c7, 
  subq_1.c0 as c8, 
  abs(
    cast((select utinyint from main.all_types limit 1 offset 2)
       as utinyint)) as c9, 
  subq_1.c1 as c10, 
  to_millennia(
    cast(case when (select varchar from main.all_types limit 1 offset 37)
           !~~ subq_1.c0 then 
        arg_max(
          cast((select int from main.all_types limit 1 offset 63)
             as integer),
          cast((select int from main.all_types limit 1 offset 5)
             as integer)) over (partition by subq_0.c1 order by subq_0.c1) else 
        arg_max(
          cast((select int from main.all_types limit 1 offset 63)
             as integer),
          cast((select int from main.all_types limit 1 offset 5)
             as integer)) over (partition by subq_0.c1 order by subq_0.c1) end
       as integer)) as c11, 
  (select struct_of_arrays from main.all_types limit 1 offset 6)
     as c12, 
  subq_0.c1 as c13, 
  subq_0.c1 as c14, 
  subq_0.c1 as c15, 
  subq_1.c2 as c16, 
  subq_1.c0 as c17, 
  subq_0.c1 as c18, 
  subq_1.c1 as c19, 
  subq_1.c0 as c20, 
  current_schema() as c21, 
  subq_0.c0 as c22, 
  subq_0.c0 as c23, 
  case when (subq_1.c0 ~~* subq_1.c0) 
      and ((cast(null as t[]) <@ cast(null as t[])) 
        or (subq_1.c0 ~~ subq_1.c0)) then subq_0.c1 else subq_0.c1 end
     as c24, 
  subq_0.c0 as c25, 
  cast(coalesce(subq_1.c0,
    subq_1.c0) as varchar) as c26, 
  subq_0.c1 as c27, 
  subq_0.c0 as c28, 
  subq_0.c0 as c29, 
  subq_0.c1 as c30, 
  subq_0.c1 as c31, 
  subq_1.c3 as c32
from 
  (select  
        sample_0.bigint as c0, 
        sample_0.double as c1
      from 
        main.all_types as sample_0 tablesample system (2.6) 
      where sample_0.varchar ~~ sample_0.varchar) as subq_0,
  lateral (select  
        sample_2.varchar as c0, 
        sample_1.timestamp_ms as c1, 
        cast(coalesce((select array_of_structs from main.all_types limit 1 offset 3)
            ,
          sample_2.array_of_structs) as struct(a integer, b varchar)[]) as c2, 
        sample_1.fixed_struct_array as c3
      from 
        main.all_types as sample_1 tablesample bernoulli (8.6) 
            inner join main.all_types as sample_2 tablesample bernoulli (9.3) 
            on ((sample_2.varchar ~~* sample_2.varchar) 
                or (sample_2.varchar ^@ sample_1.varchar))
          left join main.all_types as sample_3 tablesample bernoulli (2.2) 
          on ((select varchar from main.all_types limit 1 offset 5)
                 ^@ sample_1.varchar)
      where sample_1.varchar !~~ cast(null as varchar)) as subq_1
where cast(null as varchar) ^@ current_database();
select  
  current_database() as c0, 
  (select int_array from main.all_types limit 1 offset 1)
     as c1, 
  ref_0.struct as c2
from 
  main.all_types as sample_0 tablesample system (0.7) 
      inner join main.all_types as ref_0
          left join main.all_types as ref_1
          on (ref_0.bigint is not NULL)
        inner join (select  
              ref_2.fixed_struct_array as c0, 
              ref_2.dec_9_4 as c1, 
              ref_2.date as c2, 
              ref_2.interval as c3
            from 
              main.all_types as ref_2
            where cast(null as t[]) && cast(null as t[])
            limit 91) as subq_0
        on (ref_1.varchar ~~ ref_1.varchar)
      on (sample_0.interval is not NULL)
    inner join main.all_types as ref_3
    on (subq_0.c0 = ref_3.fixed_struct_array )
where 0
limit 144;
select  
  cast(coalesce(ref_3.fixed_nested_int_array,
    ref_2.fixed_nested_int_array) as integer[3][3]) as c0, 
  case when unpivot_list() is not NULL then ref_2.fixed_varchar_array else ref_2.fixed_varchar_array end
     as c1, 
  ref_1.int_array as c2, 
  (select bool from main.all_types limit 1 offset 88)
     as c3
from 
  main.all_types as ref_0
    left join main.all_types as ref_1
        left join main.all_types as ref_2
        on (ref_1.smallint = ref_2.smallint )
      right join main.all_types as ref_3
      on (parse_dirpath(
            cast(ref_3.varchar as varchar)) !~~* ref_3.varchar)
    on ((select varchar from main.all_types limit 1 offset 5)
           !~~* (select varchar from main.all_types limit 1 offset 2)
          )
where cast(nullif(cast(null as t[]),
    array_distinct(
      cast(cast(null as t[]) as t[]))) as t[]) && cast(null as t[])
limit 103;
WITH 
jennifer_0 AS (select  
    subq_0.c0 as c0, 
    
      bitstring_agg(
        cast(sample_0.tinyint as tinyint)) over (partition by subq_0.c0,subq_0.c0,subq_0.c0 order by subq_0.c0) as c1, 
    76 as c2, 
    sample_0.array_of_structs as c3, 
    subq_0.c0 as c4, 
    22 as c5
  from 
    main.all_types as sample_0 tablesample bernoulli (6.5) 
      inner join (select  
            ref_0.ubigint as c0
          from 
            main.all_types as ref_0
          where cast(null as t[]) <@ cast(null as t[])
          limit 190) as subq_0
      on (subq_0.c0 is not NULL)
  where sample_0.varchar ~~* sample_0.varchar
  limit 115), 

jennifer_1 AS (select  
    ref_1.dec_9_4 as c0, 
    ref_1.nested_int_array as c1, 
    ref_1.uuid as c2, 
    ref_1.struct_of_fixed_array as c3, 
    ref_1.dec_18_6 as c4
  from 
    main.all_types as ref_1
  where case when ref_1.varchar ~~ ref_1.varchar then ref_1.fixed_varchar_array else ref_1.fixed_varchar_array end
       is not NULL
  limit 70), 

jennifer_2 AS (select  
    sample_2.dec_9_4 as c0, 
    sample_1.dec_4_1 as c1, 
    sample_1.float as c2, 
    sample_2.struct_of_fixed_array as c3, 
    sample_1.bit as c4, 
    sample_1.utinyint as c5, 
    current_schema() as c6, 
    sample_1.double_array as c7, 
    sample_1.blob as c8, 
    struct_pack() as c9, 
    sample_2.fixed_varchar_array as c10, 
    json_keys(
      cast(sample_2.varchar as varchar)) as c11, 
    (select usmallint from main.all_types limit 1 offset 1)
       as c12, 
    sample_2.nested_int_array as c13, 
    sample_1.nested_int_array as c14, 
    sample_1.ubigint as c15, 
    cast(nullif(sample_1.struct,
      sample_1.struct) as struct(a integer, b varchar)) as c16
  from 
    main.all_types as sample_1 tablesample system (4.6) 
      inner join main.all_types as sample_2 tablesample system (3) 
      on (1)
  where cast(coalesce(list_pack(
        cast(cast(null as t) as t)),
      cast(nullif(case when (EXISTS (
              select  
                  sample_2.time as c0, 
                  (select dec38_10 from main.all_types limit 1 offset 4)
                     as c1, 
                  sample_1.fixed_varchar_array as c2, 
                  subq_1.c0 as c3, 
                  sample_2.dec38_10 as c4, 
                  sample_3.nested_int_array as c5, 
                  sample_1.uhugeint as c6, 
                  sample_1.timestamp_ns as c7, 
                  sample_3.bool as c8
                from 
                  main.all_types as sample_3 tablesample bernoulli (2.8) ,
                  lateral (select  
                        sample_4.timestamp as c0
                      from 
                        main.all_types as sample_4 tablesample system (5.8) 
                      where (sample_4.varchar ~~ sample_1.varchar) 
                        and (sample_1.varchar ~~~ sample_4.varchar)) as subq_1
                where subq_1.c0 is NULL
                limit 154)) 
            or (sample_2.varchar ~~~ sample_1.varchar) then list_value(
            cast(cast(null as t) as t)) else list_value(
            cast(cast(null as t) as t)) end
          ,
        cast(null as t[])) as t[])) as t[]) && flatten(
      cast(cast(coalesce(cast(coalesce(case when sample_1.union is NULL then cast(null as t[][]) else cast(null as t[][]) end
            ,
          cast(null as t[][])) as t[][]),
        cast(null as t[][])) as t[][]) as t[][]))), 

jennifer_3 AS (select  
    subq_2.c0 as c0, 
    alias(
      cast(cast(null as any) as any)) as c1
  from 
    (select  
          6 as c0, 
          sample_5.fixed_array_of_int_list as c1, 
          sample_5.fixed_nested_int_array as c2, 
          sample_5.uint as c3, 
          sample_5.int as c4, 
          sample_5.fixed_varchar_array as c5, 
          sample_5.bool as c6, 
          sample_5.uhugeint as c7, 
          (select timestamp_tz from main.all_types limit 1 offset 4)
             as c8, 
          sample_5.dec_9_4 as c9
        from 
          main.all_types as sample_5 tablesample system (5.2) 
        where ((sample_5.float is not NULL) 
            and (sample_5.varchar ~~ sample_5.varchar)) 
          and (sample_5.interval is NULL)
        limit 110) as subq_2
  where (select varchar from main.all_types limit 1 offset 4)
       ~~* case when case when (select varchar from main.all_types limit 1 offset 4)
               !~~* cast(null as varchar) then (select varchar from main.all_types limit 1 offset 4)
             else (select varchar from main.all_types limit 1 offset 4)
             end
           !~~* (select varchar from main.all_types limit 1 offset 5)
           then cast(null as varchar) else cast(null as varchar) end
      ), 

jennifer_4 AS (select  
    sample_9.fixed_array_of_int_list as c0
  from 
    main.all_types as sample_6 tablesample system (0.2) 
          right join main.all_types as sample_7 tablesample bernoulli (0.4) 
          on ((sample_6.varchar ~~~ sample_7.varchar) 
              or ((sample_7.varchar ~~* sample_7.varchar) 
                and (sample_6.union is not NULL)))
        inner join main.all_types as sample_8 tablesample system (6.1) 
            inner join main.all_types as ref_2
            on (sample_8.timestamp_ns = ref_2.timestamp_ns )
          inner join main.all_types as sample_9 tablesample bernoulli (5) 
          on (cast(null as t[]) && cast(null as t[]))
        on (((1) 
              and ((cast(null as t[]) && cast(null as t[])) 
                and ((EXISTS (
                    select  
                        sample_10.list_of_fixed_int_array as c0, 
                        sample_9.int_array as c1, 
                        sample_6.fixed_varchar_array as c2, 
                        sample_10.date as c3, 
                        sample_9.dec38_10 as c4
                      from 
                        main.all_types as sample_10 tablesample system (8.6) 
                      where 1)) 
                  and ((((0) 
                        or (cast(null as t[]) <@ cast(null as t[]))) 
                      and (0)) 
                    or (sample_8.varchar !~~* sample_8.varchar))))) 
            or ((1) 
              or (EXISTS (
                select  
                    ref_3.dec38_10 as c0, 
                    sample_7.tinyint as c1, 
                    sample_7.fixed_varchar_array as c2, 
                    sample_7.float as c3, 
                    subq_3.c5 as c4, 
                    sample_7.timestamp_ns as c5, 
                    sample_9.hugeint as c6, 
                    (select date_array from main.all_types limit 1 offset 4)
                       as c7, 
                    ref_3.nested_int_array as c8, 
                    sample_7.uuid as c9, 
                    sample_6.bit as c10, 
                    sample_9.double_array as c11, 
                    ref_2.list_of_fixed_int_array as c12, 
                    sample_7.fixed_varchar_array as c13, 
                    ref_2.double as c14, 
                    ref_3.double_array as c15, 
                    sample_7.smallint as c16
                  from 
                    main.all_types as ref_3,
                    lateral (select  
                          sample_7.varchar_array as c0, 
                          sample_9.bit as c1, 
                          sample_11.float as c2, 
                          sample_7.interval as c3, 
                          sample_11.timestamp_s as c4, 
                          sample_8.interval as c5
                        from 
                          main.all_types as sample_11 tablesample system (0.3) 
                        where (cast(null as t[]) && cast(null as t[])) 
                          and (sample_9.varchar ~~* sample_9.varchar)
                        limit 153) as subq_3
                  where ref_3.varchar !~~* sample_8.varchar
                  limit 13))))
      right join (select  
            (select timestamptz_array from main.all_types limit 1 offset 6)
               as c0, 
            sample_12.nested_int_array as c1, 
            83 as c2, 
            sample_12.dec_9_4 as c3, 
            sample_12.struct_of_fixed_array as c4, 
            sample_12.varint as c5, 
            sample_12.union as c6, 
            sample_12.fixed_struct_array as c7, 
            15 as c8, 
            sample_12.double_array as c9, 
            sample_12.timestamp_s as c10, 
            sample_12.bool as c11, 
            sample_12.dec_18_6 as c12, 
            sample_12.bit as c13, 
            sample_12.timestamptz_array as c14
          from 
            main.all_types as sample_12 tablesample bernoulli (1.7) 
          where (cast(null as t[]) && cast(null as t[])) 
            or (sample_12.varchar ^@ sample_12.varchar)) as subq_4
      on (cast(null as t[]) && cast(null as t[]))
  where sample_7.varchar ~~ sample_6.varchar)
select  
    sample_13.timestamp_ms as c0, 
    
      count(*) over (partition by sample_13.float,sample_13.double,sample_13.map order by sample_13.list_of_fixed_int_array,sample_13.time_tz) as c1, 
    sample_13.interval as c2, 
    current_database() as c3
  from 
    main.all_types as sample_13 tablesample bernoulli (8.6) 
  where (sample_13.varchar is NULL) 
    and (cast(nullif((select fixed_nested_int_array from main.all_types limit 1 offset 90)
          ,
        sample_13.fixed_nested_int_array) as integer[3][3]) is NULL);
select  
  subq_1.c3 as c0, 
  subq_1.c2 as c1
from 
  (select  
        sample_0.varchar as c0, 
        subq_0.c2 as c1, 
        sample_0.uint as c2, 
        subq_0.c2 as c3
      from 
        main.all_types as sample_0 tablesample system (2.7) ,
        lateral (select  
              sample_0.timestamp_ms as c0, 
              51 as c1, 
              sample_1.uuid as c2
            from 
              main.all_types as sample_1 tablesample system (3.6) 
            where sample_0.varchar !~~ sample_0.varchar) as subq_0
      where (sample_0.varchar !~~* sample_0.varchar) 
        or (array_where(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) @> cast(nullif(cast(null as t[]),
            cast(null as t[])) as t[]))) as subq_1
where EXISTS (
  select  
      (select fixed_nested_varchar_array from main.all_types limit 1 offset 3)
         as c0, 
      subq_2.c4 as c1, 
      subq_1.c1 as c2, 
      subq_2.c2 as c3, 
      subq_2.c2 as c4
    from 
      (select  
            sample_2.uint as c0, 
            subq_1.c3 as c1, 
            subq_1.c1 as c2, 
            subq_1.c0 as c3, 
            sample_2.time as c4
          from 
            main.all_types as sample_2 tablesample system (1.1) 
          where (subq_1.c0 ~~ sample_2.varchar) 
            and ((subq_1.c0 is not NULL) 
              and (subq_1.c0 ~~ sample_2.varchar))
          limit 106) as subq_2
    where cast(nullif(subq_2.c3,
        subq_2.c3) as varchar) !~~* subq_1.c0
    limit 159)
limit 85;
select  
  98 as c0, 
  sample_1.varchar_array as c1, 
  sample_0.fixed_nested_int_array as c2, 
  sample_1.ubigint as c3, 
  sample_2.uint as c4, 
  millennium(
    cast(sample_0.timestamp as timestamp)) as c5, 
  (select uhugeint from main.all_types limit 1 offset 6)
     as c6, 
  cast(nullif(sample_1.union,
    cast(null as union("name" varchar, age smallint))) as union("name" varchar, age smallint)) as c7, 
  txid_current() as c8, 
  sample_1.timestamp_s as c9, 
  case when (EXISTS (
        select  
            sample_1.dec_9_4 as c0, 
            sample_1.bool as c1, 
            sample_2.double_array as c2, 
            sample_0.int as c3, 
            sample_3.timestamp_tz as c4, 
            sample_3.uhugeint as c5, 
            sample_4.uuid as c6, 
            sample_1.fixed_varchar_array as c7, 
            sample_2.fixed_nested_varchar_array as c8
          from 
            main.all_types as sample_3 tablesample system (1) 
              right join main.all_types as sample_4 tablesample bernoulli (8.5) 
              on (0)
          where (select varchar from main.all_types limit 1 offset 2)
               !~~* sample_0.varchar)) 
      a... (body of github issue is truncated)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions