NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
NES::Query Class Reference

#include <Query.hpp>

Public Member Functions

 Query (const Query &)
 
virtual ~Query ()=default
 
WindowOperatorBuilder::WindowedQuery window (Windowing::WindowTypePtr const &windowType)
 
JoinOperatorBuilder::Join joinWith (const Query &subQueryRhs)
 can be called on the original query with the query to be joined with and sets this query in the class Join. More...
 
NES::Experimental::BatchJoinOperatorBuilder::Join batchJoinWith (const Query &subQueryRhs)
 can be called on the original query with the query to be joined with and sets this query in the class BatchJoinOperatorBuilder::Join. More...
 
CrossJoinOperatorBuilder::CrossJoin crossJoinWith (const Query &subQueryRhs)
 can be called on the original query with the query to be cross joined with and sets this query in the class CrossJoinOperatorBuilder::Join. More...
 
IntervalJoinOperatorBuilder::IntervalJoin intervalJoinWith (const Query &subQueryRhs)
 can be called on the original query with the query to be joined with and sets this query in the class IntervalJoinOperatorBuilder::Join. More...
 
CEPOperatorBuilder::And andWith (const Query &subQueryRhs)
 can be called on the original query with the query to be composed with and sets this query in the class And. More...
 
CEPOperatorBuilder::Seq seqWith (const Query &subQueryRhs)
 can be called on the original query with the query to be composed with and sets this query in the class Join. More...
 
CEPOperatorBuilder::Times times (const uint64_t minOccurrences, const uint64_t maxOccurrences)
 can be called on the original query to detect an number event occurrences between minOccurrence and maxOccurrence in a stream More...
 
CEPOperatorBuilder::Times times (const uint64_t occurrences)
 can be called on the original query to detect an exact number event occurrences in a stream More...
 
CEPOperatorBuilder::Times times ()
 can be called on the original query to detect multiple occurrences of specified events in a stream More...
 
QueryorWith (const Query &subQuery)
 can be called on the original query with the query to be composed with and sets this query in the class Or. More...
 
QuerybuildStatistic (Windowing::WindowTypePtr window, Statistic::WindowStatisticDescriptorPtr statisticDescriptor, Statistic::StatisticMetricHash metricHash, Statistic::SendingPolicyPtr sendingPolicy, Statistic::TriggerConditionPtr triggerCondition)
 Add a synopsis build operator to the query. More...
 
QueryunionWith (const Query &subQuery)
 
template<typename... Args>
auto project (Args &&... args) -> std::enable_if_t< std::conjunction_v< std::is_constructible< ExpressionItem, Args >... >, Query & >
 this call projects out the attributes in the parameter list More...
 
Queryproject (std::vector< ExpressionNodePtr > expressions)
 this call projects out the attributes in the parameter list More...
 
Queryas (std::string const &newSourceName)
 
Queryfilter (ExpressionNodePtr const &filterExpression)
 : Filter records according to the predicate. An examplary usage would be: filter(Attribute("f1" < 10)) More...
 
Querylimit (const uint64_t limit)
 : Limit the number of records according to the limit count. More...
 
QueryassignWatermark (Windowing::WatermarkStrategyDescriptorPtr const &watermarkStrategyDescriptor)
 : Create watermark assigner operator. More...
 
QuerymapUDF (Catalogs::UDF::UDFDescriptorPtr const &descriptor)
 : Create map java udf operator. More...
 
QueryflatMapUDF (Catalogs::UDF::UDFDescriptorPtr const &descriptor)
 : Create flat map java udf operator. More...
 
Querymap (FieldAssignmentExpressionNodePtr const &mapExpression)
 : Map records according to a map expression. An examplary usage would be: map(Attribute("f2") = Attribute("f1") * 42 ) More...
 
QueryinferModel (std::string model, std::initializer_list< ExpressionItem > inputFields, std::initializer_list< ExpressionItem > outputFields)
 
virtual Querysink (SinkDescriptorPtr sinkDescriptor, WorkerId workerId=INVALID_WORKER_NODE_ID)
 Add sink operator for the query. The Sink operator is defined by the sink descriptor, which represents the semantic of this sink. More...
 
QueryPlanPtr getQueryPlan () const
 Gets the query plan from the current query. More...
 
 Query (QueryPlanPtr queryPlan)
 

Static Public Member Functions

static Query from (std::string const &sourceName)
 : Creates a query from a particular source. The source is identified by its name. During query processing the underlying source descriptor is retrieved from the source catalog. More...
 

Protected Attributes

