Bool Data Type issue in Kusto

ADX 156 Reputation points
2022-02-04T07:26:22.533+00:00

Hi,

I have a table called "ActivityStatus" and it has one column i.e. "Status" and its datatype is bool in Azure Data Explorer database.

when i am inserting the data in it its working fine.

.ingest inline into table ActivityStatus<|
1
0

and when i query the data it showing as
true
false

till this part it is fine. But when i am inserting the value as '3' it is showing as true

.ingest inline into table ActivityStatus<|
3

and when i query the data it showing as
true

which means if we insert any value >=1 then the data will be stored as true and <=0 as false.

Please suggest and confirm me the same

Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
{count} votes

1 answer

Sort by: Most helpful
  1. HimanshuSinha 19,527 Reputation points Microsoft Employee Moderator
    2022-02-07T02:11:18.513+00:00

    Hello @ADX
    ,
    Thanks for the ask and using Microsoft Q&A platform .
    This is what i trried and it behaves differently then what i called out above . Can you please more details ?

    .drop table T

    .create table T (text:string, b:bool)

    .ingest inline into table T <|
    null,null
    false,false
    0,0
    -1,-1
    1,1
    2,2
    3,3
    true,true

    T | extend ['null?']=isnull(b)

    171771-image.png

    Please do let me if you have any queries .
    Thanks
    Himanshu

    -------------------------------------------------------------------------------------------------------------------------

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.