Berserk Docs
Scalar FunctionsType Functions

gettype

Return the type of a value as a string, from ADX's closed set of names.

A typed value reports string, int, long, real, bool, datetime, timespan or guid (a typed null keeps its type's name). A value inside a dynamic reports null, array, dictionary, string, bool, long, double, datetime or timespan: a real inside a dynamic is double, and an int packed into one is long.

Divergences from Microsoft Kusto:

  • Berserk has no runtime guid value. A guid-typed column reports guid, but a guid literal, toguid() and a guid packed into a dynamic are strings and report string.
  • Berserk has no decimal type, so decimal is never reported.
  • parse_json keeps a datetime- or guid-shaped JSON string a string; Kusto stores it as a dynamic datetime or guid.

Syntax

gettype(value)

Parameters

Prop

Type

Returns: string

Examples

Example 1

print gettype(1), gettype(1.5), gettype("s"), gettype(true), gettype(dynamic([1, 2])), gettype(
  dynamic({"a":1})
)
print_0 (string)print_1 (string)print_2 (string)print_3 (string)print_4 (string)print_5 (string)
longrealstringboolarraydictionary

Example 2

print gettype(dynamic(1.5)), gettype(pack("i", int(1))["i"])
print_0 (string)print_1 (string)
doublelong

On this page