Skip to content

Catalog Error: Type with name t does not exist! #4304

@fuzzerofducks

Description

@fuzzerofducks

Issue found by SQLSmith on git commit hash c8906 using seed 871056681.

To Reproduce

create table all_types as select * exclude(small_enum, medium_enum, large_enum) from test_all_types();
select  
  list_value() as c0, 
  sample_0.hugeint as c1, 
  case when cast(coalesce(sample_0.varchar,
        case when (sample_1.varchar ^@ (select varchar from main.all_types limit 1 offset 3)
                ) 
            and (sample_0.varchar ~~~ sample_0.varchar) then sample_0.varchar else sample_0.varchar end
          ) as varchar) ~~~ sample_1.varchar then sample_1.fixed_int_array else sample_1.fixed_int_array end
     as c2, 
  sample_1.fixed_varchar_array as c3, 
  sample_1.dec38_10 as c4, 
  sample_1.utinyint as c5, 
  sample_0.varchar_array as c6, 
  to_json() as c7, 
  sample_0.array_of_structs as c8, 
  sample_1.uint as c9, 
  array_value() as c10, 
  sample_1.union as c11, 
  sample_0.fixed_array_of_int_list as c12, 
  sample_1.timestamp_tz as c13, 
  sample_1.smallint as c14, 
  case when (cast(null as t[]) <@ cast(nullif(cast(null as t[]),
          cast(coalesce(cast(null as t[]),
            cast(null as t[])) as t[])) as t[])) 
      and (sample_0.varchar !~~ current_schema()) then sample_1.date_array else sample_1.date_array end
     as c15, 
  case when ((cast(null as t[]) @> 
            array_agg(
              cast(cast(null as t) as t)) over (partition by sample_1.struct_of_arrays,sample_1.fixed_nested_int_array,sample_0.fixed_int_array order by sample_1.hugeint)) 
        and (sample_1.bit is not NULL)) 
      or ((sample_0.varchar ~~* cast(coalesce(sample_1.varchar,
            sample_1.varchar) as varchar)) 
        or (sample_1.date_array is not NULL)) then sample_0.bit else sample_0.bit end
     as c16
from 
  main.all_types as sample_0 tablesample bernoulli (6.7) 
    inner join main.all_types as sample_1 tablesample system (0.5) 
    on (sample_0.union is NULL)
where list_where(
    cast(cast(null as t[]) as t[]),
    cast(case when sample_0.varchar !~~ cast(null as varchar) then array_distinct(
        cast(cast(null as t[]) as t[])) else array_distinct(
        cast(cast(null as t[]) as t[])) end
       as t[])) @> case when cast(coalesce(cast(null as t[]),
        cast(null as t[])) as t[]) <@ cast(null as t[]) then cast(coalesce(case when case when sample_0.varchar !~~* sample_0.varchar then cast(null as t[]) else cast(null as t[]) end
             @> cast(null as t[]) then case when sample_0.dec_18_6 is NULL then cast(null as t[]) else cast(null as t[]) end
           else case when sample_0.dec_18_6 is NULL then cast(null as t[]) else cast(null as t[]) end
           end
        ,
      list_pack(
        cast(case when (sample_0.dec38_10 is NULL) 
            and (sample_1.array_of_structs is NULL) then list_extract(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) else list_extract(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) end
           as t))) as t[]) else cast(coalesce(case when case when sample_0.varchar !~~* sample_0.varchar then cast(null as t[]) else cast(null as t[]) end
             @> cast(null as t[]) then case when sample_0.dec_18_6 is NULL then cast(null as t[]) else cast(null as t[]) end
           else case when sample_0.dec_18_6 is NULL then cast(null as t[]) else cast(null as t[]) end
           end
        ,
      list_pack(
        cast(case when (sample_0.dec38_10 is NULL) 
            and (sample_1.array_of_structs is NULL) then list_extract(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) else list_extract(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) end
           as t))) as t[]) end
    
limit 109;
select  
  sample_0.dec_9_4 as c0
from 
  main.all_types as sample_0 tablesample system (3.6) 
    right join main.all_types as sample_1 tablesample system (3.7) 
    on ((((sample_1.varchar ~~* sample_1.varchar) 
            and (sample_1.varchar !~~* sample_0.varchar)) 
          and (cast(null as t[]) @> cast(null as t[]))) 
        and ((cast(null as varchar) ^@ sample_1.varchar) 
          or (sample_0.struct_of_arrays is not NULL)))
where sample_0.varchar ~~ sample_1.varchar
limit 105;
select  
  sample_0.float as c0, 
  version() as c1, 
  sample_0.int_array as c2
from 
  main.all_types as sample_0 tablesample system (3.5) 
where EXISTS (
  select  
      subq_0.c0 as c0, 
      sample_0.timestamp_ms as c1, 
      subq_2.c17 as c2, 
      (select double from main.all_types limit 1 offset 2)
         as c3, 
      array_concat() as c4
    from 
      (select  
            sample_0.tinyint as c0
          from 
            main.all_types as ref_0
          where ref_0.varchar !~~* sample_0.varchar
          limit 111) as subq_0,
      lateral (select  
            subq_0.c0 as c0, 
            sample_0.timestamp as c1, 
            subq_0.c0 as c2, 
            sample_0.date as c3, 
            subq_0.c0 as c4, 
            subq_0.c0 as c5, 
            subq_1.c6 as c6, 
            sample_1.interval as c7, 
            sample_1.int as c8, 
            sample_1.time_tz as c9, 
            ref_1.int_array as c10, 
            ref_1.uhugeint as c11, 
            sample_1.int_array as c12, 
            subq_0.c0 as c13, 
            ref_1.timestamp_tz as c14, 
            ref_1.fixed_array_of_int_list as c15, 
            sample_0.timestamp_ns as c16, 
            subq_0.c0 as c17
          from 
            main.all_types as ref_1
              right join main.all_types as sample_1 tablesample bernoulli (1.1) 
              on (ref_1.varchar ~~~ sample_0.varchar),
            lateral (select  
                  ref_2.fixed_nested_int_array as c0, 
                  sample_1.struct_of_fixed_array as c1, 
                  ref_2.map as c2, 
                  64 as c3, 
                  ref_2.fixed_struct_array as c4, 
                  sample_1.double_array as c5, 
                  sample_0.array_of_structs as c6, 
                  subq_0.c0 as c7
                from 
                  main.all_types as ref_2
                where EXISTS (
                  select  
                      sample_1.struct as c0, 
                      ref_2.hugeint as c1, 
                      sample_1.bit as c2, 
                      subq_0.c0 as c3
                    from 
                      main.all_types as sample_2 tablesample system (1) 
                    where 1
                    limit 133)) as subq_1
          where cast(null as t[]) @> cast(null as t[])
          limit 134) as subq_2
    where version() is NULL)
