pub struct OpenSearchTableProviderFactory { /* private fields */ }Expand description
The TableProviderFactory that makes OpenSearch indices reachable from SQL alone:
CREATE EXTERNAL TABLE docs STORED AS OPENSEARCH LOCATION 'http://localhost:9200/my-index';LOCATION is <base url>/<index>. Without a column list the schema is derived from the index
_mapping; with one, only those columns are read. Recognised OPTIONS: page_size,
max_rows, partitions, sort ("field:asc,other:desc"), base_filter (a JSON array of
query-DSL clauses).
Credentials and the HTTP client set on the factory apply to every table it creates.
Implementations§
Source§impl OpenSearchTableProviderFactory
impl OpenSearchTableProviderFactory
pub fn new() -> Self
Sourcepub fn with_client(self, http: Client) -> Self
pub fn with_client(self, http: Client) -> Self
Use this reqwest::Client for every table (timeouts, TLS roots, headers).
Sourcepub fn with_basic_auth(
self,
user: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_basic_auth( self, user: impl Into<String>, password: impl Into<String>, ) -> Self
Send HTTP basic credentials with every request.
Sourcepub fn with_bearer_token(self, token: impl Into<String>) -> Self
pub fn with_bearer_token(self, token: impl Into<String>) -> Self
Send a bearer token with every request.
Sourcepub fn register(self, ctx: &SessionContext)
pub fn register(self, ctx: &SessionContext)
Register this factory on a SessionContext as STORED AS OPENSEARCH.
Trait Implementations§
Source§impl Clone for OpenSearchTableProviderFactory
impl Clone for OpenSearchTableProviderFactory
Source§fn clone(&self) -> OpenSearchTableProviderFactory
fn clone(&self) -> OpenSearchTableProviderFactory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for OpenSearchTableProviderFactory
impl Default for OpenSearchTableProviderFactory
Source§fn default() -> OpenSearchTableProviderFactory
fn default() -> OpenSearchTableProviderFactory
Returns the “default value” for a type. Read more
Source§impl TableProviderFactory for OpenSearchTableProviderFactory
impl TableProviderFactory for OpenSearchTableProviderFactory
Source§fn create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_state: &'life1 dyn Session,
cmd: &'life2 CreateExternalTable,
) -> Pin<Box<dyn Future<Output = DataFusionResult<Arc<dyn TableProvider>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_state: &'life1 dyn Session,
cmd: &'life2 CreateExternalTable,
) -> Pin<Box<dyn Future<Output = DataFusionResult<Arc<dyn TableProvider>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a TableProvider with the given url
Auto Trait Implementations§
impl !RefUnwindSafe for OpenSearchTableProviderFactory
impl !UnwindSafe for OpenSearchTableProviderFactory
impl Freeze for OpenSearchTableProviderFactory
impl Send for OpenSearchTableProviderFactory
impl Sync for OpenSearchTableProviderFactory
impl Unpin for OpenSearchTableProviderFactory
impl UnsafeUnpin for OpenSearchTableProviderFactory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more