Jacek Laskowski created SPARK-62362:
---------------------------------------

             Summary: Don't hardcode Python as the origin language for datasets 
and flows registered via Spark Connect in PipelinesHandler
                 Key: SPARK-62362
                 URL: https://issues.apache.org/jira/browse/SPARK-62362
             Project: Spark
          Issue Type: Improvement
          Components: Connect, Declarative Pipelines
    Affects Versions: 4.3.0
            Reporter: Jacek Laskowski


{{PipelinesHandler}} 
({{{}sql/connect/server/src/main/scala/org/apache/spark/sql/connect/pipelines/PipelinesHandler.scala{}}})
 sets the origin language to {{Python}} when it registers pipeline objects such 
as views. This was seen on the View origin at the line changed in #60532 
(SPARK-61750), where {{Some(Python())}} became {{{}Some(Python){}}}.

The server only knows that the request came from a Spark Connect client. It has 
no evidence that the client is Python. The assumption holds in practice because 
the Python client is currently the only Spark Connect client for pipelines, so 
it is probably right almost all the time. It breaks when the RPCs are called 
directly, as some of the tests do. In that case the recorded origin language 
can be wrong.

This came up in review of #60532 
([https://github.com/apache/spark/pull/60532#discussion_r4668376839]). The 
reviewer noted it was unrelated to that PR and said the code should probably be 
hardened later. @holdenk agreed that a follow-up ticket was a good idea.

*Proposed direction:*
 * Have the client state the origin language explicitly in the request, for 
example, an optional field in the pipelines proto. The server would then use it 
rather than assuming.
 * When the field is absent, fall back to an unknown or unspecified value, or 
to the current Python default if backward compatibility requires it.
 * Add tests that call the RPCs directly without a language and check the 
recorded origin.

*Links:* relates to #SPARK-61750 ([PR 
#60532|https://github.com/apache/spark/pull/60532#discussion_r4668376839])



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to