limit 189;
select  
  subq_0.c8 as c0, 
  add() as c1, 
  case when ((0) 
        and ((0) 
          or ((1) 
            and ((cast(null as varchar) ^@ cast(null as varchar)) 
              and (((select varchar from main.all_types limit 1 offset 1)
                     ~~* (select varchar from main.all_types limit 1 offset 2)
                    ) 
                and (subq_0.c10 is NULL)))))) 
      or ((((cast(null as t[]) <@ cast(null as t[])) 
            and ((cast(null as varchar) !~~ (select varchar from main.all_types limit 1 offset 4)
                  ) 
              or (cast(null as varchar) ~~~ cast(null as varchar)))) 
          or (0)) 
        and (transaction_timestamp() is not NULL)) then subq_0.c3 else subq_0.c3 end
     as c2, 
  66 as c3, 
  to_json() as c4, 
  subq_0.c0 as c5, 
  subq_0.c2 as c6, 
  subq_0.c5 as c7, 
  subq_0.c1 as c8, 
  
    argmax(
      cast(cast(coalesce(cast(nullif((select timestamp_tz from main.all_types limit 1 offset 5)
            ,
          case when 0 then cast(null as timestamp with time zone) else cast(null as timestamp with time zone) end
            ) as timestamp with time zone),
        case when subq_0.c5 is NULL then cast(null as timestamp with time zone) else cast(null as timestamp with time zone) end
          ) as timestamp with time zone) as timestamp with time zone),
      cast(cast(null as timestamp with time zone) as timestamp with time zone)) over (partition by subq_0.c4 order by subq_0.c6) as c9, 
  
    arg_min(
      cast(cast(coalesce(cast(null as blob),
        unhex(
          cast((select varchar from main.all_types limit 1 offset 3)
             as varchar))) as blob) as blob),
      cast(case when subq_0.c4 is not NULL then unbin(
          cast(cast(null as varchar) as varchar)) else unbin(
          cast(cast(null as varchar) as varchar)) end
         as blob)) over (partition by subq_0.c2,subq_0.c9 order by subq_0.c6) as c10, 
  subq_0.c7 as c11, 
  subq_0.c10 as c12
from 
  (select  
        (select hugeint from main.all_types limit 1 offset 5)
           as c0, 
        sample_0.varchar_array as c1, 
        sample_0.timestamp_s as c2, 
        sample_0.dec_4_1 as c3, 
        sample_0.int_array as c4, 
        (select smallint from main.all_types limit 1 offset 6)
           as c5, 
        array_zip() as c6, 
        sample_0.fixed_nested_varchar_array as c7, 
        sample_0.interval as c8, 
        sample_0.time_tz as c9, 
        sample_0.varchar_array as c10, 
        sample_0.dec38_10 as c11
      from 
        main.all_types as sample_0 tablesample system (6.2) 
      where ((cast(null as t[]) && cast(null as t[])) 
          and (sample_0.varchar ^@ sample_0.varchar)) 
        and (list_value(
            cast(cast(null as t) as t)) && cast(null as t[]))
      limit 41) as subq_0
where (select varchar from main.all_types limit 1 offset 2)
     ~~ (select varchar from main.all_types limit 1 offset 1)
    
limit 76;
select  
  array_concat() as c0, 
  subq_0.c1 as c1, 
  
    arg_max_null(
      cast(cast(null as decimal) as decimal),
      cast(cast(nullif(cast(nullif(cast(null as decimal),
          cast(null as decimal)) as decimal),
        cast(null as decimal)) as decimal) as decimal)) over (partition by subq_0.c0 order by subq_0.c2) as c2
from 
  (select  
        ref_0.map as c0, 
        ref_0.nested_int_array as c1, 
        ref_0.date as c2
      from 
        main.all_types as ref_0
      where case when (cast(null as t[]) && cast(null as t[])) 
            and (ref_0.varchar !~~* ref_0.varchar) then case when cast(null as t[]) <@ cast(null as t[]) then cast(null as t[]) else cast(null as t[]) end
             else case when cast(null as t[]) <@ cast(null as t[]) then cast(null as t[]) else cast(null as t[]) end
             end
           && case when (((0) 
                or (ref_0.struct_of_fixed_array is not NULL)) 
              or (ref_0.double_array is not NULL)) 
            or (ref_0.varchar !~~* ref_0.varchar) then cast(null as t[]) else cast(null as t[]) end
          
      limit 145) as subq_0
where (cast(null as t[]) && case when (select varchar from main.all_types limit 1 offset 1)
           ~~ cast(null as varchar) then array_distinct(
        cast(list_where(
          cast(cast(null as t[]) as t[]),
          cast(list_pack(
            cast(cast(null as t) as t)) as t[])) as t[])) else array_distinct(
        cast(list_where(
          cast(cast(null as t[]) as t[]),
          cast(list_pack(
            cast(cast(null as t) as t)) as t[])) as t[])) end
      ) 
  and (to_base(
      cast((select bigint from main.all_types limit 1 offset 3)
         as bigint),
      cast(microsecond(
        cast(case when 0 then (select timestamp from main.all_types limit 1 offset 6)
             else (select timestamp from main.all_types limit 1 offset 6)
             end
           as timestamp)) as bigint)) !~~ cast(null as varchar))
limit 86;
select  
  now() as c0, 
  subq_0.c4 as c1, 
  subq_0.c3 as c2
from 
  (select  
        ref_0.dec_9_4 as c0, 
        sample_0.smallint as c1, 
        sample_0.double_array as c2, 
        sample_0.int_array as c3, 
        (select interval from main.all_types limit 1 offset 6)
           as c4, 
        ref_0.date_array as c5, 
        ref_0.date_array as c6
      from 
        main.all_types as ref_0
          right join main.all_types as sample_0 tablesample system (5.8) 
          on (ref_0.ubigint = sample_0.ubigint )
      where ref_0.date is not NULL
      limit 184) as subq_0,
  lateral (select  
        sample_1.utinyint as c0, 
        sample_1.blob as c1, 
        sample_1.bit as c2, 
        sample_1.fixed_varchar_array as c3, 
        sample_1.list_of_fixed_int_array as c4, 
        ref_1.date as c5, 
        subq_0.c2 as c6
      from 
        main.all_types as sample_1 tablesample bernoulli (3.6) 
          inner join main.all_types as ref_1
          on (ref_1.varchar ~~ ref_1.varchar)
      where 0
      limit 109) as subq_1
