@Ankit Mishra
Thank you for sharing the details of the intermittent issue with the Lookup activity in ADF when fetching data from Snowflake. It seems like the query is sometimes returning unexpected results, specifically zero rows.
Here are some potential causes and best practices to ensure more consistent results.
Query Execution Context - Ensure that the query being executed in the Lookup activity is the same as the one you run directly in Snowflake. Any differences in the execution context, such as user permissions or session settings, could lead to different results.
Data Caching - ADF may cache results from previous executions. If the underlying data in Snowflake changes between executions, it could lead to inconsistencies. Consider adding a mechanism to clear or manage cache if applicable.
Timeouts and Limits - The Lookup activity has a maximum output size of 4 MB and can return up to 5000 rows. If your query is close to these limits, it may fail to return results consistently. Make sure your query is optimized to stay within these constraints.
Error Handling - Implement error handling in your ADF pipeline to log and manage any failures that occur during the Lookup activity. This can help you identify patterns or specific conditions under which the issue arises.
Connection Configuration - Review the connection settings in ADF. Ensure that the connection to Snowflake is stable and that there are no intermittent connectivity issues. You might want to test the connection from ADF to Snowflake to confirm it’s working as expected.
If these steps do not resolve the issue, please share details about your Snowflake connection configuration in ADF, the query used, and any error messages or logs. We can further analyze and provide more targeted guidance.
For more details, please refer to the below Microsoft documentations.
Limitations and workarounds
Troubleshoot connector and format issues in mapping data flows in Azure Data Factory
I hope this information helps.
Thank you.