Skip to content

Exception in airport_dynamic_table_function #21

@cmettler

Description

@cmettler

Hi Rusty,
the following table function with a table input throws an exception "airport_dynamic_table_function: write record batch Destination already closed". The table function just echoes the input by binding every input row to sql server parameters , executing the provided statement and returning the result.
`
with params as
(
select txt:'hello',num:12
union all
select txt:'world',num:15
),
result as
(
select
*
from test.dbo.execute_apply
(
'select cast(@num as int) as num,cast(@txt as varchar(max)) as txt',
(select txt,num from params)
)
)

select * from result
--order by all
`
when debugging i see calls to

  1. AirportTakeFlightInOut with one recordbatch containing one 1 row
  2. AirportTakeFlightInOutFinalize where global_state.writer->DoneWriting() closes the input recordbatch stream in my side which then sends the final finished recordbatch.
  3. another AirportTakeFlightInOut with one recordbatch containing one 1 row (the other row of the parameters union). This now fails because the writer is closed from previous DoneWriting call

KR
Christoph

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions