+ New Ticket

Boolean value representation : Aginity for Redshift

Comments

4 comments

  • Avatar
    Supriya Thigale

    Any update Team

    0
    Comment actions Permalink
  • Avatar
    Supriya Thigale

    Any suggestions Team ?

    0
    Comment actions Permalink
  • Avatar
    Supriya Thigale

    Any suggestions Team ?

    0
    Comment actions Permalink
  • Avatar
    Steve LeVander

    I'm not in Aginity support and happened to notice your question.  You might want to try casting the boolean into a smallint.  Here's an example for a different database engine:

    create temp table x as (
    select cast(null as bool) as a_bool union
    select cast(True as bool) as a_bool union
    select cast(False as bool) as a_bool
    )
    distribute on random
    ;
    select a_bool from x
    ;
    select cast(case
           when a_bool is null then null
           when a_bool = True then 1
           when a_bool = False then 0 end as smallint) as reformated
    from x
    ;

     

    0
    Comment actions Permalink

Please sign in to leave a comment.