All Classes and Interfaces
Class
Description
Common implementation for the JDBC
Statement and
PreparedStatement implementations in Druid.Represents a SQL statement either for preparation or execution.
Calcite provides two "schema" abstractions.
Modified version of Calcite's
AggregateMergeRule, with two changes:
(1) Includes a workaround for https://issues.apache.org/jira/browse/CALCITE-7162
(2) Includes the ability to merge two Aggregate with a Project between them, by pushing the
Project below the new merged Aggregate.Implementation matching an Aggregate on top of an Aggregate without any intervening Project.
Implementation matching an Aggregate on top of an Aggregate with an intervening Project.
Rule that pulls
QueryLookupOperatorConversion.SQL_FUNCTION up through an Aggregate.Implementation for APPROX_COUNT_DISTINCT, and for COUNT(DISTINCT expr) when
useApproximateCountDistinct
is enabled.Interface for
SqlOperator that need authorization in order to execute.The module responsible for providing bindings to Avatica.
Extend the Java-focused
CalciteSqlValidator to make it visible
to Druid.Druid-specific version of
SqlUserDefinedTableMacro which
copies & overrides a bunch of code to handle string array arguments.Broker-side cache of segment metadata that combines segments to build
datasources which become "tables" in Calcite.
Broker-side configuration class for managing segment polling from the Coordinator and
customizing properties related to the SegmentMetadata cache which is used to infer datasources for SQL.
Calcite planner.
The module responsible for provide bindings for the Calcite Planner.
Utility functions for Calcite.
Rule that un-does the rewrite from
SqlCoalesceFunction.rewriteCall(org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.SqlCall).Like
LiteralOperandTypeChecker, but also allows casted literals.Facade onto the (optional) Druid catalog.
Catalog resolver for when the catalog is not available.
Rule that rewrites
COALESCE(LOOKUP(x, 'lookupName'), 'missingValue') to
LOOKUP(x, 'lookupName', 'missingValue').Converts SQL COALESCE, NVL, IFNULL to native "coalesce" or "nvl".
CollectComparisons<BaseType,ComparisonType extends BaseType,CollectedType extends BaseType,CollectionKey,CollectionElementType,CollectionType extends Collection<CollectionElementType>>
Utility class for collecting point comparisons that are children to an OR, such as equalities.
Maps column names from the query to output names desired by the user, in the order
desired by the user.
Register
contains_string and icontains_string functions with calcite that internally
translate these functions into SearchQueryDimFilter with ContainsSearchQuerySpec as
search query spec.Constants used by
PartialDruidQuery.estimateCost() and various
AbstractRelNode.computeSelfCost(RelOptPlanner, RelMetadataQuery) implementations.Represents a SQL table that models a Druid datasource.
The physical metadata for a datasource, derived from the list of segments
published in the Coordinator.
DATE_TRUNC function similar to PostgreSQL.
Operand type checker that is used in 'simple' situations: there are a particular number of operands, with
particular types, some of which may be optional or nullable, and some of which may be required to be literals.
Conversion for SQL operators that map 1-1 onto native functions.
Lifecycle for direct SQL statement execution, which means that the query
is planned and executed in a single step, with no "prepare" step.
DruidLogicalNode convention node for Aggregate plan node.Druid extension of
AggregateCaseToFilterRule.Planner rule that recognizes a
Aggregate
on top of a Project and if possible
aggregate through the project or removes the project.Base class for Druid's custom Avatica server handlers that are compatible with Jetty 12.
The module responsible for providing bindings to Calcite schemas.
Implementation of Calcite
SqlConformance for Druid.Connection tracking for
DruidMeta.This is the DruidRel to handle correlated rel nodes to be used for unnest.
Shuttle that replaces correlating variables with regular field accesses to the left-hand side.
This class creates the rule to abide by for creating correlations during unnest.
Represents two kinds of expression-like concepts that native Druid queries support:
(1) SimpleExtractions, which are direct column access, possibly with an extractionFn
(2) native Druid expressions and virtual columns
When added to
VirtualColumnRegistry whenever used by projections, filters,
aggregators, or other query components, these will be converted into native virtual columns using
DruidExpression.toVirtualColumn(String, ColumnType, ExpressionParser)
Approximate expression structure is retained in the DruidExpression.arguments, which when fed into the
DruidExpression.ExpressionGenerator that all DruidExpression must be created with will produce the final String
expression (which will be later parsed into Expr during native processing).Create a
DruidExpression given some set of input argument sub-expressionsUsed by
DruidExpression to compile a string which can be parsed into an Expr from given the
sub-expression argumentsDirect reference to a physical or virtual column
Builds expressions for a static constant value
Used by a
DruidExpression to translate itself into a VirtualColumn to add to a native query when
referenced by a projection, filter, aggregator, etc.Operator conversion for the `EXTERN` table macros (functions) based on the
TableFunction abstraction defined by the catalog.DruidLogicalNode convention node for Filter plan node.Interface for hooks that can be invoked by
DruidHookDispatcher.Dispatcher for Druid hooks.
The Druid implementation of the server-side representation of the
JDBC
PreparedStatement class.Druid's server-side representation of a JDBC result set.
Asynchronous result fetcher.
Creates the result fetcher and holds config.
Represents Druid's version of the JDBC
Statement class:
can be executed multiple times, one after another, producing a
DruidJdbcResultSet for each execution.DruidRel that uses a
JoinDataSource.Literal value, plus a
ExpressionType that represents how to interpret the literal value.A Calcite convention to produce
DruidLogicalNode based DAG.An interface to mark
RelNode as Druid physical nodes.DruidRel that uses a
QueryDataSource.Druid SQL planner.
DruidLogicalNode convention node for Project plan node.A fully formed Druid query, built from a
PartialDruidQuery.Converts a DAG of
DruidLogicalNode convention to a native DruidQuery for execution.Tracks the upstream nodes during traversal.
PartialDruidQuery based DruidQueryGenerator.Vertex factory.DruidRel that operates on top of a
DruidTable directly (no joining or subqueries).DruidRelFieldTrimmer is a subclass of
RelFieldTrimmer that provides additional support for Druid specific RelNodes.A Calcite
RexExecutor that reduces Calcite expressions by evaluating them using Druid's own built-in
expressions.DruidRules.DruidQueryRule<RelType extends org.apache.calcite.rel.RelNode>
The Druid 'catalog', containing information about all Druid schemas which are available.
This interface provides a map of datasource names to
DruidTable
objects, used by the DruidSchema class as the SQL planner's
view of Druid datasource schemas.An annotation to get the name of the schema to access Druid tables in SQL.
DruidLogicalNode convention node for Sort plan node.Rule that pushes LIMIT and OFFSET into a
DruidUnionRel.Common base class to the two Druid "ingest" statements: INSERT and REPLACE.
Extends the 'insert' call to hold custom parameters specific to Druid i.e.
Contains the utility function
DruidSqlParser.parse(String, boolean), for parsing Druid SQL statements.SQL parser, generated from Parser.jj by JavaCC.
Extends the 'replace' call to hold custom parameters specific to Druid i.e.
Druid extended SQL validator.
Abstract base class for the various kinds of tables which Druid supports.
Table macro which wraps a catalog table function and which accepts
a schema from an EXTENDS clause.
DruidLogicalNode convention node for TableScan plan node.Represents a query on top of a
UnionDataSource.Creates a
DruidUnionDataSourceRel from various DruidQueryRel inputs that represent simple
table scans.Represents a "UNION ALL" of various input
DruidRel.Rule that creates a
DruidUnionRel from some DruidRel inputs.Captures an unnest expression for a correlated join.
This class creates the rule to abide by for creating unnest (internally uncollect) in Calcite.
Base class for input-source-specific table functions with arguments derived from
a catalog external table definition.
Operator conversion for user-defined table macros (functions) based on the
TableFunction abstraction defined by the catalog.DruidLogicalNode convention node for LogicalValues plan node.A factory to create a
DruidViewMacro that is used by Guice for Assisted injection.This module is responsible for providing bindings for views in Druid.
Druid's extension to
VolcanoCost.Implementation of
RelOptCostFactory
that creates DruidVolcanoCosts.DruidLogicalNode convention node for Filter plan node.Arguments to
SqlEngine.featureAvailable(EngineFeature).Destination that represents an ingestion to an external source.
Like
Parser.parse(java.lang.String, org.apache.druid.math.expr.ExprMacroTable), but allows caching via ExpressionParserImpl.Member of
PlannerToolbox that caches the result of Parser.parse(java.lang.String, org.apache.druid.math.expr.ExprMacroTable).A collection of functions for translating from Calcite expressions into Druid objects.
Druid-specific implementation of the EXTEND operator in Calcite, which
is said to have been added for Apache Phoenix, and which we repurpose to
supply a schema for an ingest input table.
This interface provides a way to supply custom calcite planning rules from extensions.
Represents external data for INSERT queries.
Extends the
SqlIdentifier to hold parameters for an external destination.Registers the "EXTERN" operator, which is used in queries like
Conversion functions to-from the SQL, catalog and MSQ representations
of external tables.
Represents an source of data external to Druid: a CSV file, an HTTP request, etc.
Represents a scan of an external table.
Transform calls like f(COALESCE(x, y)) => (x IS NOT NULL AND f(x)) OR (x IS NULL AND f(y)), for boolean functions f.
Transform calls like [CONCAT(x, '-', y) = 'a-b'] => [x = 'a' AND y = 'b'].
FilterJoinExcludePushToChildRule<C extends org.apache.calcite.rel.rules.FilterJoinRule.Config>
This class is a copy (with modification) of
FilterJoinRule.Rule that tries to push filter expressions into a join
condition.
Rewrites comparisions to avoid bug FIXME.
Flattens calls to CONCAT.
Class returned by
SqlResource.doGetRunningQueries(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest), the "list all queries" API.Class returned by
SqlResource.doGetQueryReport(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest), the "get query report" API.Represents Druid's concept of a "group by": dimensions, aggregations, post-aggregations, and 'having' filters.
SQL statement lifecycle for the HTTP endpoint.
Represents the destination where the data is ingested.
Handler for the INSERT statement.
Handler for the REPLACE statement.
Represents a specialized table used within Druid's Calcite-based planner.
View manager that stores all views in-process.
Enables simpler access to input expressions.
Calcite 1.35 introduces an aggrgate function LITERAL_AGG that returns constant value regardless
of how many rows are in the group.
Recognizes a LogicalUnnest operation in the plan.
Creates the "lookup" schema in Druid SQL, composed of all available
LookupDataSource.Represents a Druid lookup as a Calcite table, allowing queries to read from a lookup.
Builds a view of used segment metadata currently present on the Coordinator
in the
SegmentsMetadataManager object, by polling the REST API
/druid/coordinator/v1/metadata/segments.Array functions which return an array, but are used in a multi-valued string dimension context instead will output
SqlTypeName.VARCHAR instead of SqlTypeName.ARRAY.Function that converts a String or a Multi Value direct column to an array.
The schema for Druid tables to be accessible via SQL.
The schema for Druid lookup tables to be accessible via SQL.
This interface provides everything that is needed to register a
Schema as a sub schema to the root schema
of Druid SQL.The schema for Druid system tables to be accessible via SQL.
This annotation is to distinguish
SqlAggFunction
which supports the distinct aggregation nativelyThe
StandardConvertletTable converts json_value(..View manager that does not support views.
Represents an offset and a limit.
Utilities for assisting in writing
SqlOperatorConversion implementations.OperatorConversions.OperatorBuilder<T extends org.apache.calcite.sql.SqlFunction>
Helps in creating the operator builder along with validations and type inference for simple operator conversions.
Internal operator used to create an on-the-fly table function from a
partial table definition within the catalog.
This exception is thrown when parse errors are encountered.
Builder for a Druid query, not counting the "dataSource" (which will be slotted in later).
Builds
DatasourceTable.PhysicalDatasourceMetadata for a dataSource, including information about its schema,
joinability, and broadcast status.Builder for
PlannerConfig, primarily for use in tests to
allow setting options programmatically rather than from the command
line or a properties file.Like
PlannerConfig, but that has static configuration and this class
contains dynamic, per-query configuration.Deprecated.
Caches
LookupExtractor within a PlannerContext.The result of planning an SQL query with
DruidPlanner can be run to produce query result, and also includes
the output row type signature.This class serves as a tracking structure for managing post aggregator column names and any post aggs that
are created as part of translation of a Calcite
RexNode into native Druid structures.Statement for the JDBC prepare-once, execute many model.
After preparing an SQL query with
DruidPlanner, the artifacts produced are the output signature of the
result row, and type information for any dynamic parameters which must be bound before planning the query.Rule that prunes unused aggregators after a projection.
Used to represent projections (Calcite "Project").
Abstract base class for handlers that revolve around queries: SELECT,
INSERT and REPLACE.
Information about a SQL query.
Interface for executing Druid queries.
Marks that the
QueryMaker supports executing
DruidLogicalNode-s.Utility class for queries
Traverse
RelNode tree and replaces all RexDynamicParam with RexLiteral
using RexBuilder if a value binding exists for the parameter.Similar to
BottomUpTransform except only removes redundant IS TRUE filters that are not inside of a NOT
filter.Eliminates calls to
QueryLookupOperatorConversion.SQL_FUNCTION by doing reverse-lookups.Rewrites exotic cases of FIRST_VALUE/LAST_VALUE to simpler plans.
Provides the RootSchema for Calcite with
- metadata schema disabled because it's not needed
- caching disabled because Druid's caching is better.
Utility functions for working with
RowSignature.Calcite
RelDataType for Druid complex columns, to preserve complex type information.Table macro designed for use with the Druid EXTEND operator.
Calcite table macro created dynamically to squirrel away the
schema provided by the EXTEND clause to allow
Operator that tests whether its left operand is included in the range of
values covered by search arguments.
An implementation of interface CharStream, where the stream is assumed to
contain only ASCII characters (without unicode processing).
Represents a "simple" extraction of a value from a Druid row, which is defined as a column plus an optional
extractionFn.
Abstraction for single column, single argument simple aggregators like sum, avg, min, max that:
1) Can take direct field accesses or expressions as inputs.
This class serves as binding for Single Value Aggregator.
Collapses two adjacent Sort operations together.
Represents Druid's concept of sorting and limiting, including post-sort projections.
Abstracts away non-trivial input operation handlings between
DataSources.Utility class to input related things details.
Module that provides SQL aggregations.
Bridge between Druid and SQL aggregators.
Utility class that provides bindings to extendable components in the SqlModule
Engine for running SQL queries.
Side-car class which reports logs and metrics for an
HttpStatement.Extends the
SqlLiteral to hold parameters for the PARTITIONED BY clause.The Module responsible for providing bindings to the SQL http endpoint
This class manages only authorized
DirectStatements submitted via
HTTP, such as SqlResource.We create a new class for this module so that it can be shared by tests.
See
ClientSqlParameter for the equivalent POJO class used on the client side.Replaces all
SqlDynamicParam encountered in an SqlNode tree
with a SqlLiteral if a value binding exists for the parameter, if
possible.An exception for SQL query planning failures.
See
ClientSqlQuery for the equivalent POJO class used on the client side to interact with the Broker.Captures the inputs to a SQL execution request: the statement (as a string),
the parsed statement, the context, parameters, and the authorization result.
Walks an
SqlNode to collect a set of Resource for ResourceType.DATASOURCE and
ResourceType.VIEW to use for authorization during query planning.Holder for the utility method
SqlResults.coerce(ObjectMapper, Context, Object, SqlTypeName, String).This class transforms the values of TIMESTAMP or DATE type for sql query results.
A class for the creation of Statements, which happen to be used for Sql.
Handler for a SQL statement.
Context available to statement handlers.
Provides the plan and execution resources to process SQL queries.
Standard strings returned by
QueryInfo.state().Represents a parsed "main" (not SET) SQL statement, plus context derived from SET statements.
Implements
SqlLibraryOperators.STRING_AGG and
SqlStdOperatorTable.LISTAGG, as well as our extended versions of these
functions that include maxSizeBytes.Represents the Druid groupBy query concept of subtotals, which is similar to GROUPING SETS.
Class returned by
SqlResource.getSupportedEngines(javax.servlet.http.HttpServletRequest), the supported engines API.System schema table
sys.server_properties that contains the properties of all Druid servers.Dynamic table append.
Destination that represents an ingestion to a druid table.
Base class for a number of time arithmetic related operators.
Describes the input token stream.
Makes tweaks to LogicalUnnest input.
View managers allow
DruidSchema to support views.Engine used for getting the row type of views.
Provides facilities to create and re-use
VirtualColumn definitions for dimensions, filters, and filtered
aggregators while constructing a DruidQuery.Maps onto a
WindowOperatorQuery.Conversion for SQL operators that map 1-1 onto native functions.