QueryPlanPtr queryPlan
 

Friends

class JoinOperatorBuilder::JoinWhere
 
class NES::Experimental::BatchJoinOperatorBuilder::Join
 
class IntervalJoinOperatorBuilder::JoinWhere
 
class CrossJoinOperatorBuilder::CrossJoin
 
class IntervalJoinOperatorBuilder::JoinLowerBound
 
class CEPOperatorBuilder::And
 
class CEPOperatorBuilder::Seq
 
class WindowOperatorBuilder::WindowedQuery
 
class WindowOperatorBuilder::KeyedWindowedQuery
 

Detailed Description

User interface to create stream processing queryIdAndCatalogEntryMapping. The current api exposes method to create queryIdAndCatalogEntryMapping using all currently supported operators.

Constructor & Destructor Documentation

◆ Query() [1/2]

NES::Query::Query ( const Query )
default

Referenced by from().

Here is the caller graph for this function:

◆ ~Query()

virtual NES::Query::~Query ( )
virtualdefault

◆ Query() [2/2]

NES::Query::Query ( QueryPlanPtr  queryPlan)

Member Function Documentation

◆ andWith()

CEPOperatorBuilder::And NES::Query::andWith ( const Query subQueryRhs)

can be called on the original query with the query to be composed with and sets this query in the class And.

Parameters
subQueryRhs
Returns
CEPOperatorBuilder object where the window() function is defined and can be called by user

Referenced by TEST_F(), NES::TEST_F(), and NES::CEPOperatorBuilder::And::window().

Here is the caller graph for this function:

◆ as()

Query & NES::Query::as ( std::string const &  newSourceName)

This looks ugly, but we can't reference to QueryPtr at this line.

Parameters
newsource name
Returns
the query

References NES_DEBUG, and queryPlan.

Referenced by NES::RequestProcessor::TEST_F().

Here is the caller graph for this function:

◆ assignWatermark()

Query & NES::Query::assignWatermark ( Windowing::WatermarkStrategyDescriptorPtr const &  watermarkStrategyDescriptor)

: Create watermark assigner operator.

Parameters
watermarkStrategyDescriptor
Returns
query.

References NES_DEBUG, and queryPlan.

Referenced by NES::TEST_P().

Here is the caller graph for this function:

◆ batchJoinWith()

NES::Experimental::BatchJoinOperatorBuilder::Join NES::Query::batchJoinWith ( const Query subQueryRhs)

can be called on the original query with the query to be joined with and sets this query in the class BatchJoinOperatorBuilder::Join.

Warning
The batch join is an experimental feature.
Parameters
subQueryRhs
Returns
object where where() function is defined and can be called by user

Referenced by NES::Experimental::BatchJoinOperatorBuilder::Join::where().

Here is the caller graph for this function:

◆ buildStatistic()

Query & NES::Query::buildStatistic ( Windowing::WindowTypePtr  window,
Statistic::WindowStatisticDescriptorPtr  statisticDescriptor,
Statistic::StatisticMetricHash  metricHash,
Statistic::SendingPolicyPtr  sendingPolicy,
Statistic::TriggerConditionPtr  triggerCondition 
)

Add a synopsis build operator to the query.

Parameters
window
statisticDescriptor
metricHashThe hash of the metric, this operator is collecting, e.g., cardinality over field f1
sendingPolicyPolicy so when and how to send the data
triggerConditionPolicy when and how to call the callback method
Returns
The query

References backward::details::move(), queryPlan, and window().

Referenced by NES::Statistic::DefaultStatisticQueryGenerator::createStatisticQuery(), and NES::TEST_P().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ crossJoinWith()

CrossJoinOperatorBuilder::CrossJoin NES::Query::crossJoinWith ( const Query subQueryRhs)

can be called on the original query with the query to be cross joined with and sets this query in the class CrossJoinOperatorBuilder::Join.

Parameters
subQueryRhs
Returns
object of type CrossJoin on which the window can be can be called.

Referenced by NES::TEST_F(), and NES::Runtime::Execution::TEST_P().

Here is the caller graph for this function:

◆ filter()

Query & NES::Query::filter ( ExpressionNodePtr const &  filterExpression)

: Filter records according to the predicate. An examplary usage would be: filter(Attribute("f1" < 10))

Parameters
predicateas expression node
Returns
the query

References NES_DEBUG, and queryPlan.

Referenced by UnionQueryExecutionTest::__attribute__(), TEST_F(), NES::TEST_F(), NES::TEST_P(), and NES::CEPOperatorBuilder::Times::window().

