dtenedor commented on PR #60311:
URL: https://github.com/apache/spark/pull/60311#issuecomment-6836399828

   @AlejandroMorgante Yes, I think it's a useful starting point, mainly as a 
reference implementation and as evidence for a design doc. Several choices 
should carry over as they are: workers resolving credentials so nothing secret 
enters the plan, the split between errors that always fail and errors that 
follow the error policy, `Retry-After` handling, and tests that run against a 
local server.
   
   For SQL, I lean toward a built-in function backed by a dedicated Catalyst 
expression and its own evaluation operator, not 
`FunctionCatalog`/`ScalarFunction`:
   
   - `UnboundFunction.bind` receives only positional argument types. It can't 
see argument names or constant values, so the result type can't depend on an 
argument the way `from_json`'s does, and the endpoint can't be checked at 
analysis time.
   - `ScalarFunction` is evaluated one row at a time, with no place to batch 
requests or bound concurrency per partition.
   - The optimizer's only lever is `isDeterministic`. Deterministic lets it 
duplicate the call when a query filters on the result; non-deterministic blocks 
filter and limit pushdown, which is behind the `show()` behavior reported 
above. I measured both on 4.3.0 and can share the scripts.
   
   The direction I have in mind is a SQL surface in Catalyst with support for 
named parameters; a partition-level backend interface so providers are 
pluggable; and a small default backend. The DataFrame functions would be thin 
wrappers over the same expression.
   
   Because this needs planner changes, I think it should go through an SPIP. 
Would you like to co-author it? In the meantime, could this PR stay in draft as 
the reference?


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