CurtHagenlocher commented on issue #4771:
URL: https://github.com/apache/arrow-adbc/issues/4771#issuecomment-7150845507

   > if we start using actions in more and more scenarios as suggested it will 
get awkward when an action also needs an input dataset. The bind slot is the 
obvious place for the data, so any other parameters have to go somewhere else, 
most likely into other options.
   
   Thanks for calling this out. I realized this also when I was thinking about 
the design but quickly recognized this as a gap in the overall specification 
and not specifically limited to this scenario. For instance, in MSSQL you can 
define table-valued parameters to a stored function or procedure that don't 
have to be entirely materialized. For instance,
   ```
   CREATE TYPE dbo.Customers AS TABLE
   (
       CustomerId int,
       Name nvarchar(100)
   );
   GO
   
   CREATE TYPE dbo.Orders AS TABLE
   (
       OrderId int,
       CustomerId int,
       Amount decimal(18,2)
   );
   GO
   
   CREATE FUNCTION dbo.MatchOrders(
       @customers dbo.Customers READONLY,
       @orders dbo.Orders READONLY,
       @multiplier numeric(5, 3)
   )
   RETURNS TABLE
   AS
   RETURN
   (
       SELECT c.Name, o.OrderId, o.Amount * @multiplier as Amount
       FROM @customers AS c
       JOIN @orders AS o
           ON c.CustomerId = o.CustomerId
   );
   ```
   The only way we can support this today is by having a single row of input 
parameters where the two tabular values are nested arrays of structs. This 
precludes streaming those parameters.
   
   AFAIK MSSQL is the only database whose client protocol allows these 
arguments to be streamed, but the principle is more general. And yeah, you're 
right that for binding a stream of data for ingestion this would be a more 
serious gap.


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

Reply via email to