Here is the caller graph for this function:

◆ flatMapUDF()

Query & NES::Query::flatMapUDF ( Catalogs::UDF::UDFDescriptorPtr const &  descriptor)

: Create flat map java udf operator.

Parameters
descriptorjava udf descriptor
Returns
query

References NES_DEBUG, and queryPlan.

◆ from()

Query NES::Query::from ( std::string const &  sourceName)
static

: Creates a query from a particular source. The source is identified by its name. During query processing the underlying source descriptor is retrieved from the source catalog.

Parameters
sourceNamename of the source to query. This name has to be registered in the query catalog.
Returns
the query

References NES_DEBUG, Query(), and queryPlan.

Referenced by NES::Statistic::DefaultStatisticQueryGenerator::createStatisticQuery(), NES::RequestProcessor::TEST_F(), NES::TEST_F(), TEST_F(), NES::Runtime::Execution::TEST_P(), and NES::TEST_P().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getQueryPlan()

◆ inferModel()

Query & NES::Query::inferModel ( std::string  model,
std::initializer_list< ExpressionItem inputFields,
std::initializer_list< ExpressionItem outputFields 
)

References NES_DEBUG, and queryPlan.

Referenced by NES::TEST_F().

Here is the caller graph for this function:

◆ intervalJoinWith()

IntervalJoinOperatorBuilder::IntervalJoin NES::Query::intervalJoinWith ( const Query subQueryRhs)

can be called on the original query with the query to be joined with and sets this query in the class IntervalJoinOperatorBuilder::Join.

Parameters
subQueryRhs
Returns
object where where() function is defined and can be called by user

Referenced by NES::Runtime::Execution::StreamIntervalJoinQueryExecutionTest::runSingleJoinQuery(), TEST_F(), NES::TEST_F(), and NES::IntervalJoinOperatorBuilder::JoinLowerBound::upperBound().

Here is the caller graph for this function:

◆ joinWith()

JoinOperatorBuilder::Join NES::Query::joinWith ( const Query subQueryRhs)

can be called on the original query with the query to be joined with and sets this query in the class Join.

Parameters
subQueryRhs
Returns
object where where() function is defined and can be called by user

Referenced by NES::Runtime::Execution::StreamJoinQuerySharedExecutionTest::prepareRunTwoEqualQueriesDeployedDifferentTime(), NES::Runtime::Execution::StreamJoinQueryExecutionTest::runSingleJoinQuery(), NES::RequestProcessor::TEST_F(), NES::TEST_F(), NES::Runtime::Execution::TEST_P(), NES::TEST_P(), NES::JoinOperatorBuilder::JoinWhere::window(), and NES::CrossJoinOperatorBuilder::CrossJoin::window().

Here is the caller graph for this function:

◆ limit()

Query & NES::Query::limit ( const uint64_t  limit)

: Limit the number of records according to the limit count.

Parameters
limitCount
Returns
the query

References NES_DEBUG, and queryPlan.

Referenced by TEST_F().

Here is the caller graph for this function:

◆ map()

Query & NES::Query::map ( FieldAssignmentExpressionNodePtr const &  mapExpression)

: Map records according to a map expression. An examplary usage would be: map(Attribute("f2") = Attribute("f1") * 42 )

Parameters
mapexpression
Returns
query

References NES_DEBUG, and queryPlan.

Referenced by NES::CEPOperatorBuilder::And::And(), NES::CrossJoinOperatorBuilder::CrossJoin::CrossJoin(), TEST_F(), NES::TEST_F(), NES::TEST_P(), and NES::CEPOperatorBuilder::Times::Times().

Here is the caller graph for this function:

◆ mapUDF()

Query & NES::Query::mapUDF ( Catalogs::UDF::UDFDescriptorPtr const &  descriptor)

: Create map java udf operator.

Parameters
descriptorjava udf descriptor
Returns
query

References NES_DEBUG, and queryPlan.

◆ orWith()

Query & NES::Query::orWith ( const Query subQuery)

can be called on the original query with the query to be composed with and sets this query in the class Or.

Parameters
subQueryRhs
Returns
the query (pushed to union with)

References getQueryPlan(), NES_DEBUG, and queryPlan.

Here is the call graph for this function:

◆ project() [1/2]

template<typename... Args>
auto NES::Query::project ( Args &&...  args) -> std::enable_if_t<std::conjunction_v<std::is_constructible<ExpressionItem, Args>...>, Query&>
inline

this call projects out the attributes in the parameter list