where (cast(null as varchar) ~~ (select varchar from main.all_types limit 1 offset 1)
      ) 
  or (1)
limit 130;
update main.all_types set 
  tinyint = case when main.all_types.varchar !~~ (select varchar from main.all_types limit 1 offset 4)
         then main.all_types.tinyint else main.all_types.tinyint end
    , 
  bigint = round(
    cast(main.all_types.bigint as bigint),
    cast(main.all_types.bigint as bigint)), 
  hugeint = main.all_types.hugeint, 
  uhugeint = main.all_types.uhugeint, 
  utinyint = main.all_types.utinyint, 
  usmallint = main.all_types.usmallint, 
  bignum = main.all_types.bignum, 
  timestamp_s = main.all_types.timestamp_s, 
  timestamp_ms = main.all_types.timestamp_ms, 
  timestamp_ns = case when cast(nullif(main.all_types.varchar,
        main.all_types.varchar) as varchar) ^@ main.all_types.varchar then main.all_types.timestamp_ns else main.all_types.timestamp_ns end
    , 
  time_tz = main.all_types.time_tz, 
  timestamp_tz = main.all_types.timestamp_tz, 
  double = main.all_types.double, 
  dec_9_4 = main.all_types.dec_9_4, 
  nested_int_array = main.all_types.nested_int_array, 
  struct_of_arrays = main.all_types.struct_of_arrays, 
  array_of_structs = main.all_types.array_of_structs, 
  map = main.all_types.map, 
  union = main.all_types.union, 
  fixed_int_array = main.all_types.fixed_int_array, 
  fixed_nested_int_array = cast(nullif(main.all_types.fixed_nested_int_array,
    (select fixed_nested_int_array from main.all_types limit 1 offset 2)
      ) as integer[3][3]), 
  fixed_nested_varchar_array = main.all_types.fixed_nested_varchar_array, 
  struct_of_fixed_array = case when main.all_types.varchar !~~* substr(
        cast(main.all_types.varchar as varchar),
        cast(main.all_types.varchar as varchar)) then main.all_types.struct_of_fixed_array else main.all_types.struct_of_fixed_array end
    
returning 
  main.all_types.dec38_10 as c0, 
  main.all_types.varchar as c1, 
  cast(nullif(main.all_types.double,
    main.all_types.double) as double) as c2, 
  main.all_types.fixed_nested_varchar_array as c3;
select  
  
    arg_min_null(
      cast(ceil(
        cast(case when (select varchar from main.all_types limit 1 offset 4)
               ^@ (select varchar from main.all_types limit 1 offset 3)
               then cast(null as decimal) else cast(null as decimal) end
           as decimal)) as decimal),
      cast(cast(null as decimal) as decimal)) over (partition by subq_1.c3 order by subq_0.c3,subq_0.c1) as c0, 
  subq_1.c2 as c1, 
  case when 1 then subq_0.c4 else subq_0.c4 end
     as c2, 
  (select bit from main.all_types limit 1 offset 45)
     as c3, 
  subq_1.c1 as c4, 
  case when ((subq_1.c3 is NULL) 
        and (EXISTS (
          select  
              10 as c0, 
              sample_0.struct as c1, 
              subq_0.c0 as c2, 
              sample_0.tinyint as c3
            from 
              main.all_types as sample_0 tablesample system (9.3) 
            where (sample_0.varchar !~~ sample_0.varchar) 
              and (1)
            limit 127))) 
      or (cast(coalesce(subq_0.c3,
          
            argmax(
              cast(subq_0.c3 as integer),
              cast(subq_0.c3 as integer)) over (partition by subq_0.c2 order by subq_0.c2)) as integer) is NULL) then subq_1.c0 else subq_1.c0 end
     as c5, 
  subq_0.c5 as c6, 
  subq_0.c3 as c7, 
  subq_0.c0 as c8, 
  subq_1.c1 as c9, 
  subq_0.c1 as c10, 
  (select timestamp_ns from main.all_types limit 1 offset 6)
     as c11, 
  json_quote() as c12, 
  subq_0.c3 as c13, 
  subq_1.c0 as c14, 
  (select timestamp_array from main.all_types limit 1 offset 6)
     as c15, 
  (select uuid from main.all_types limit 1 offset 2)
     as c16, 
  array_length(
    cast(case when lower(
          cast((select varchar from main.all_types limit 1 offset 2)
             as varchar)) ~~ cast(null as varchar) then case when EXISTS (
          select  
              subq_0.c1 as c0, 
              51 as c1, 
              subq_1.c3 as c2, 
              ref_2.bool as c3, 
              subq_0.c1 as c4, 
              subq_1.c3 as c5
            from 
              main.all_types as ref_2,
              lateral (select  
                    ref_3.fixed_int_array as c0, 
                    ref_2.smallint as c1, 
                    ref_3.timestamp_ns as c2, 
                    ref_2.fixed_int_array as c3
                  from 
                    main.all_types as ref_3
                  where cast(null as t[]) && cast(null as t[])) as subq_2,
              lateral (select  
                    (select double_array from main.all_types limit 1 offset 2)
                       as c0, 
                    ref_2.varchar_array as c1, 
                    (select fixed_int_array from main.all_types limit 1 offset 2)
                       as c2, 
                    subq_0.c3 as c3, 
                    subq_2.c3 as c4, 
                    sample_1.varchar as c5
                  from 
                    main.all_types as sample_1 tablesample system (2.3) 
                  where cast(null as t[]) <@ cast(null as t[])
                  limit 133) as subq_3
            where (cast(null as varchar) ~~* cast(null as varchar)) 
              or (61 is NULL)
            limit 164) then array_concat() else array_concat() end
         else case when EXISTS (
          select  
              subq_0.c1 as c0, 
              51 as c1, 
              subq_1.c3 as c2, 
              ref_2.bool as c3, 
              subq_0.c1 as c4, 
              subq_1.c3 as c5
            from 
              main.all_types as ref_2,
              lateral (select  
                    ref_3.fixed_int_array as c0, 
                    ref_2.smallint as c1, 
                    ref_3.timestamp_ns as c2, 
                    ref_2.fixed_int_array as c3
                  from 
                    main.all_types as ref_3
                  where cast(null as t[]) && cast(null as t[])) as subq_2,
              lateral (select  
                    (select double_array from main.all_types limit 1 offset 2)
                       as c0, 
                    ref_2.varchar_array as c1, 
                    (select fixed_int_array from main.all_types limit 1 offset 2)
                       as c2, 
                    subq_0.c3 as c3, 
                    subq_2.c3 as c4, 
                    sample_1.varchar as c5
                  from 
                    main.all_types as sample_1 tablesample system (2.3) 
                  where cast(null as t[]) <@ cast(null as t[])
                  limit 133) as subq_3
            where (cast(null as varchar) ~~* cast(null as varchar)) 
              or (61 is NULL)
            limit 164) then array_concat() else array_concat() end
         end
       as any[]),
    cast(
      max_by(
        cast(concat(
          cast(cast(null as any) as any)) as any),
        cast(cast(null as any) as any),
        cast(json_transform(
          cast((select varchar from main.all_types limit 1 offset 5)
             as varchar),
          cast((select varchar from main.all_types limit 1 offset 2)
             as varchar)) as any)) over (partition by subq_1.c0 order by subq_1.c3) as any[])) as c17, 
  subq_0.c2 as c18
