target.apidocs.com.google.api.services.bigquery.model.HivePartitioningOptions.html Maven / Gradle / Ivy
HivePartitioningOptions (BigQuery API v2-rev20240905-2.0.0)
com.google.api.services.bigquery.model
Class HivePartitioningOptions
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.services.bigquery.model.HivePartitioningOptions
-
public final class HivePartitioningOptions
extends com.google.api.client.json.GenericJson
Options for configuring hive partitioning detect.
This is the Java data model class that specifies how to parse/serialize into the JSON that is
transmitted over HTTP when working with the BigQuery API. For a detailed explanation see:
https://developers.google.com/api-client-library/java/google-http-java-client/json
- Author:
- Google, Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
-
Constructor Summary
Constructors
Constructor and Description
HivePartitioningOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
HivePartitioningOptions
clone()
List<String>
getFields()
Output only.
String
getMode()
Optional.
Boolean
getRequirePartitionFilter()
Optional.
String
getSourceUriPrefix()
Optional.
boolean
isRequirePartitionFilter()
Convenience method that returns only Boolean.TRUE
or Boolean.FALSE
.
HivePartitioningOptions
set(String fieldName,
Object value)
HivePartitioningOptions
setFields(List<String> fields)
Output only.
HivePartitioningOptions
setMode(String mode)
Optional.
HivePartitioningOptions
setRequirePartitionFilter(Boolean requirePartitionFilter)
Optional.
HivePartitioningOptions
setSourceUriPrefix(String sourceUriPrefix)
Optional.
-
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
-
Methods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
-
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
Method Detail
-
getFields
public List<String> getFields()
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.
- Returns:
- value or
null
for none
-
setFields
public HivePartitioningOptions setFields(List<String> fields)
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.
- Parameters:
fields
- fields or null
for none
-
getMode
public String getMode()
Optional. 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.
- Returns:
- value or
null
for none
-
setMode
public HivePartitioningOptions setMode(String mode)
Optional. 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.
- Parameters:
mode
- mode or null
for none
-
getRequirePartitionFilter
public Boolean getRequirePartitionFilter()
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.
- Returns:
- value or
null
for none
-
setRequirePartitionFilter
public HivePartitioningOptions setRequirePartitionFilter(Boolean requirePartitionFilter)
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.
- Parameters:
requirePartitionFilter
- requirePartitionFilter or null
for none
-
isRequirePartitionFilter
public boolean isRequirePartitionFilter()
Convenience method that returns only Boolean.TRUE
or Boolean.FALSE
.
Boolean properties can have four possible values:
null
, Data.NULL_BOOLEAN
, Boolean.TRUE
or Boolean.FALSE
.
This method returns Boolean.TRUE
if the default of the property is Boolean.TRUE
and it is null
or Data.NULL_BOOLEAN
.
Boolean.FALSE
is returned if the default of the property is Boolean.FALSE
and
it is null
or Data.NULL_BOOLEAN
.
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.
-
getSourceUriPrefix
public String getSourceUriPrefix()
Optional. 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.
- Returns:
- value or
null
for none
-
setSourceUriPrefix
public HivePartitioningOptions setSourceUriPrefix(String sourceUriPrefix)
Optional. 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.
- Parameters:
sourceUriPrefix
- sourceUriPrefix or null
for none
-
set
public HivePartitioningOptions set(String fieldName,
Object value)
- Overrides:
set
in class com.google.api.client.json.GenericJson
-
clone
public HivePartitioningOptions clone()
- Overrides:
clone
in class com.google.api.client.json.GenericJson
Copyright © 2011–2024 Google. All rights reserved.