2023.05

2023.05

  • Imply
  • Ingest
  • Query
  • Visualize
  • Administer
  • Deploy

›Native query types

Overview

  • Querying data
  • Datasources

    • Datasources
    • Joins
    • Lookups
    • Query execution

    Query configuration

    • Query caching
    • Using query caching
    • Query context
  • Enhanced IP support
  • Multi-value dimensions
  • Nested columns
  • Multitenancy
  • Troubleshooting

Druid SQL

  • Overview and syntax
  • SQL data types
  • Druid SQL Functions

    • All functions
    • Operators
    • Scalar functions
    • Aggregation functions
    • JSON functions
    • Multi-value string functions
  • SQL metadata tables
  • SQL query context
  • Async SQL download
  • SQL query translation
  • Druid SQL APIs

    • Druid SQL API
    • Async SQL download API
    • JDBC driver API

Native queries

  • Native queries
  • Native query types

    • Timeseries
    • TopN
    • GroupBy
    • Scan
    • Search
    • TimeBoundary
    • SegmentMetadata
    • DatasourceMetadata

    Native query components

    • Filters
    • Granularities
    • Dimensions
    • Aggregations
    • Post-aggregations
    • Expressions
    • Having filters (groupBy)
    • Sorting and limiting (groupBy)
    • Sorting (topN)
    • String comparators
    • Virtual columns
    • Spatial filters

DatasourceMetadata queries

Apache Druid supports two query languages: Druid SQL and native queries. This document describes a query type that is only available in the native language.

Data Source Metadata queries return metadata information for a dataSource. These queries return information about:

  • The timestamp of latest ingested event for the dataSource. This is the ingested event without any consideration of rollup.

The grammar for these queries is:

{
    "queryType" : "dataSourceMetadata",
    "dataSource": "sample_datasource"
}

There are 2 main parts to a Data Source Metadata query:

propertydescriptionrequired?
queryTypeThis String should always be "dataSourceMetadata"; this is the first thing Apache Druid looks at to figure out how to interpret the queryyes
dataSourceA String or Object defining the data source to query, very similar to a table in a relational database. See DataSource for more information.yes
contextSee Contextno

The format of the result is:

[ {
  "timestamp" : "2013-05-09T18:24:00.000Z",
  "result" : {
    "maxIngestedEventTime" : "2013-05-09T18:24:09.007Z"
  }
} ]
Last updated on 11/17/2022
← SegmentMetadataFilters →
2023.05
Key links
Try ImplyApache Druid siteImply GitHub
Get help
Stack OverflowSupportContact us
Learn more
Apache Druid forumsBlog
Copyright © 2023 Imply Data, Inc