Druid.AndFType
AndF(filters::Vector{<:Filter})

Match all filters.

Druid.AndHType
AndH(havingSpecs::Vector{<:HavingSpec})

Match all havingSpecs.

Druid.ArithmeticType
Arithmetic(name::String, fn::String, fields::Vector{<:PostAggregator}; ordering=nothing)

Apply the fn aggregation to the fields.

ordering should be a String if provided.

Druid.BoundType
Bound(dimension::String;
    lower=nothing, upper=nothing, lowerStrict=nothing, upperStrict=nothing,
    ordering=nothing, extractionFn=nothing)

Filter values bounded in a range.

lower, upper and ordering should be Strings if provided. lowerStrict and upperStrict should be Bools if provided. extractionFn should be an ExtractionFunction if provided.

Druid.BucketEFType
BucketEF(; size=nothing, offset=nothing)

Bucket numeric values into size buckets starting at offset.

size and offset should be non negative integers if provided.

Druid.CascadeEFType
CascadeEF(extractionFns::Vector{<:ExtractionFunction})

Apply multiple extraction functions in sequence.

Druid.ClientType
Client

Client(url::URIs.URI)
Client(url::AbstractString)
Client(host, port, scheme)

Druid queryable host connection information store.

Do not provide the endpoint, it will be set based on the type of query. For example, "druid/v2/sql" for SQL queries and "druid/v2" for all other queries.

Examples

julia> client = Client("http://localhost:8888/")
Client(URI("http://localhost:8888/"))

julia> client = Client("localhost", 8082, "http")
Client(URI("http://localhost:8082"))
Druid.ColumnComparisonType
ColumnComparison(dimensions::Tuple{DimensionSpec, DimensionSpec})

ColumnComparison(dim1::DimensionSpec, dim2::DimensionSpec)

dimension1 = dimension2 filter.

Druid.ConstantPAType
ConstantPA(name::String, value::Real)

Return a constant value as name.

Druid.ContainsType
Contains(value::String; case_sensitive=nothing)

Search query spec for strings containing value.

case_sensitive should be a Bool if provided.

Druid.CountType
Count(output_name)

Count number of rows.

Druid.DatasourceMetadataType
DatasourceMetadata(dataSource::DataSource; context=nothing)

Returns a Dict{String, String} with "timestamp" and "maxIngestedEventTime" as keys.

context should be a Dict if provided.

Druid.DefaultDSType
DefaultDS(dimension::String;
    outputName=nothing, outputType=nothing)

The "default" type dimension spec.

outputName and outputType should be Strings if provided.

Druid.DefaultLSType
DefaultLS(; limit=nothing, offset=nothing, columns=nothing)

Default limitSpec.

limit and offset should be non negative integers if provided. columns should be Vector{OrderByColumn} if provided.

Druid.DimSelectorType
DimSelector(dimension::String, value)

dimension = value filter.

Druid.DimensionType
Dimension()
Dimension(; ordering=nothing, previousStop=nothing)

Dimension topN metric spec.

ordering and previousStop should be Strings if provided.

Druid.DurationGranularityType
DurationGranularity(duration::UInt64; origin=nothing)

Duration type granularity where the duration is specified as milliseconds since origin.

