Files
greptimedb/query/query_engine/trait.QueryEngine.html
2025-12-23 03:52:51 +00:00

53 lines
17 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `QueryEngine` trait in crate `query`."><title>QueryEngine in query::query_engine - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="query" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">QueryEngine</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../query/index.html">query</a><span class="version">1.0.0-beta.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Query<wbr>Engine</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.as_any" title="as_any">as_any</a></li><li><a href="#tymethod.describe" title="describe">describe</a></li><li><a href="#tymethod.engine_context" title="engine_context">engine_context</a></li><li><a href="#tymethod.engine_state" title="engine_state">engine_state</a></li><li><a href="#tymethod.execute" title="execute">execute</a></li><li><a href="#tymethod.name" title="name">name</a></li><li><a href="#tymethod.planner" title="planner">planner</a></li><li><a href="#tymethod.read_table" title="read_table">read_table</a></li><li><a href="#tymethod.register_aggregate_function" title="register_aggregate_function">register_aggregate_function</a></li><li><a href="#tymethod.register_scalar_function" title="register_scalar_function">register_scalar_function</a></li><li><a href="#tymethod.register_table_function" title="register_table_function">register_table_function</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In query::<wbr>query_<wbr>engine</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">query</a>::<wbr><a href="index.html">query_engine</a></div><h1>Trait <span class="trait">Query<wbr>Engine</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/query/query_engine.rs.html#58-100">Source</a> </span></div><pre class="rust item-decl"><code>pub trait QueryEngine: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> {
// Required methods
fn <a href="#tymethod.as_any" class="fn">as_any</a>(&amp;self) -&gt; &amp;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.planner" class="fn">planner</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;dyn <a class="trait" href="../planner/trait.LogicalPlanner.html" title="trait query::planner::LogicalPlanner">LogicalPlanner</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.name" class="fn">name</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.describe" class="fn">describe</a>&lt;'life0, 'async_trait&gt;(
&amp;'life0 self,
plan: LogicalPlan,
query_ctx: QueryContextRef,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="type" href="../error/type.Result.html" title="type query::error::Result">Result</a>&lt;<a class="struct" href="struct.DescribeResult.html" title="struct query::query_engine::DescribeResult">DescribeResult</a>&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait&gt;&gt;
<span class="where">where Self: 'async_trait,
'life0: 'async_trait</span>;
<span class="item-spacer"></span> fn <a href="#tymethod.execute" class="fn">execute</a>&lt;'life0, 'async_trait&gt;(
&amp;'life0 self,
plan: LogicalPlan,
query_ctx: QueryContextRef,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="type" href="../error/type.Result.html" title="type query::error::Result">Result</a>&lt;Output&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait&gt;&gt;
<span class="where">where Self: 'async_trait,
'life0: 'async_trait</span>;
<span class="item-spacer"></span> fn <a href="#tymethod.register_aggregate_function" class="fn">register_aggregate_function</a>(&amp;self, func: AggregateUDF);
<span class="item-spacer"></span> fn <a href="#tymethod.register_scalar_function" class="fn">register_scalar_function</a>(&amp;self, func: ScalarFunctionFactory);
<span class="item-spacer"></span> fn <a href="#tymethod.register_table_function" class="fn">register_table_function</a>(&amp;self, func: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;TableFunction&gt;);
<span class="item-spacer"></span> fn <a href="#tymethod.read_table" class="fn">read_table</a>(&amp;self, table: TableRef) -&gt; <a class="type" href="../error/type.Result.html" title="type query::error::Result">Result</a>&lt;DataFrame&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.engine_context" class="fn">engine_context</a>(&amp;self, query_ctx: QueryContextRef) -&gt; <a class="struct" href="struct.QueryEngineContext.html" title="struct query::query_engine::QueryEngineContext">QueryEngineContext</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.engine_state" class="fn">engine_state</a>(&amp;self) -&gt; &amp;<a class="struct" href="struct.QueryEngineState.html" title="struct query::query_engine::QueryEngineState">QueryEngineState</a>;
}</code></pre><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.as_any" class="method"><a class="src rightside" href="../../src/query/query_engine.rs.html#61">Source</a><h4 class="code-header">fn <a href="#tymethod.as_any" class="fn">as_any</a>(&amp;self) -&gt; &amp;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a></h4></section></summary><div class="docblock"><p>Returns the query engine as Any
so that it can be downcast to a specific implementation.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.planner" class="method"><a class="src rightside" href="../../src/query/query_engine.rs.html#64">Source</a><h4 class="code-header">fn <a href="#tymethod.planner" class="fn">planner</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;dyn <a class="trait" href="../planner/trait.LogicalPlanner.html" title="trait query::planner::LogicalPlanner">LogicalPlanner</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the logical planner</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.name" class="method"><a class="src rightside" href="../../src/query/query_engine.rs.html#67">Source</a><h4 class="code-header">fn <a href="#tymethod.name" class="fn">name</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns the query engine name.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.describe" class="method"><a class="src rightside" href="../../src/query/query_engine.rs.html#70-74">Source</a><h4 class="code-header">fn <a href="#tymethod.describe" class="fn">describe</a>&lt;'life0, 'async_trait&gt;(
&amp;'life0 self,
plan: LogicalPlan,
query_ctx: QueryContextRef,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="type" href="../error/type.Result.html" title="type query::error::Result">Result</a>&lt;<a class="struct" href="struct.DescribeResult.html" title="struct query::query_engine::DescribeResult">DescribeResult</a>&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait&gt;&gt;<div class="where">where
Self: 'async_trait,
'life0: 'async_trait,</div></h4></section></summary><div class="docblock"><p>Describe the given [<code>LogicalPlan</code>].</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.execute" class="method"><a class="src rightside" href="../../src/query/query_engine.rs.html#77">Source</a><h4 class="code-header">fn <a href="#tymethod.execute" class="fn">execute</a>&lt;'life0, 'async_trait&gt;(
&amp;'life0 self,
plan: LogicalPlan,
query_ctx: QueryContextRef,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="type" href="../error/type.Result.html" title="type query::error::Result">Result</a>&lt;Output&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait&gt;&gt;<div class="where">where
Self: 'async_trait,
'life0: 'async_trait,</div></h4></section></summary><div class="docblock"><p>Execute the given [<code>LogicalPlan</code>].</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.register_aggregate_function" class="method"><a class="src rightside" href="../../src/query/query_engine.rs.html#83">Source</a><h4 class="code-header">fn <a href="#tymethod.register_aggregate_function" class="fn">register_aggregate_function</a>(&amp;self, func: AggregateUDF)</h4></section></summary><div class="docblock"><p>Register an aggregate function.</p>
<h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
<p>Will panic if the function with same name is already registered.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.register_scalar_function" class="method"><a class="src rightside" href="../../src/query/query_engine.rs.html#87">Source</a><h4 class="code-header">fn <a href="#tymethod.register_scalar_function" class="fn">register_scalar_function</a>(&amp;self, func: ScalarFunctionFactory)</h4></section></summary><div class="docblock"><p>Register a scalar function.
Will override if the function with same name is already registered.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.register_table_function" class="method"><a class="src rightside" href="../../src/query/query_engine.rs.html#90">Source</a><h4 class="code-header">fn <a href="#tymethod.register_table_function" class="fn">register_table_function</a>(&amp;self, func: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;TableFunction&gt;)</h4></section></summary><div class="docblock"><p>Register table function</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.read_table" class="method"><a class="src rightside" href="../../src/query/query_engine.rs.html#93">Source</a><h4 class="code-header">fn <a href="#tymethod.read_table" class="fn">read_table</a>(&amp;self, table: TableRef) -&gt; <a class="type" href="../error/type.Result.html" title="type query::error::Result">Result</a>&lt;DataFrame&gt;</h4></section></summary><div class="docblock"><p>Create a DataFrame from a table.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.engine_context" class="method"><a class="src rightside" href="../../src/query/query_engine.rs.html#96">Source</a><h4 class="code-header">fn <a href="#tymethod.engine_context" class="fn">engine_context</a>(&amp;self, query_ctx: QueryContextRef) -&gt; <a class="struct" href="struct.QueryEngineContext.html" title="struct query::query_engine::QueryEngineContext">QueryEngineContext</a></h4></section></summary><div class="docblock"><p>Create a <a href="struct.QueryEngineContext.html" title="struct query::query_engine::QueryEngineContext"><code>QueryEngineContext</code></a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.engine_state" class="method"><a class="src rightside" href="../../src/query/query_engine.rs.html#99">Source</a><h4 class="code-header">fn <a href="#tymethod.engine_state" class="fn">engine_state</a>(&amp;self) -&gt; &amp;<a class="struct" href="struct.QueryEngineState.html" title="struct query::query_engine::QueryEngineState">QueryEngineState</a></h4></section></summary><div class="docblock"><p>Retrieve the query engine state <a href="struct.QueryEngineState.html" title="struct query::query_engine::QueryEngineState"><code>QueryEngineState</code></a></p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-QueryEngine-for-DatafusionQueryEngine" class="impl"><a class="src rightside" href="../../src/query/datafusion.rs.html#445-592">Source</a><a href="#impl-QueryEngine-for-DatafusionQueryEngine" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.QueryEngine.html" title="trait query::query_engine::QueryEngine">QueryEngine</a> for <a class="struct" href="../datafusion/struct.DatafusionQueryEngine.html" title="struct query::datafusion::DatafusionQueryEngine">DatafusionQueryEngine</a></h3></section></div><script src="../../trait.impl/query/query_engine/trait.QueryEngine.js" async></script></section></div></main></body></html>