from 
  (select  
          ref_0.tinyint as c0, 
          ref_0.union as c1, 
          ref_0.timestamptz_array as c2, 
          (select int from main.all_types limit 1 offset 5)
             as c3, 
          ref_0.dec38_10 as c4, 
          ref_0.timestamp_s as c5
        from 
          main.all_types as ref_0
        where ref_0.struct is NULL) as subq_0
    left join (select  
          ref_1.bit as c0, 
          ref_1.dec_9_4 as c1, 
          ref_1.fixed_varchar_array as c2, 
          ref_1.ubigint as c3
        from 
          main.all_types as ref_1
        where case when ref_1.varchar ^@ ref_1.varchar then cast(null as t[]) else cast(null as t[]) end
             <@ case when cast(null as t[]) <@ cast(null as t[]) then cast(null as t[]) else cast(null as t[]) end
            ) as subq_1
    on (10 is not NULL)
where subq_1.c3 is not NULL
limit 82;
WITH 
jennifer_0 AS (select  
    case when sample_0.varchar ~~ sample_0.varchar then case when ((cast(null as t[]) <@ cast(null as t[])) 
            and (sample_0.varchar ^@ sample_0.varchar)) 
          and (sample_0.ubigint is not NULL) then sample_0.fixed_struct_array else sample_0.fixed_struct_array end
         else case when ((cast(null as t[]) <@ cast(null as t[])) 
            and (sample_0.varchar ^@ sample_0.varchar)) 
          and (sample_0.ubigint is not NULL) then sample_0.fixed_struct_array else sample_0.fixed_struct_array end
         end
       as c0
  from 
    main.all_types as sample_0 tablesample system (6.7) 
  where (sample_0.bignum is NULL) 
    or (0)
  limit 133), 

jennifer_1 AS (select  
    cast(coalesce(98,
      ref_2.int) as integer) as c0
  from 
    (select  
              subq_0.c13 as c0
            from 
              main.all_types as ref_0,
              lateral (select  
                    ref_1.map as c0, 
                    ref_0.fixed_nested_varchar_array as c1, 
                    70 as c2, 
                    ref_1.int as c3, 
                    ref_1.fixed_int_array as c4, 
                    ref_1.nested_int_array as c5, 
                    ref_1.map as c6, 
                    ref_1.bool as c7, 
                    ref_0.varchar_array as c8, 
                    ref_1.bignum as c9, 
                    ref_0.hugeint as c10, 
                    ref_1.bool as c11, 
                    ref_1.fixed_varchar_array as c12, 
                    ref_1.double as c13, 
                    ref_0.varchar as c14, 
                    ref_1.timestamp_s as c15, 
                    ref_0.bignum as c16, 
                    ref_1.fixed_array_of_int_list as c17
                  from 
                    main.all_types as ref_1
                  where (0) 
                    and (1)) as subq_0
            where 0) as subq_1
        inner join main.all_types as ref_2
        on (cast(null as t[]) @> cast(null as t[]))
      inner join (select  
            sample_1.union as c0, 
            sample_1.time as c1, 
            sample_1.hugeint as c2, 
            sample_1.int_array as c3
          from 
            main.all_types as sample_1 tablesample system (4.9) 
          where sample_1.varchar ^@ sample_1.varchar) as subq_2
      on (ref_2.union = subq_2.c0 )
  where (ref_2.varchar ~~* ref_2.varchar) 
    and (list_where(
        cast(cast(coalesce(cast(null as t[]),
          cast(coalesce(cast(null as t[]),
            cast(null as t[])) as t[])) as t[]) as t[]),
        cast(case when subq_2.c3 is NULL then cast(null as t[]) else cast(null as t[]) end
           as t[])) <@ cast(nullif(case when ref_2.varchar ~~~ ref_2.varchar then cast(null as t[]) else cast(null as t[]) end
          ,
        case when (EXISTS (
              select  
                  ref_2.time as c0, 
                  sample_2.dec_9_4 as c1
                from 
                  main.all_types as sample_2 tablesample bernoulli (2.5) 
                where (sample_2.timestamp_ms is NULL) 
                  or (ref_2.varchar ~~* ref_2.varchar))) 
            and (0) then cast(null as t[]) else cast(null as t[]) end
          ) as t[]))
  limit 155)
select  
    sample_3.struct_of_arrays as c0, 
    sample_3.map as c1, 
    sample_3.timestamp_s as c2
  from 
    main.all_types as sample_3 tablesample system (4.1) 
  where 1
;
select  
  ref_0.bool as c0, 
  
    arg_min_null(
      cast((select bigint from main.all_types limit 1 offset 4)
         as bigint),
      cast(ref_0.bigint as bigint)) over (partition by ref_0.varchar order by ref_0.utinyint) as c1, 
  case when ref_0.varchar ~~~ (select varchar from main.all_types limit 1 offset 5)
         then ref_0.time else ref_0.time end
     as c2, 
  ref_0.struct_of_fixed_array as c3, 
  ref_0.time_tz as c4, 
  ref_0.struct_of_arrays as c5, 
  ref_0.fixed_varchar_array as c6, 
  ref_0.fixed_struct_array as c7
from 
  main.all_types as ref_0
where 0
limit 60;
select  
  ref_0.struct_of_fixed_array as c0, 
  icu_collate_ceb(
    cast(ref_0.varchar as varchar)) as c1, 
  ref_0.time as c2, 
  ref_0.list_of_fixed_int_array as c3, 
  ref_0.uhugeint as c4, 
  ref_0.struct as c5, 
  88 as c6, 
  
    arg_min(
      cast(ref_0.int as integer),
      cast(ref_0.int as integer)) over (partition by ref_0.interval order by ref_0.fixed_nested_int_array) as c7, 
  cast(coalesce(ref_0.int,
    ref_0.int) as integer) as c8
