get_partitions
async
¶
get_partitions(
database_name: NameString,
table_name: NameString,
*,
config_overrides: Optional[AsyncGlueClientConfig] = None,
catalog_id: Optional[CatalogIdString] = None,
expression: Optional[PredicateString] = None,
next_token: Optional[Token] = None,
segment: Optional[Segment] = None,
max_results: Optional[PageSize] = None,
exclude_column_schema: Optional[BooleanNullable] = None,
transaction_id: Optional[TransactionIdString] = None,
query_as_of_time: Optional[Timestamp] = None,
audit_context: Optional[AuditContext] = None,
) -> GetPartitionsResponse
Retrieves information about the partitions in a table.
Parameters:
-
catalog_id(Optional[CatalogIdString], default:None) –The ID of the Data Catalog where the partitions in question reside. If none is provided, the Amazon Web Services account ID is used by default.
-
database_name(NameString) –The name of the catalog database where the partitions reside.
-
table_name(NameString) –The name of the partitions' table.
-
expression(Optional[PredicateString], default:None) –An expression that filters the partitions to be returned.
The expression uses SQL syntax similar to the SQL
WHEREfilter clause. The SQL statement parser JSQLParser parses the expression.Operators: The following are the operators that you can use in the
ExpressionAPI call:- =
-
Checks whether the values of the two operands are equal; if yes, then the condition becomes true.
Example: Assume 'variable a' holds 10 and 'variable b' holds 20.
(a = b) is not true.
- < >
-
Checks whether the values of two operands are equal; if the values are not equal, then the condition becomes true.
Example: (a < > b) is true.
- >
-
Checks whether the value of the left operand is greater than the value of the right operand; if yes, then the condition becomes true.
Example: (a > b) is not true.
- <
-
Checks whether the value of the left operand is less than the value of the right operand; if yes, then the condition becomes true.
Example: (a < b) is true.
- >=
-
Checks whether the value of the left operand is greater than or equal to the value of the right operand; if yes, then the condition becomes true.
Example: (a >= b) is not true.
- <=
-
Checks whether the value of the left operand is less than or equal to the value of the right operand; if yes, then the condition becomes true.
Example: (a <= b) is true.
- AND, OR, IN, BETWEEN, LIKE, NOT, IS NULL
-
Logical operators.
Supported Partition Key Types: The following are the supported partition keys.
-
string -
date -
timestamp -
int -
bigint -
long -
tinyint -
smallint -
decimal
If an type is encountered that is not valid, an exception is thrown.
The following list shows the valid operators on each type. When you define a crawler, the
partitionKeytype is created as aSTRING, to be compatible with the catalog partitions.Sample API Call:
-
next_token(Optional[Token], default:None) –A continuation token, if this is not the first call to retrieve these partitions.
-
segment(Optional[Segment], default:None) –The segment of the table's partitions to scan in this request.
-
max_results(Optional[PageSize], default:None) –The maximum number of partitions to return in a single response.
-
exclude_column_schema(Optional[BooleanNullable], default:None) –When true, specifies not returning the partition column schema. Useful when you are interested only in other partition attributes such as partition values or location. This approach avoids the problem of a large response by not returning duplicate data.
-
transaction_id(Optional[TransactionIdString], default:None) –The transaction ID at which to read the partition contents.
-
query_as_of_time(Optional[Timestamp], default:None) –The time as of when to read the partition contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with
TransactionId.
Raises:
-
EntityNotFoundException–A specified entity does not exist
-
FederationSourceException–A federation source failed.
-
FederationSourceRetryableException–A federation source failed, but the operation may be retried.
-
GlueEncryptionException–An encryption operation failed.
-
InternalServiceException–An internal service error occurred.
-
InvalidInputException–The input provided was not valid.
-
InvalidStateException–An error that indicates your data is in an invalid state.
-
OperationTimeoutException–The operation timed out.
-
ResourceNotReadyException–A resource was not ready for a transaction.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_glue/_services/async_glue.py
11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 | |