itholic opened a new pull request, #43237:
URL: https://github.com/apache/spark/pull/43237

   ### What changes were proposed in this pull request?
   
   This PR proposes to fix `ps.sql` with Spark Connect.
   
   ### Why are the changes needed?
   
   Improve the API coverage.
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   `ps.sql` with Pandas on Spark object now support for Spark Connect:
   
   **Before**
   ```python
   >>> psdf = ps.DataFrame(
   ...     {"A": [1, 2, 3], "B": [4, 5, 6]}, index=pd.Index(["a", "b", "c"], 
name="index")
   ... )
   >>> ps.sql("select * from {psdf} where A > 1", psdf=psdf)
   org.apache.spark.sql.catalyst.ExtendedAnalysisException: 
[TABLE_OR_VIEW_NOT_FOUND] The table or view 
`_pandas_api_d2d7164cc1894c8895bc7f0c541db96b` cannot be found. Verify the 
spelling and correctness of the schema and catalog.
   If you did not qualify the name with a schema, verify the current_schema() 
output, or qualify the name with the correct schema and catalog.
   To tolerate the error on drop use DROP VIEW IF EXISTS or DROP TABLE IF 
EXISTS.; line 1 pos 14;
   ```
   
   **After**
   ```python
   >>> psdf = ps.DataFrame(
   ...     {"A": [1, 2, 3], "B": [4, 5, 6]}, index=pd.Index(["a", "b", "c"], 
name="index")
   ... )
   >>> ps.sql("select * from {psdf} where A > 1", psdf=psdf)
      A  B
   0  2  5
   1  3  6
   ```
   
   
   ### How was this patch tested?
   
   Enabling the existing test
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.
   


-- 
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