源选项中的 Azure 数据工厂递归查询

Azure Data Factory Recursive Query in source option

我正在尝试使用查询选项在 Azure 数据工厂源中执行递归查询。

然而,即使在 with 语句之前写 go;,数据工厂也是无法投影列。如果我写(在 with 子句之前):

所以我想知道在 Azure 数据工厂中是否不允许使用这种代码,或者我是否遗漏了什么。

您可以在数据流的源选项中输入的查询非常有限,因为它甚至不支持 order by 子句。但是,您可以引用用户定义的函数,这样您就可以将 CTE 嵌套在 UDF 中,然后从源选项中引用它。

REF:Source transformation

Query: If you select Query in the input field, enter a SQL query for your source. This setting overrides any table that you've chosen in the dataset. Order By clauses aren't supported here, but you can set a full SELECT FROM statement. You can also use user-defined table functions. select * from udfGetData() is a UDF in SQL that returns a table. This query will produce a source table that you can use in your data flow. Using queries is also a great way to reduce rows for testing or for lookups.