Ajay
Ajay

Reputation: 795

U-SQL - Execution related queries

I wrote multiple U-SQL scripts and its output got stored in ADLA, based on this I have few question.

If RecordCount > 0 then
     insert into table1
endif

Upvotes: 1

Views: 364

Answers (1)

Michael Rys
Michael Rys

Reputation: 6684

You can schedule and orchestrate U-SQL jobs with Azure Data Factory or by writing your own scheduler with one of the SDKs (Powershell, C#, Java, node.js, Python).

U-SQL supports two ways for conditional execution:

  1. If your conditional can be evaluated at compile time, e.g., when you pass a parameter value or check for the existence of a file, you can use the IF statement.
  2. If your conditional can only be determined during the execution of the script, then you can use the WHERE clause as wBob outlines in his comment.

As wBob mentions, you can encapsulate most of the U-SQL statements in procedures and then call them from other scripts/procedures, or you can write your own way of inclusion/orchestration if you need script file reuse.

There is currently no ability to reuse and submit just compiled code, since the compilation depends on the exact information such as what files are present and the statistics of the accessed data.

Upvotes: 2

Related Questions