from 
  main.all_types as ref_0
where cast(nullif(cast(nullif(cast(coalesce(cast(null as t[]),
        case when ref_0.date_array is not NULL then cast(null as t[]) else cast(null as t[]) end
          ) as t[]),
      case when EXISTS (
          select  
              (select date_array from main.all_types limit 1 offset 2)
                 as c0, 
              ref_1.fixed_nested_varchar_array as c1, 
              (select bignum from main.all_types limit 1 offset 2)
                 as c2, 
              76 as c3, 
              ref_0.dec_4_1 as c4
            from 
              main.all_types as ref_1
            where (ref_1.varchar ~~ ref_0.varchar) 
              and (cast(null as t[]) && cast(null as t[]))) then cast(nullif(cast(null as t[]),
          cast(null as t[])) as t[]) else cast(nullif(cast(null as t[]),
          cast(null as t[])) as t[]) end
        ) as t[]),
    cast(null as t[])) as t[]) <@ cast(nullif(case when ref_0.hugeint is NULL then cast(nullif(cast(null as t[]),
        cast(null as t[])) as t[]) else cast(nullif(cast(null as t[]),
        cast(null as t[])) as t[]) end
      ,
    cast(nullif(cast(coalesce(cast(null as t[]),
        case when cast(null as t[]) && cast(null as t[]) then list_where(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) else list_where(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[])) end
          ) as t[]),
      cast(coalesce(cast(null as t[]),
        array_distinct(
          cast(cast(null as t[]) as t[]))) as t[])) as t[])) as t[])
limit 87;
select  
  sample_0.timestamp_tz as c0, 
  
    arg_min(
      cast(remap_struct(
        cast(case when cast(null as t[]) && cast(null as t[]) then cast(null as any) else cast(null as any) end
           as any),
        cast(cast(null as any) as any),
        cast(cast(null as any) as any),
        cast(cast(nullif(aggregate(
            cast(cast(null as any[]) as any[]),
            cast(cast(null as any[]) as any[])),
          cast(null as any)) as any) as any)) as any),
      cast(cast(null as any) as any),
      cast(variant_to_parquet_variant(
        cast(case when sample_0.float is not NULL then cast(null as variant) else cast(null as variant) end
           as variant)) as any)) over (partition by sample_0.fixed_nested_int_array order by sample_0.bit) as c1, 
  sample_0.timestamptz_array as c2, 
  sample_0.timestamp_tz as c3, 
  sample_0.hugeint as c4, 
  sample_0.hugeint as c5, 
  
    arg_max_nulls_last(
      cast(sample_0.blob as blob),
      cast(sample_0.blob as blob)) over (partition by sample_0.usmallint,sample_0.varchar_array order by sample_0.uhugeint,sample_0.fixed_array_of_int_list,sample_0.fixed_nested_varchar_array) as c6, 
  sample_0.timestamp_s as c7, 
  sample_0.bool as c8, 
  sample_0.time_tz as c9
from 
  main.all_types as sample_0 tablesample bernoulli (9.6) 
where sample_0.varchar !~~* sample_0.varchar;
select  
  (select timestamp_ms from main.all_types limit 1 offset 4)
     as c0, 
  subq_0.c1 as c1, 
  subq_0.c1 as c2, 
  subq_1.c0 as c3, 
  case when ((select varchar from main.all_types limit 1 offset 5)
           ~~~ current_schema()) 
      and ((case when (EXISTS (
                select  
                    subq_0.c0 as c0, 
                    sample_1.dec_4_1 as c1, 
                    sample_1.uuid as c2, 
                    subq_1.c0 as c3
                  from 
                    main.all_types as sample_1 tablesample bernoulli (3.6) 
                  where (sample_1.varchar !~~* sample_1.varchar) 
                    and (0))) 
              and ((cast(null as t[]) <@ cast(null as t[])) 
                and (subq_1.c0 is not NULL)) then cast(null as t[]) else cast(null as t[]) end
             && list_where(
            cast(cast(null as t[]) as t[]),
            cast(cast(null as t[]) as t[]))) 
        and ((select varchar from main.all_types limit 1 offset 2)
             ~~~ (select varchar from main.all_types limit 1 offset 5)
            )) then subq_0.c2 else subq_0.c2 end
     as c4, 
  subq_0.c2 as c5
from 
  (select  
        sample_0.blob as c0, 
        sample_0.dec38_10 as c1, 
        sample_0.list_of_fixed_int_array as c2, 
        sample_0.tinyint as c3, 
        sample_0.fixed_int_array as c4
      from 
        main.all_types as sample_0 tablesample system (3.5) 
      where (1) 
        or (sample_0.dec_18_6 is NULL)
      limit 31) as subq_0,
  lateral (select distinct 
        subq_0.c4 as c0
      from 
        main.all_types as ref_0
      where (cast(coalesce(ref_0.varchar,
            ref_0.varchar) as varchar) !~~* ref_0.varchar) 
        and (ref_0.varchar ~~ ref_0.varchar)
      limit 93) as subq_1
where version() ~~ cast(nullif((select varchar from main.all_types limit 1 offset 2)
      ,
    cast(nullif(dayname(
        cast(case when 1 then (select timestamp from main.all_types limit 1 offset 4)
             else (select timestamp from main.all_types limit 1 offset 4)
             end
           as timestamp)),
      current_database()) as varchar)) as varchar)
limit 93;
MERGE INTO main.all_types as target_0
USING (select  
      (select timestamp_tz from main.all_types limit 1 offset 5)
         as c0, 
      list_inner_product(
        cast(case when (select varchar from main.all_types limit 1 offset 5)
               ~~* (select varchar from main.all_types limit 1 offset 6)
               then cast(null as float[]) else cast(null as float[]) end
           as float[]),
        cast(
          reservoir_quantile(
            cast((select float from main.all_types limit 1 offset 5)
               as float),
            cast((select float from main.all_types limit 1 offset 3)
               as float)) over (partition by subq_0.c0 order by subq_0.c0) as float[])) as c1, 
      subq_0.c0 as c2, 
      subq_0.c0 as c3, 
      cast(coalesce(subq_0.c0,
        (select map from main.all_types limit 1 offset 3)
          ) as map(varchar, varchar)) as c4
    from 
      (select  
            sample_0.map as c0
          from 
            main.all_types as sample_0 tablesample system (6.2) 
          where (EXISTS (
              select  
                  sample_1.fixed_nested_int_array as c0, 
                  sample_1.uuid as c1, 
                  (select uuid from main.all_types limit 1 offset 13)
                     as c2, 
                  sample_1.time_tz as c3, 
                  (select uuid from main.all_types limit 1 offset 1)
                     as c4
                from 
                  main.all_types as sample_1 tablesample system (6.6) 
                where (cast(null as t[]) && cast(null as t[])) 
                  and (sample_1.varchar !~~* sample_1.varchar)
                limit 82)) 
            and (cast(null as t[]) <@ cast(null as t[]))) as subq_0
    where (select varchar from main.all_types limit 1 offset 1)
         ^@ cast(null as varchar)) as subq_1
