#[non_exhaustive]pub struct HivePartitioningOptions {
pub mode: String,
pub source_uri_prefix: String,
pub require_partition_filter: Option<BoolValue>,
pub fields: Vec<String>,
/* private fields */
}Expand description
Options for configuring hive partitioning detect.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.mode: StringOptional. When set, what mode of hive partitioning to use when reading data. The following modes are supported:
-
AUTO: automatically infer partition key name(s) and type(s).
-
STRINGS: automatically infer partition key name(s). All types are strings.
-
CUSTOM: partition key schema is encoded in the source URI prefix.
Not all storage formats support hive partitioning. Requesting hive partitioning on an unsupported format will lead to an error. Currently supported formats are: JSON, CSV, ORC, Avro and Parquet.
source_uri_prefix: StringOptional. When hive partition detection is requested, a common prefix for all source uris must be required. The prefix must end immediately before the partition key encoding begins. For example, consider files following this data layout:
gs://bucket/path_to_table/dt=2019-06-01/country=USA/id=7/file.avro
gs://bucket/path_to_table/dt=2019-05-31/country=CA/id=3/file.avro
When hive partitioning is requested with either AUTO or STRINGS detection, the common prefix can be either of gs://bucket/path_to_table or gs://bucket/path_to_table/.
CUSTOM detection requires encoding the partitioning schema immediately after the common prefix. For CUSTOM, any of
-
gs://bucket/path_to_table/{dt:DATE}/{country:STRING}/{id:INTEGER}
-
gs://bucket/path_to_table/{dt:STRING}/{country:STRING}/{id:INTEGER}
-
gs://bucket/path_to_table/{dt:DATE}/{country:STRING}/{id:STRING}
would all be valid source URI prefixes.
require_partition_filter: Option<BoolValue>Optional. If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified.
Note that this field should only be true when creating a permanent external table or querying a temporary external table.
Hive-partitioned loads with require_partition_filter explicitly set to true will fail.
fields: Vec<String>Output only. For permanent external tables, this field is populated with the hive partition keys in the order they were inferred. The types of the partition keys can be deduced by checking the table schema (which will include the partition keys). Not every API will populate this field in the output. For example, Tables.Get will populate it, but Tables.List will not contain this field.
Implementations§
Source§impl HivePartitioningOptions
impl HivePartitioningOptions
Sourcepub fn set_source_uri_prefix<T: Into<String>>(self, v: T) -> Self
pub fn set_source_uri_prefix<T: Into<String>>(self, v: T) -> Self
Sets the value of source_uri_prefix.
§Example
let x = HivePartitioningOptions::new().set_source_uri_prefix("example");Sourcepub fn set_require_partition_filter<T>(self, v: T) -> Self
pub fn set_require_partition_filter<T>(self, v: T) -> Self
Sets the value of require_partition_filter.
§Example
use wkt::BoolValue;
let x = HivePartitioningOptions::new().set_require_partition_filter(BoolValue::default()/* use setters */);Sourcepub fn set_or_clear_require_partition_filter<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_require_partition_filter<T>(self, v: Option<T>) -> Self
Sets or clears the value of require_partition_filter.
§Example
use wkt::BoolValue;
let x = HivePartitioningOptions::new().set_or_clear_require_partition_filter(Some(BoolValue::default()/* use setters */));
let x = HivePartitioningOptions::new().set_or_clear_require_partition_filter(None::<BoolValue>);Sourcepub fn set_fields<T, V>(self, v: T) -> Self
pub fn set_fields<T, V>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for HivePartitioningOptions
impl Clone for HivePartitioningOptions
Source§fn clone(&self) -> HivePartitioningOptions
fn clone(&self) -> HivePartitioningOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HivePartitioningOptions
impl Debug for HivePartitioningOptions
Source§impl Default for HivePartitioningOptions
impl Default for HivePartitioningOptions
Source§fn default() -> HivePartitioningOptions
fn default() -> HivePartitioningOptions
Source§impl Message for HivePartitioningOptions
impl Message for HivePartitioningOptions
Source§impl PartialEq for HivePartitioningOptions
impl PartialEq for HivePartitioningOptions
impl StructuralPartialEq for HivePartitioningOptions
Auto Trait Implementations§
impl Freeze for HivePartitioningOptions
impl RefUnwindSafe for HivePartitioningOptions
impl Send for HivePartitioningOptions
impl Sync for HivePartitioningOptions
impl Unpin for HivePartitioningOptions
impl UnsafeUnpin for HivePartitioningOptions
impl UnwindSafe for HivePartitioningOptions
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request