Specifying origin is not required (defaults to Druid's default), but should be a ISO8601 datetime string if you do specify it.

Druid.EqualToType
EqualTo(aggregation::String, value::Real)

aggregation = value filter.

Druid.ExpressionType
Expression(name::String, expression::String; outputType=nothing)

Create a virtual column using expression.

outputType should be String if provided.

Druid.ExtractionDSType
ExtractionDS(dimension::String, extractionFn::ExtractionFunction;
    outputName=nothing, outputType=nothing)

Dimension spec to use with an extraction function.

outputName and outputType should be Strings if provided.

Druid.ExtractionFilterType
ExtractionFilter(dimension::String, value, extractionFn::ExtractionFunction)

Filter to value extracted using extractionFn.

Druid.FieldAccessType
FieldAccess(name::String, aggregator::String)
FieldAccess(aggregator::String)

Access the aggregator and return as name.

Druid.FilteredType
Filtered(filter, aggregator)

An aggregator that combines a filter with the aggregator.

Druid.FinalizingFieldAccessType
FinalizingFieldAccess(name::String, aggregator::String)
FinalizingFieldAccess(aggregator::String)

Access the aggregator and return as name.

Druid.FragmentType
Fragment(value::String; case_sensitive=nothing)

Fragment search query spec.

case_sensitive should be a Bool if provided.

Druid.GreaterThanType
GreaterThan(aggregation::String, value::Real)

aggregation >= value filter.

Druid.GreatestType
Greatest(name::String, fields::Vector{<:PostAggregator}, dtype::String)

Find the largest value per row across the fields of type dtype (double, long) and return as name.

Druid.GroupByType
GroupBy(
    dataSource::DataSource,
    dimensions::Vector{<:DimensionSpec},
    intervals::Vector{<:Interval},
    granularity::Granularity;
    <keyword arguments>
)

Returns a Druid.GroupByResult which is compatible with the Tables.jl interface.

A method with all arguments as keyword arguments is also provided.

Arguments

  • limitSpec::LimitSpec = nothing
  • having::HavingSpec = nothing
  • filter::Filter = nothing
  • aggregations::Vector{<:Aggregator} = nothing
  • postAggregations::Vector{<:PostAggregator} = nothing
  • virtualColumns::Vector{<:VirtualColumn} = nothing
  • subtotalsSpec::Vector{Vector{String}} = nothing
  • context::Dict = nothing
Druid.HyperUniqueCardinalityType
HyperUniqueCardinality(name::String, field::String)
HyperUniqueCardinality(field::String)

Post aggregator of a hyper unique aggregation.

Druid.InFType
InF(dimension::String, values::Vector)

Filter if value is in values.

Druid.InlineType
Inline(column_names::Vector{String}, rows::Vector{Vector{T}})

Inline datasource.

Druid.InlineLookupEFType
InlineLookupEF(lookup::Map;
    retainMissingValue=nothing, replaceMissingValueWith=nothing, injective=nothing, optimize=nothing)

Extract using an inline lookup.

retainMissingValue, injective, optimize should be Bools and replaceMissingValueWith should be a String if provided.

Druid.IntervalType
Interval(first::String, last::String)

A type to represent ISO8601 intervals.

Druid.IntervalFType
IntervalF(dimension::String, intervals::Vector{<:Interval}; extractionFn=nothing)

Filter by time falling in one of the intervals.

extractionFn should be an ExtractionFunction if provided.

Druid.InvertedType
Inverted(metric::TopNMetricSpec)

Inverting topN metric spec.

Druid.JavaScriptEFType
JavaScriptEF(jsfunction::String; injective=nothing)

Extract using a custom JavaScript function.

injective should be a Bool if provided.

Druid.JavaScriptFType
JavaScriptF(dimension::String, jsfunction::String)

Filter using a custom JavaScript function.

Druid.JavaScriptPAType
JavaScriptPA(name::String, fieldNames::Vector{String}, jsfunction::String)

Post aggregate the fieldNames aggregators using a custom jsfunction JavaScript function.

Druid.JoinType
Join(left::Union{Table, Lookup, Inline, QuerySource, Join},
    right::Union{Lookup, Inline, QuerySource}, rightPrefix::String,
    condition::String, joinType::String)

Join datasource.

Druid.LeastType
Least(name::String, fields::Vector{<:PostAggregator}, dtype::String)

Find the smallest value per row across the fields of type dtype (double, long) and return as name.

Druid.LessThanType
LessThan(aggregation::String, value::Real)

aggregation <= value filter.

Druid.LikeType
Like(dimension::String, pattern::String; escape=nothing, extractionFn=nothing)

Filter strings matching pattern.

escape should be a String and extractionFn an ExtractionFunction if provided.

Druid.ListFilteredType
ListFiltered(delegate::DimensionSpec, values::Vector{String}; isWhitelist=nothing)

Filter the delegate dimension spec with the values.

isWhitelist should be a Bool if provided.

Druid.LookupDSType
LookupDS(dimension::String, name::String; outputName=nothing)

A dimension spec to use with the name lookup.

outputName should be a String if provided.

Druid.LowerEFType
LowerEF(; locale=nothing)

Extract strings as lower case.

locale should be a String if provided.

Druid.MapType
Map(isOneToOne::Bool, dict::Dict)

The lookup map used in the map lookup dimension spec.

Druid.MapLookupDSType
MapLookupDS(dimension::String, lookup::Map;
    outputName=nothing, retainMissingValue=nothing, replaceMissingValueWith=nothing, optimize=nothing)

Map lookup dimension spec.

outputName and replaceMissingValueWith should be Strings, retainMissingValue and optimize should be Bools if provided.

Druid.NotFType
NotF(filter::Filter)

Do not match filter.

Druid.NotHType
NotH(havingSpec::HavingSpec)

Do not match the havingSpec.

Druid.NumericType
Numeric(metric::String)

Numeric topN metric spec.

Druid.OrFType
OrF(filters::Vector{<:Filter})

Match at least one of the filters.

Druid.OrHType
OrH(havingSpecs::Vector{<:HavingSpec})

Match at leats one of the havingSpecs.

Druid.OrderByColumnType
OrderByColumn(dimension::String, direction::String; dimensionOrder=nothing)

dimensionOrder should be a String if provided.

Druid.ParameterType
Parameter(type::String, value)

SQL query parameter, where type is one of the Druid SQL data types and value is the parameter value.

Druid.PartialEFType
PartialEF(expr::String)

Regex based extraction function that return nulls for non-matches.

Druid.PeriodGranularityType
PeriodGranularity(period::String; origin=nothing, timezone=nothing)

Period type granularity where the period is specified as an ISO8601 period string. Period starts on origin in the timezone.

Specifying origin and timezone is not required (defaults to Druid's default). But if you do specify them, origin should be a ISO8601 datetime string and timezone should be one of those supported by Druid.

Druid.PrefixFilteredType
PrefixFiltered(delegate::DimensionSpec, prefix::String)

Filter the delegate dimension spec with the prefix.

Druid.RegexEFType
RegexEF(expr::String; index=nothing, replaceMissingValue=nothing, replaceMissingValueWith=nothing)

Regex based extraction function.

index should be a non negative integer, replaceMissingValue a Bool and replaceMissingValueWith a String if provided.

Druid.RegexFType
RegexF(dimension::String, pattern::String)

Regex pattern matching filter.

Druid.RegexFilteredType
RegexFiltered(delegate::DimensionSpec, pattern::String)

Filter the delegate dimension spec with the regex pattern.

Druid.RegisteredLookupEFType
RegisteredLookupEF(lookup::String;
    retainMissingValue=nothing, replaceMissingValueWith=nothing, injective=nothing, optimize=nothing)

Extract using a registered lookup.

retainMissingValue, injective, optimize should be Bools and replaceMissingValueWith should be a String if provided.

Druid.ScanType
Scan(dataSource::DataSource, intervals::Vector{<:Interval}; <keyword arguments>)

A method with all arguments as keyword arguments is also provided.

Arguments

  • columns::Vector{String} = nothing
  • filter::Filter = nothing
  • virtualColumns::Vector{<:VirtualColumn} = nothing
  • order::String = nothing
  • limit::Integer = nothing
  • offset::Integer = nothing
  • resultFormat::String = nothing
  • batchSize::Integer = nothing
  • context::Dict = nothing
  • legacy::Bool = nothing
Druid.SearchType
Search(dataSource::DataSource, intervals::Vector{<:Interval}, query::SearchQuerySpec; <keyword arguments>)

Returns a Druid.SearchResult which is compatible with the Tables.jl interface.

A method with all arguments as keyword arguments is also provided.

Arguments

  • granularity::Granularity = nothing
  • filter::Filter = nothing
  • virtualColumns::Vector{<:VirtualColumn} = nothing
  • sort::String = nothing
  • limit::Integer = nothing
  • context::Dict = nothing
Druid.SearchFType
SearchF(dimension::String, query::SearchQuerySpec; extractionFn=nothing)

Filter using a query and optionally extraction function.

extractionFn should be an ExtractionFunction if provided.

Druid.SearchQueryEFType
SearchQueryEF(query::SearchQuerySpec)

Extraction using a search query spec.

Druid.SegmentMetadataType
SegmentMetadata(dataSource::DataSource; <keyword arguments>)

Returns a Dict with the query output.

A method with all arguments as keyword arguments is also provided.

Arguments

  • intervals::Vector{<:Interval} = nothing
  • toInclude::Union{String, Vector{String}} = nothing
  • merge::Bool = nothing
  • analysisTypes::Vector{String} = nothing
  • lenientAggregatorMerge::Bool = nothing
  • virtualColumns::Vector{<:VirtualColumn} = nothing
  • context::Dict = nothing
Druid.SelectorType
Selector(dimension::String, value::String)

dimension = value filter.

Druid.SimpleGranularityType
SimpleGranularity(name::String)

One of the simple predefined granularities of Druid.

Druid.SingleFieldType
SingleField(type, field, output_name)

Apply type aggregator to the field and get result as output_name.

Available types: "longSum", "doubleSum", "floatSum", "longMin", "doubleMin", "floatMin", "longMax", "doubleMax", "floatMax", "longFirst", "doubleFirst", "floatFirst", "longLast", "doubleLast", "floatLast", "longAny", "doubleAny", "floatAny", "doubleMean"

Druid.SqlType
Sql(query::String; <keyword arguments>)

A method with all arguments as keyword arguments is also provided.

Arguments

  • parameters::Vector{Parameter} = nothing
  • resultFormat::String = nothing
  • header::Bool = true
  • context::Dict = nothing
Druid.StringAggType
StringAgg(type, field, output_name; maxStringBytes=nothing)

Apply type string aggregator to field and get result as output_name.

Available types: "first", "last", "any"

See Druid documentation for maxStringBytes.

Druid.StringFormatEFType
StringFormatEF(format::String; nullHandling=nothing)

Extract strings using a format.

nullHandling should be a String if provided.

Druid.SubstringEFType
SubstringEF(index::UInt64; length=nothing)

Substring extraction based on index and length.

length should be a non negative integer if provided.

Druid.TableType
Table(name::String)

Table datasource.

Druid.TimeBoundaryType
TimeBoundary(dataSource::DataSource; <keyword arguments>)

Returns a Dict{String, String} with "timestamp", "minTime" and/or "maxTime" (depending on bound) as keys.

A method with all arguments as keyword arguments is also provided.

Arguments

  • bound::String = nothing
  • filter::Filter = nothing
  • virtualColumns::Vector{<:VirtualColumn} = nothing
  • context::Dict = nothing
Druid.TimeFormatEFType
TimeFormatEF(; format=nothing, timeZone=nothing, locale=nothing, granularity=nothing, asMillis=nothing)

Extract timestamps.

format, timeZone, locale should be Strings, granularity should be a Granularity and asMillis should be a Bool if provided.

Druid.TimeParseEFType
TimeParseEF(timeFormat::String, resultFormat::String; joda=nothing)

Parse and extract time.

joda should be a Bool if provided.

Druid.TimeseriesType
Timeseries(dataSource::DataSource, intervals::Vector{<:Interval}, granularity::Granularity; <keyword arguments>)

Returns a Druid.TimeseriesResult which is compatible with the Tables.jl interface.

A method with all arguments as keyword arguments is also provided.

Arguments

  • filter::Filter = nothing
  • aggregations::Vector{<:Aggregator} = nothing
  • postAggregations::Vector{<:PostAggregator} = nothing
  • virtualColumns::Vector{<:VirtualColumn} = nothing
  • descending::Bool = nothing
  • limit::Integer = nothing
  • context::Dict = nothing
Druid.TopNType
TopN(dataSource::DataSource, intervals::Vector{Interval}, granularity::Granularity,
    dimension::DimensionSpec, threshold::Uint64, metric::TopNMetricSpec; <keyword arguments>)

Returns a Druid.TopNResult which is compatible with the Tables.jl interface.

A method with all arguments as keyword arguments is also provided.

Arguments

  • aggregations::Vector{<:Aggregator} = nothing
  • postAggregations::Vector{<:PostAggregator} = nothing
  • filter::Filter = nothing
  • virtualColumns::Vector{<:VirtualColumn} = nothing
  • context::Dict = nothing
Druid.UnionedType
Unioned(names::Vector{String})

Union of table datasources.

Druid.UpperEFType
UpperEF(; locale=nothing)

Extract strings as upper case.

locale should be a String if provided.

Druid.executeFunction
execute(client, query::Sql; names=:auto)

Executes the Druid SQL query on the client::Client. Returns the query results as a String. Throws exception if query execution fails.

A Vector{Symbol} can be provided for the column names through names.

Examples

julia> query = Sql("SELECT * FROM some_datasource LIMIT 10")
julia> execute(client, query)
"[...\n]"

julia> query = Sql("SELECT * FROM non_existent_datasource")
julia> execute(client, query)
ERROR: Druid error during query execution
Dict{String,Any}("errorClass" => "org.apache.calcite.tools.ValidationException"...
Druid.executeMethod
execute(client, query; pretty=false)

Executes the native Druid query on the client::Client. Returns the query results as a String. Throws exception if query execution fails.

Druid.non_nothing_dictMethod

Convert a structure into a Dict but only with the properties with non-nothing values.