|
73 | 73 | ) |
74 | 74 | from pyiceberg.utils.config import Config, merge_config |
75 | 75 | from pyiceberg.utils.properties import property_as_bool |
| 76 | +from pyiceberg.view import View |
| 77 | +from pyiceberg.view.metadata import ViewVersion |
76 | 78 |
|
77 | 79 | if TYPE_CHECKING: |
78 | 80 | import pyarrow as pa |
@@ -657,6 +659,32 @@ def drop_view(self, identifier: Union[str, Identifier]) -> None: |
657 | 659 | NoSuchViewError: If a view with the given name does not exist. |
658 | 660 | """ |
659 | 661 |
|
| 662 | + @abstractmethod |
| 663 | + def create_view( |
| 664 | + self, |
| 665 | + identifier: Union[str, Identifier], |
| 666 | + schema: Union[Schema, "pa.Schema"], |
| 667 | + view_version: ViewVersion, |
| 668 | + location: Optional[str] = None, |
| 669 | + properties: Properties = EMPTY_DICT, |
| 670 | + ) -> View: |
| 671 | + """Create a view. |
| 672 | +
|
| 673 | + Args: |
| 674 | + identifier (str | Identifier): View identifier. |
| 675 | + schema (Schema): View's schema. |
| 676 | + location (str | None): Location for the view. Optional Argument. |
| 677 | + partition_spec (PartitionSpec): PartitionSpec for the view. |
| 678 | + sort_order (SortOrder): SortOrder for the view. |
| 679 | + properties (Properties): View properties that can be a string based dictionary. |
| 680 | +
|
| 681 | + Returns: |
| 682 | + View: the created view instance. |
| 683 | +
|
| 684 | + Raises: |
| 685 | + ViewAlreadyExistsError: If a view with the name already exists. |
| 686 | + """ |
| 687 | + |
660 | 688 | @staticmethod |
661 | 689 | def identifier_to_tuple(identifier: Union[str, Identifier]) -> Identifier: |
662 | 690 | """Parse an identifier to a tuple. |
|
0 commit comments