ON target_0.timestamp_tz = subq_1.c0 
WHEN NOT MATCHED AND (cast(null as t[]) <@ cast(null as t[])) 
    or ((cast(null as varchar) ~~ cast(null as varchar)) 
      and (cast(null as t[]) && cast(null as t[])))
   THEN INSERT VALUES ( 1, cast(null as tinyint), case when (cast(null as varchar) !~~* cast(null as varchar)) 
      and (cast(null as varchar) ^@ cast(null as varchar)) then cast(null as smallint) else cast(null as smallint) end
    , 49, cast(null as bigint), cast(null as hugeint), case when (select varchar from main.all_types limit 1 offset 6)
         ^@ cast(null as varchar) then cast(null as uhugeint) else cast(null as uhugeint) end
    , cast(null as utinyint), __internal_compress_integral_usmallint(
    cast(cast(null as uinteger) as uinteger),
    cast(cast(null as uinteger) as uinteger)), cast(null as uinteger), cast(coalesce(cast(null as ubigint),
    txid_current()) as ubigint), cast(null as bignum), cast(null as date), cast(null as time), case when EXISTS (
      select  
          subq_3.c5 as c0, 
          sample_3.array_of_structs as c1, 
          sample_2.struct_of_fixed_array as c2, 
          sample_2.hugeint as c3, 
          case when sample_2.varchar ^@ sample_2.varchar then sample_3.fixed_int_array else sample_3.fixed_int_array end
             as c4, 
          sample_3.bigint as c5, 
          subq_3.c3 as c6
        from 
          main.all_types as sample_2 tablesample bernoulli (5.9) 
            left join main.all_types as sample_3 tablesample bernoulli (2.3) 
            on ((sample_2.dec_18_6 is NULL) 
                and (cast(null as varchar) ~~~ cast(null as varchar))),
          lateral (select  
                (select union from main.all_types limit 1 offset 2)
                   as c0, 
                ref_0.hugeint as c1, 
                subq_2.c5 as c2, 
                sample_3.ubigint as c3, 
                subq_2.c4 as c4, 
                ref_0.timestamp_array as c5
              from 
                main.all_types as ref_0,
                lateral (select  
                      sample_4.uhugeint as c0, 
                      sample_2.timestamp_ns as c1, 
                      sample_4.nested_int_array as c2, 
                      84 as c3, 
                      sample_2.uhugeint as c4, 
                      (select fixed_nested_int_array from main.all_types limit 1 offset 5)
                         as c5, 
                      (select timestamp from main.all_types limit 1 offset 4)
                         as c6, 
                      sample_4.struct as c7, 
                      ref_0.int_array as c8, 
                      sample_2.int_array as c9, 
                      (select dec_9_4 from main.all_types limit 1 offset 5)
                         as c10, 
                      sample_3.bignum as c11
                    from 
                      main.all_types as sample_4 tablesample bernoulli (1.1) 
                    where cast(null as t[]) <@ cast(null as t[])
                    limit 45) as subq_2
              where 0) as subq_3
        where (((cast(null as varchar) ~~* cast(null as varchar)) 
              or ((select fixed_varchar_array from main.all_types limit 1 offset 5)
                   is not NULL)) 
            or (sample_2.varchar ~~ sample_2.varchar)) 
          and ((sample_3.varchar ~~~ (select varchar from main.all_types limit 1 offset 2)
                ) 
            or (cast(null as t[]) && cast(null as t[])))
        limit 138) then cast(null as timestamp) else cast(null as timestamp) end
    , cast(null as timestamp_s), (select timestamp_ms from main.all_types limit 1 offset 2)
    , cast(null as timestamp_ns), cast(null as time with time zone), cast(null as timestamp with time zone), cast(null as float), case when cast(null as varchar) !~~ cast(null as varchar) then cast(null as double) else cast(null as double) end
    , 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), current_schema(), cast(null as blob), cast(null as bit), case when 82 is NULL then cast(null as integer[]) else cast(null as integer[]) end
    , case when cast(null as t[]) && cast(null as t[]) then (select double_array from main.all_types limit 1 offset 5)
       else (select double_array from main.all_types limit 1 offset 5)
       end
    , cast(null as date[]), cast(null as timestamp[]), cast(nullif(cast(null as timestamp with time zone[]),
    (select timestamptz_array from main.all_types limit 1 offset 6)
      ) as timestamp with time zone[]), cast(nullif(cast(null as varchar[]),
    cast(null as varchar[])) as varchar[]), cast(null as integer[][]), cast(null as struct(a integer, b varchar)), cast(null as struct(a integer[], b varchar[])), cast(null as struct(a integer, b varchar)[]), cast(null as map(varchar, varchar)), cast(null as union("name" varchar, age smallint)), cast(null as integer[3]), cast(nullif(cast(null as varchar[3]),
    cast(null as varchar[3])) as varchar[3]), cast(null as integer[3][3]), 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.timestamp_s as c0, 
  case when 0 then sample_0.uint else sample_0.uint end
     as c1, 
  case when sample_0.varchar ^@ current_database() then sample_0.interval else sample_0.interval end
     as c2, 
  case when 0 then sample_0.interval else sample_0.interval end
     as c3, 
  icu_collate_bo(
    cast(sample_0.varchar as varchar)) as c4
from 
  main.all_types as sample_0 tablesample bernoulli (6.6) 
where (sample_0.varchar ~~ sample_0.varchar) 
  and (multiply(
      cast(sample_0.bigint as bigint),
      cast(sample_0.bigint as bigint)) is not NULL);
select  
  ref_0.ubigint as c0, 
  (select int_array from main.all_types limit 1 offset 1)
     as c1, 
  ref_0.time_tz as c2, 
  add() as c3, 
  ref_0.hugeint as c4, 
  (select date_array from main.all_types limit 1 offset 90)
     as c5, 
  ref_0.timestamptz_array as c6, 
  json_object() as c7, 
  68 as c8, 
  ref_0.timestamp as c9, 
  ref_0.uhugeint as c10, 
  ref_0.date_array as c11, 
  json_extract_path(
    cast(json_object() as json),
    cast(json_serialize_sql(
      cast(version() as varchar),
      cast(ref_0.varchar as varchar),
      cast(ref_0.varchar as varchar),
      cast(ref_0.varchar as varchar)) as json)) as c12, 
  ref_0.bit as c13, 
  cast(coalesce(ref_0.timestamp_array,
    (select timestamp_array from main.all_types limit 1 offset 3)
      ) as timestamp[]) as c14, 
  ref_0.dec_4_1 as c15, 
  ref_0.fixed_varchar_array as c16
