You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "hhvu0102 (via GitHub)" <gi...@apache.org> on 2026/09/25 21:27:08 UTC

[I] How to make sure data from two ports have finished loading? [texera]

hhvu0102 opened a new issue, #8683:
URL: https://github.com/apache/texera/issues/8683

   ### Feature Summary
   
   Opening a new thread since I can't reopen the old discussion here https://github.com/apache/texera/issues/4074
   
   My question is: how can I write a function in a 2-port UDF to access input data at the same time?
   
   For example, if data from `port 0` is `df0`, and data from `port 1` is `df1`, how should I design my code so a function `f(df0, df1)` could be executed properly?
   
   Attached here is an example in my use case, where `port 0` is a df of 19.5k lines and ~200 columns (say `df0`, while data from `port 1` is smaller with 63 lines (say `df1`). AI bot suggested that we put a parameter with a fix number of lines matching with n lines in `df0` to check if `df0` has finished loading, which in general cases would not work.
   
   This is other things I have tried (in pseudocode):
   1) Attempt 1:
   ```
   if port == 0:
   df0 <- df0
   else if port == 1:
   df1 <- df1
   
   #a function that does something with both df0 and df1
   function_to_called(df0, df1)
   ```
   This will not work because `df1` will finish loading before `df0`, and `function_to_called` will throw an error that `df0` is not found.
   2) Attempt 2:
   Same logic as above, but I forced `port 1` data to depend on `port 0` so `port 0` finishes first (as recommended in https://github.com/apache/texera/issues/4074). Now `function_to_called` will throw an error that `df1` is not found, because it's called before `df1` is loaded.
   
   The attached screenshot is in R, but the question stands the same for Python-based UDF.
   
   <img width="2766" height="1738" alt="Image" src="https://github.com/user-attachments/assets/641fdfa6-698c-4d0f-8ffc-75ea613f9c38" />
   
   ### Proposed Solution or Design
   
   I expect a way to check if data has finished loading.
   
   ### Affected Area
   
   _No response_


-- 
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: notifications-unsubscribe@texera.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] How to make sure data from two ports have finished loading? [texera]

Posted by "Ma77Ball (via GitHub)" <gi...@apache.org>.
Ma77Ball commented on issue #8683:
URL: https://github.com/apache/texera/issues/8683#issuecomment-5840373553

   @aglinxinyuan


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] How to make sure data from two ports have finished loading? [texera]

Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan commented on issue #8683:
URL: https://github.com/apache/texera/issues/8683#issuecomment-5844160837

   It's not the same set of conditional blocks I'm working on, but I can still answer the question.
   
   Forcing the data on port 1 to depend on port 0 should be the correct approach.
   
   The only change you might need is to move `function_to_called` next to the `df1` assignment:
   
   ```text
   if port == 0:
       df0 <- df0
   else if port == 1:
       df1 <- df1
       function_to_called(df0, df1)
   ```


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org