transforms
BucketTransform
¶
Bases: Transform[S, int]
Base Transform class to transform a value into a bucket partition value.
Transforms are parameterized by a number of buckets. Bucket partition transforms use a 32-bit hash of the source value to produce a positive value by mod the bucket number.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_buckets |
int
|
The number of buckets. |
required |
Source code in pyiceberg/transforms.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
|
DayTransform
¶
Bases: TimeTransform[S]
Transforms a datetime value into a day value.
Example
transform = MonthTransform() transform.transform(DateType())(17501) 17501
Source code in pyiceberg/transforms.py
HourTransform
¶
Bases: TimeTransform[S]
Transforms a datetime value into a hour value.
Example
transform = HourTransform() transform.transform(TimestampType())(1512151975038194) 420042
Source code in pyiceberg/transforms.py
IdentityTransform
¶
Bases: Transform[S, S]
Transforms a value into itself.
Example
transform = IdentityTransform() transform.transform(StringType())('hello-world') 'hello-world'
Source code in pyiceberg/transforms.py
MonthTransform
¶
Bases: TimeTransform[S]
Transforms a datetime value into a month value.
Example
transform = MonthTransform() transform.transform(DateType())(17501) 575
Source code in pyiceberg/transforms.py
Transform
¶
Bases: IcebergRootModel[str]
, ABC
, Generic[S, T]
Transform base class for concrete transforms.
A base class to transform values and project predicates on partition values. This class is not used directly. Instead, use one of module method to create the child classes.
Source code in pyiceberg/transforms.py
__eq__(other)
¶
Return the equality of two instances of the Transform class.
TruncateTransform
¶
Bases: Transform[S, S]
A transform for truncating a value to a specified width.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
width |
int
|
The truncate width, should be positive. |
required |
Raises: ValueError: If a type is provided that is incompatible with a Truncate transform.
Source code in pyiceberg/transforms.py
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 |
|
UnknownTransform
¶
Bases: Transform[S, T]
A transform that represents when an unknown transform is provided.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
transform |
str
|
A string name of a transform. |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
source_type |
IcebergType
|
An Iceberg |
Source code in pyiceberg/transforms.py
VoidTransform
¶
Bases: Transform[S, None]
, Singleton
A transform that always returns None.
Source code in pyiceberg/transforms.py
YearTransform
¶
Bases: TimeTransform[S]
Transforms a datetime value into a year value.
Example
transform = YearTransform() transform.transform(TimestampType())(1512151975038194) 47