from 
  main.all_types as ref_0
where cast(nullif(case when cast(null as t[]) <@ list_distinct(
          cast(cast(null as t[]) as t[])) then array_distinct(
        cast(cast(null as t[]) as t[])) else array_distinct(
        cast(cast(null as t[]) as t[])) end
      ,
    flatten(
      cast(case when 1 then cast(coalesce(cast(null as t[][]),
          cast(null as t[][])) as t[][]) else cast(coalesce(cast(null as t[][]),
          cast(null as t[][])) as t[][]) end
         as t[][]))) as t[]) @> cast(null as t[]);
select  
  subq_0.c0 as c0, 
  cast(nullif((select date from main.all_types limit 1 offset 6)
      ,
    case when (cast(null as t[]) && case when 0 then cast(null as t[]) else cast(null as t[]) end
            ) 
        or (
            min_by(
              cast(cast(null as varchar) as varchar),
              cast((select varchar from main.all_types limit 1 offset 5)
                 as varchar)) over (partition by subq_0.c0,subq_0.c0 order by subq_0.c1) ~~ current_schema()) then today() else today() end
      ) as date) as c1, 
  (select timestamp_ms from main.all_types limit 1 offset 46)
     as c2, 
  subq_0.c0 as c3, 
  subq_0.c0 as c4, 
  (select time_tz from main.all_types limit 1 offset 67)
     as c5, 
  
    min_by(
      cast(cast(coalesce(cast(null as decimal),
        subtract(
          cast(cast(null as decimal) as decimal))) as decimal) as decimal),
      cast(cast(null as decimal) as decimal)) over (partition by subq_0.c1 order by subq_0.c1) as c6, 
  subq_0.c0 as c7, 
  subq_0.c1 as c8, 
  subq_0.c0 as c9, 
  cast(coalesce(epoch_ns(
      cast(subq_0.c1 as time with time zone)),
    (select bigint from main.all_types limit 1 offset 5)
      ) as bigint) as c10, 
  (select double from main.all_types limit 1 offset 4)
     as c11, 
  subq_0.c0 as c12, 
  (select uhugeint from main.all_types limit 1 offset 6)
     as c13, 
  subq_0.c1 as c14, 
  subq_0.c0 as c15, 
  array_to_json() as c16, 
  subq_0.c1 as c17, 
  
    argmin(
      cast(cast(nullif(trunc(
          cast(case when 0 then cast(null as decimal) else cast(null as decimal) end
             as decimal),
          cast(cast(null as decimal) as decimal)),
        case when (select varchar from main.all_types limit 1 offset 10)
               ~~* (select varchar from main.all_types limit 1 offset 5)
               then cast(null as decimal) else cast(null as decimal) end
          ) as decimal) as decimal),
      cast(ceil(
        cast(round(
          cast(case when (select varchar from main.all_types limit 1 offset 12)
                 !~~ (select varchar from main.all_types limit 1 offset 4)
                 then cast(null as decimal) else cast(null as decimal) end
             as decimal),
          cast(cast(coalesce(cast(null as decimal),
            cast(null as decimal)) as decimal) as decimal)) as decimal)) as decimal)) over (partition by subq_0.c1 order by subq_0.c1,subq_0.c1) as c18
from 
  (select  
        sample_0.bool as c0, 
        (select time_tz from main.all_types limit 1 offset 1)
           as c1
      from 
        main.all_types as sample_0 tablesample system (0.3) 
      where case when EXISTS (
            select  
                sample_0.timestamp_tz as c0, 
                sample_0.double_array as c1
              from 
                main.all_types as ref_0
              where ((1) 
                  or (cast(null as t[]) && cast(null as t[]))) 
                and (EXISTS (
                  select  
                      sample_1.int_array as c0, 
                      ref_0.fixed_struct_array as c1, 
                      ref_0.dec_4_1 as c2
                    from 
                      main.all_types as sample_1 tablesample bernoulli (0.3) 
                    where sample_1.varchar ~~ ref_0.varchar
                    limit 128))
              limit 36) then cast(coalesce(cast(null as t[]),
            cast(null as t[])) as t[]) else cast(coalesce(cast(null as t[]),
            cast(null as t[])) as t[]) end
           && cast(null as t[])
      limit 176) as subq_0
where json_serialize_sql(
    cast((select varchar from main.all_types limit 1 offset 29)
       as varchar)) is NULL
limit 27;
select  
  
    bitstring_agg(
      cast(cast(nullif(case when EXISTS (
            select  
                sample_4.timestamp_array as c0, 
                (select timestamp_tz from main.all_types limit 1 offset 14)
                   as c1, 
                sample_4.double as c2
              from 
                main.all_types as sample_4 tablesample system (4.9) 
              where (subq_2.c1 is NULL) 
                and (cast(null as t[]) && cast(null as t[]))
              limit 125) then xor(
            cast((select smallint from main.all_types limit 1 offset 5)
               as smallint),
            cast((select smallint from main.all_types limit 1 offset 20)
               as smallint)) else xor(
            cast((select smallint from main.all_types limit 1 offset 5)
               as smallint),
            cast((select smallint from main.all_types limit 1 offset 20)
               as smallint)) end
          ,
        case when EXISTS (
            select  
                subq_2.c1 as c0, 
                subq_2.c0 as c1, 
                ref_1.int_array as c2
              from 
                main.all_types as ref_1
              where (1) 
                or ((EXISTS (
                    select  
                        ref_2.nested_int_array as c0
                      from 
                        main.all_types as ref_2
                      where 1
                      limit 102)) 
                  or (subq_2.c1 is NULL))
              limit 147) then cast(coalesce((select smallint from main.all_types limit 1 offset 2)
              ,
            (select smallint from main.all_types limit 1 offset 20)
              ) as smallint) else cast(coalesce((select smallint from main.all_types limit 1 offset 2)
              ,
            (select smallint from main.all_types limit 1 offset 20)
              ) as smallint) end
          ) as smallint) as smallint),
      cast(cast(null as smallint) as smallint),
      cast(case when EXISTS (
          select  
              ref_3.int as c0, 
              subq_2.c2 as c1, 
              subq_2.c1 as c2, 
              subq_2.c0 as c3
            from 
              main.all_types as ref_3
            where cast(null as varchar) ^@ ref_3.varchar
            limit 152) then (select smallint from main.all_types limit 1 offset 2)
           else (select smallint from main.all_types limit 1 offset 2)
           end
         as smallint)) over (partition by subq_2.c0 order by subq_2.c1,subq_2.c1) as c0, 
  
    argmax(
      cast(case when cast(null as varchar) !~~* (select varchar from main.all_types limit 1 offset 2)
             then case when 1 then cast(null as any) else cast(null as any) end
           else case when 1 then cast(null as any) else cast(null as any) end
           end
         as any),
      cast(union_extract(
        cast(union_value() as union),
        cast(cast(null as union) as union)) as any)) over (partition by subq_2.c2,subq_2.c0 order by subq_2.c0) as c1, 
  subq_2.c0 as c2, 
  subq_2.c2 as c3, 
  current_localtime() as c4, 
  subq_2.c0 as c5