Parameters
attributelist
Returns
the query

Referenced by TEST_F(), NES::TEST_F(), NES::TEST_P(), and TEST_P().

Here is the caller graph for this function:

◆ project() [2/2]

Query & NES::Query::project ( std::vector< ExpressionNodePtr expressions)

this call projects out the attributes in the parameter list

Parameters
attributelist
Returns
the query

References NES_DEBUG, and queryPlan.

◆ seqWith()

CEPOperatorBuilder::Seq NES::Query::seqWith ( const Query subQueryRhs)

can be called on the original query with the query to be composed with and sets this query in the class Join.

Parameters
subQueryRhs
Returns
CEPOperatorBuilder object where the window() function is defined and can be called by user

Referenced by TEST_F(), NES::TEST_F(), and NES::CEPOperatorBuilder::Seq::window().

Here is the caller graph for this function:

◆ sink()

Query & NES::Query::sink ( SinkDescriptorPtr  sinkDescriptor,
WorkerId  workerId = INVALID_WORKER_NODE_ID 
)
virtual

Add sink operator for the query. The Sink operator is defined by the sink descriptor, which represents the semantic of this sink.

Parameters
sinkDescriptor
workerIdlocation where sink is to be placed

References NES_DEBUG, and queryPlan.

Referenced by UnionQueryExecutionTest::__attribute__(), NES::Statistic::DefaultStatisticQueryGenerator::createStatisticQuery(), NES::Runtime::Execution::StreamJoinQuerySharedExecutionTest::prepareRunTwoEqualQueriesDeployedDifferentTime(), NES::Runtime::Execution::StreamIntervalJoinQueryExecutionTest::runSingleJoinQuery(), NES::Runtime::Execution::StreamJoinQueryExecutionTest::runSingleJoinQuery(), NES::RequestProcessor::TEST_F(), TEST_F(), NES::TEST_F(), NES::TEST_P(), TEST_P(), and NES::Runtime::Execution::TEST_P().

Here is the caller graph for this function:

◆ times() [1/3]

CEPOperatorBuilder::Times NES::Query::times ( )

can be called on the original query to detect multiple occurrences of specified events in a stream

Returns
CEPOperatorBuilder object where the window() function is defined and can be called by user

◆ times() [2/3]

CEPOperatorBuilder::Times NES::Query::times ( const uint64_t  minOccurrences,
const uint64_t  maxOccurrences 
)

can be called on the original query to detect an number event occurrences between minOccurrence and maxOccurrence in a stream

Parameters
minOccurrences
maxOccurrences
Returns
CEPOperatorBuilder object where the window() function is defined and can be called by user

Referenced by TEST_F(), and NES::TEST_F().

Here is the caller graph for this function:

◆ times() [3/3]

CEPOperatorBuilder::Times NES::Query::times ( const uint64_t  occurrences)

can be called on the original query to detect an exact number event occurrences in a stream

Parameters
occurrences
Returns
CEPOperatorBuilder object where the window() function is defined and can be called by user

◆ unionWith()

Query & NES::Query::unionWith ( const Query subQuery)

This looks ugly, but we can't reference to QueryPtr at this line.

Parameters
subQueryis the query to be unioned
Returns
the query

References getQueryPlan(), NES_DEBUG, and queryPlan.

Referenced by UnionQueryExecutionTest::__attribute__(), TEST_F(), and NES::TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ window()

WindowOperatorBuilder::WindowedQuery NES::Query::window ( Windowing::WindowTypePtr const &  windowType)

Referenced by NES::WindowOperatorBuilder::WindowedQuery::apply(), buildStatistic(), TEST_F(), NES::TEST_F(), TEST_P(), NES::TEST_P(), and NES::CEPOperatorBuilder::Times::window().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ CEPOperatorBuilder::And

friend class CEPOperatorBuilder::And
friend

◆ CEPOperatorBuilder::Seq

friend class CEPOperatorBuilder::Seq
friend

◆ CrossJoinOperatorBuilder::CrossJoin

◆ IntervalJoinOperatorBuilder::JoinLowerBound

◆ IntervalJoinOperatorBuilder::JoinWhere

◆ JoinOperatorBuilder::JoinWhere

friend class JoinOperatorBuilder::JoinWhere
friend

◆ NES::Experimental::BatchJoinOperatorBuilder::Join

◆ WindowOperatorBuilder::KeyedWindowedQuery

◆ WindowOperatorBuilder::WindowedQuery

Member Data Documentation

◆ queryPlan


The documentation for this class was generated from the following files: