get_partitions
¶
get_partitions(
database_name: NameString,
table_name: NameString,
*,
config_overrides: Optional[GlueClientConfig] = 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/glue.py
10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 | |