from 
  (select  
        subq_0.c0 as c0, 
        64 as c1, 
        (select varchar_array from main.all_types limit 1 offset 25)
           as c2
      from 
        main.all_types as sample_0 tablesample system (4.8) 
          left join main.all_types as sample_1 tablesample system (0.4) 
          on (sample_1.varchar ^@ sample_1.varchar),
        lateral (select  
              sample_0.struct_of_fixed_array as c0, 
              (select interval from main.all_types limit 1 offset 4)
                 as c1
            from 
              main.all_types as ref_0
            where ref_0.timestamptz_array is not NULL
            limit 92) as subq_0,
        lateral (select  
              sample_0.fixed_varchar_array as c0, 
              sample_2.smallint as c1, 
              sample_0.uuid as c2, 
              18 as c3, 
              sample_2.fixed_nested_varchar_array as c4
            from 
              main.all_types as sample_2 tablesample system (4.9) 
            where EXISTS (
              select  
                  sample_3.bignum as c0
                from 
                  main.all_types as sample_3 tablesample bernoulli (7.3) 
                where sample_3.varchar ~~* sample_3.varchar
                limit 101)
            limit 83) as subq_1
      where (((subq_1.c2 is not NULL) 
            or (cast(null as t[]) && cast(null as t[]))) 
          and (sample_0.varchar ^@ sample_1.varchar)) 
        or (1)
      limit 61) as subq_2
where json_array() is NULL
limit 93;
select  
  ref_0.varchar as c0, 
  ref_0.uuid as c1, 
  
    arg_min_nulls_last(
      cast(case when (ref_0.varchar ~~~ ref_0.varchar) 
          or (ref_0.varchar ~~ ref_0.varchar) then cast(null as decimal) else cast(null as decimal) end
         as decimal),
      cast(case when ref_0.float is not NULL then case when ref_0.varchar ~~* ref_0.varchar then cast(null as decimal) else cast(null as decimal) end
           else case when ref_0.varchar ~~* ref_0.varchar then cast(null as decimal) else cast(null as decimal) end
           end
         as decimal)) over (partition by ref_0.fixed_nested_varchar_array order by ref_0.bigint,ref_0.uint) as c2, 
  ref_0.dec_4_1 as c3, 
  cast(coalesce(ref_0.struct_of_fixed_array,
    ref_0.struct_of_fixed_array) as struct(a integer[3], b varchar[3])) as c4, 
  3 as c5, 
  ref_0.uint as c6, 
  ref_0.fixed_int_array as c7, 
  ref_0.timestamptz_array as c8
from 
  main.all_types as ref_0
where ref_0.timestamp_tz is NULL
limit 120;
select  
  63 as c0, 
  sample_0.uhugeint as c1, 
  sample_0.fixed_nested_int_array as c2, 
  sample_0.float as c3, 
  (select fixed_int_array from main.all_types limit 1 offset 4)
     as c4, 
  
    arg_min_null(
      cast(case when sample_0.timestamp_tz is NULL then cast(null as any) else cast(null as any) end
         as any),
      cast(cast(nullif(cast(null as any),
        cast(null as any)) as any) as any)) over (partition by sample_0.dec_4_1,sample_0.fixed_varchar_array order by sample_0.list_of_fixed_int_array) as c5
from 
  main.all_types as sample_0 tablesample system (7.4) 
where case when case when sample_0.varchar !~~ sample_0.varchar then case when sample_0.varchar ~~~ (select varchar from main.all_types limit 1 offset 6)
               then array_distinct(
            cast(cast(null as t[]) as t[])) else array_distinct(
            cast(cast(null as t[]) as t[])) end
           else case when sample_0.varchar ~~~ (select varchar from main.all_types limit 1 offset 6)
               then array_distinct(
            cast(cast(null as t[]) as t[])) else array_distinct(
            cast(cast(null as t[]) as t[])) end
           end
         && list_pack(
        cast(cast(coalesce(cast(null as t),
          cast(null as t)) as t) as t)) then sample_0.varchar else sample_0.varchar end
     ~~~ (select varchar from main.all_types limit 1 offset 1)
    
limit 191;

Error Message

Catalog Error: Type with name t does not exist!

Stack Trace

Did you mean "text"?
Catalog Error: Type with name t does not exist!
Did you mean "text"?
Catalog Error: Type with name t does not exist!
Did you mean "text"?
Parser Error: syntax error at or near "union"

LINE 26:   union = main.all_types.union, 
           ^
Parser Error: syntax error at or near "any"

LINE 120:        as any[]),
                    ^
Parser Error: Sample method System cannot be used with a discrete sample count, either switch to reservoir sampling or use a sample_size
Catalog Error: Type with name t does not exist!
Did you mean "text"?
Parser Error: syntax error at or near "any"

LINE 6: ... when cast(null as t[]) && cast(null as t[]) then cast(null as any) else cast(null as any) end
                                                                          ^
Catalog Error: Type with name t does not exist!
Did you mean "text"?
Parser Error: SELECT clause without selection list
Parser Error: Sample method Bernoulli cannot be used with a discrete sample count, either switch to reservoir sampling or use a sample_size
Catalog Error: Type with name t does not exist!
Did you mean "text"?
Catalog Error: Type with name t does not exist!
Did you mean "text"?
Parser Error: syntax error at or near "any"

LINE 65:              then case when 1 then cast(null as any) else cast(null as any) end
                                                         ^
Parser Error: syntax error at or near "any"

LINE 10: ...(case when sample_0.timestamp_tz is NULL then cast(null as any) else cast(null as any) end
                                                                       ^

Metadata

Metadata

Assignees

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