ebyhr opened a new pull request, #3415:
URL: https://github.com/apache/iceberg-python/pull/3415

   # Rationale for this change
   
   PyIceberg users currently need to provide a large object when creating a 
view. 
   ```python
   dentifier = "default.some_view"
   schema = pa.schema([pa.field("some_col", pa.int32())])
   view_version = ViewVersion(
       version_id=1,
       schema_id=1,
       timestamp_ms=int(time.time() * 1000),
       summary={},
       representations=[
           SQLViewRepresentation(
               type="sql",
               sql="SELECT 1 as some_col",
               dialect="spark",
           )
       ],
       default_namespace=["default"],
   )
   
   catalog.create_view(
       identifier=identifier,
       schema=schema,
       view_version=view_version,
   )
   ```
   
   The `version_id`, `schema_id`, and `timestamp_ms` fields appear redundant 
because we can internally initialize them. This PR introduces a new 
`create_sql_view` method. 
   ```python
   catalog.create_sql_view(
       identifier=identifier,
       schema=schema,
       dialect="spark",
       sql="SELECT 1 as some_col",
       default_namespace=("default",),
   )
   ```
   
   ## Are these changes tested?
   
   Yes
   
   ## Are there any user-facing changes?
   
   Add `create_sql_view` method to `Catalog`
   
   <!-- In the case of user-facing changes, please add the changelog label. -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to