You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "MrPowers (via GitHub)" <gi...@apache.org> on 2025/09/14 17:32:00 UTC

[I] enhancement: create or replace view [sedona-db]

MrPowers opened a new issue, #80:
URL: https://github.com/apache/sedona-db/issues/80

   Here's how to make a view: `cities.to_view("cities")`.
   
   Here's the error if a view already exists:
   
   ```
   SedonaError                               Traceback (most recent call last)
   Cell In[15], line 1
   ----> 1 cities.to_view("cities")
         2 countries.to_view("countries")
   
   File [/opt/miniconda3/lib/python3.12/site-packages/sedonadb/dataframe.py:175](http://localhost:8888/opt/miniconda3/lib/python3.12/site-packages/sedonadb/dataframe.py#line=174), in DataFrame.to_view(self, name, overwrite)
       151 def to_view(self, name: str, overwrite: bool = False):
       152     """Create a view based on the query represented by this object
       153 
       154     Registers this logical plan as a named view with the underlying context
      (...)
       173 
       174     """
   --> 175     self._impl.to_view(self._ctx, name, overwrite)
   
   SedonaError: The table cities already exists
   ```
   
   I'm currently running this:
   
   ```python
   sd.sql("drop view if exists cities")
   cities.to_view("cities")
   ```
   
   Maybe we can support this syntax:
   
   ```python
   cities.to_view("cities", mode="replace")
   ```


-- 
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: issues-unsubscribe@sedona.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] enhancement: create or replace view [sedona-db]

Posted by "MrPowers (via GitHub)" <gi...@apache.org>.
MrPowers closed issue #80: enhancement: create or replace view
URL: https://github.com/apache/sedona-db/issues/80


-- 
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: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] enhancement: create or replace view [sedona-db]

Posted by "MrPowers (via GitHub)" <gi...@apache.org>.
MrPowers commented on issue #80:
URL: https://github.com/apache/sedona-db/issues/80#issuecomment-3290249333

   Oh, this already exists, nice, thank you!!


-- 
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: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] enhancement: create or replace view [sedona-db]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on issue #80:
URL: https://github.com/apache/sedona-db/issues/80#issuecomment-3290187046

   Would `to_view("cities", overwrite=True)` work for you?
   
   https://sedona.apache.org/sedonadb/dev-snapshot-main/reference/python/#sedonadb.dataframe.DataFrame.to_view
   
   (This syntax comes from how Ibis and DuckDB parameterize that operation)


-- 
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: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org