Updated TweetAnalysis TVF example to infer the result type

This commit is contained in:
Mike Rys 2016-06-07 17:43:11 -07:00
Родитель 6ee5532ece
Коммит f0decea3b4
2 изменённых файлов: 27 добавлений и 9 удалений

Просмотреть файл

@ -7,11 +7,14 @@
DROP FUNCTION IF EXISTS TweetAndMentionsTVF;
// CREATE FUNCTION can either infer result type or require the result to adhere to the specified result type
CREATE FUNCTION TweetAndMentionsTVF(@path string ="default")
RETURNS @res TABLE(author string, category string, tweetcount long?, file_origin SQL.ARRAY<string>, mentioned_by SQL.ARRAY<string>)
RETURNS @res
//RETURNS @res TABLE(author string, category string, tweetcount long?, file_origin SQL.ARRAY<string>, mentioned_by SQL.ARRAY<string>)
AS
BEGIN
// In order to see the user-code inside the TVF, you have to reference the assembly inside the TVF body.
REFERENCE ASSEMBLY TweetAnalysis;
@t =

Просмотреть файл

@ -25,10 +25,13 @@
</PropertyGroup>
<ItemGroup>
<Script Include="1-SimpleAnalysis-1File.usql">
<UseLocalComputeAccount>true</UseLocalComputeAccount>
<UseLocalComputeAccount>false</UseLocalComputeAccount>
<LocalComputeAccount>localcomputeaccount</LocalComputeAccount>
<LocalDatabase>master</LocalDatabase>
<LocalSchema>dbo</LocalSchema>
<ClusterComputeAccount>mryskona</ClusterComputeAccount>
<ClusterDatabase>master</ClusterDatabase>
<ClusterSchema>dbo</ClusterSchema>
</Script>
<Script Include="2-ExtractMentions-InlineCode-1File.usql">
<UseLocalComputeAccount>false</UseLocalComputeAccount>
@ -40,19 +43,25 @@
<ClusterSchema>dbo</ClusterSchema>
</Script>
<Script Include="3-ExtractMentions-CodeBehind-1File.usql">
<UseLocalComputeAccount>true</UseLocalComputeAccount>
<UseLocalComputeAccount>false</UseLocalComputeAccount>
<LocalComputeAccount>localcomputeaccount</LocalComputeAccount>
<LocalDatabase>master</LocalDatabase>
<LocalSchema>dbo</LocalSchema>
<ClusterComputeAccount>mryskona</ClusterComputeAccount>
<ClusterDatabase>master</ClusterDatabase>
<ClusterSchema>dbo</ClusterSchema>
</Script>
<Script Include="4-ExtractMentions-RefAsm-1File.usql">
<UseLocalComputeAccount>true</UseLocalComputeAccount>
<UseLocalComputeAccount>false</UseLocalComputeAccount>
<LocalComputeAccount>localcomputeaccount</LocalComputeAccount>
<LocalDatabase>master</LocalDatabase>
<LocalSchema>dbo</LocalSchema>
<ClusterComputeAccount>mryskona</ClusterComputeAccount>
<ClusterDatabase>master</ClusterDatabase>
<ClusterSchema>dbo</ClusterSchema>
</Script>
<Script Include="5-ExtractMentions-RefAsm-FileSet.usql">
<UseLocalComputeAccount>true</UseLocalComputeAccount>
<UseLocalComputeAccount>false</UseLocalComputeAccount>
<LocalComputeAccount>localcomputeaccount</LocalComputeAccount>
<LocalDatabase>master</LocalDatabase>
<LocalSchema>dbo</LocalSchema>
@ -61,7 +70,7 @@
<ClusterSchema>dbo</ClusterSchema>
</Script>
<Script Include="6-CreateMentionTVF.usql">
<UseLocalComputeAccount>true</UseLocalComputeAccount>
<UseLocalComputeAccount>false</UseLocalComputeAccount>
<LocalComputeAccount>localcomputeaccount</LocalComputeAccount>
<LocalDatabase>master</LocalDatabase>
<LocalSchema>dbo</LocalSchema>
@ -70,7 +79,7 @@
<ClusterSchema>dbo</ClusterSchema>
</Script>
<Script Include="7-CreateMentionTables.usql">
<UseLocalComputeAccount>true</UseLocalComputeAccount>
<UseLocalComputeAccount>false</UseLocalComputeAccount>
<LocalComputeAccount>localcomputeaccount</LocalComputeAccount>
<LocalDatabase>master</LocalDatabase>
<LocalSchema>dbo</LocalSchema>
@ -79,16 +88,22 @@
<ClusterSchema>dbo</ClusterSchema>
</Script>
<Script Include="8-TweetAnalysis-WindowingExpr.usql">
<UseLocalComputeAccount>true</UseLocalComputeAccount>
<UseLocalComputeAccount>false</UseLocalComputeAccount>
<LocalComputeAccount>localcomputeaccount</LocalComputeAccount>
<LocalDatabase>master</LocalDatabase>
<LocalSchema>dbo</LocalSchema>
<ClusterComputeAccount>mryskona</ClusterComputeAccount>
<ClusterDatabase>master</ClusterDatabase>
<ClusterSchema>dbo</ClusterSchema>
</Script>
<Script Include="9-AddNewTweets.usql">
<UseLocalComputeAccount>true</UseLocalComputeAccount>
<UseLocalComputeAccount>false</UseLocalComputeAccount>
<LocalComputeAccount>localcomputeaccount</LocalComputeAccount>
<LocalDatabase>master</LocalDatabase>
<LocalSchema>dbo</LocalSchema>
<ClusterComputeAccount>mryskona</ClusterComputeAccount>
<ClusterDatabase>master</ClusterDatabase>
<ClusterSchema>dbo</ClusterSchema>
</Script>
</ItemGroup>
<ItemGroup>