Skip to content

Commit 8266759

Browse files
authored
Merge pull request #53542 from rodrigoaatmicrosoft/patch-1
Improving C#/ASA type marshaling doc
2 parents a87990e + 62884e5 commit 8266759

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

articles/stream-analytics/stream-analytics-edge-csharp-udf-methods.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,29 @@ There are three ways to implement UDFs:
3737
The format of any UDF package has the path `/UserCustomCode/CLR/*`. Dynamic Link Libraries (DLLs) and resources are copied under the `/UserCustomCode/CLR/*` folder, which helps isolate user DLLs from system and Azure Stream Analytics DLLs. This package path is used for all functions regardless of the method used to employ them.
3838

3939
## Supported types and mapping
40+
For Azure Stream Analytics values to be used in C#, they need to be marshaled from one environment to the other. Marshaling happens for all input parameters of a UDF. Every Azure Stream Analytics type has a corresponding type in C# shown on the table below:
4041

41-
|**UDF type (C#)** |**Azure Stream Analytics type** |
42+
|**Azure Stream Analytics type** |**C# type** |
43+
|---------|---------|
44+
|bigint | long |
45+
|float | double |
46+
|nvarchar(max) | string |
47+
|datetime | DateTime |
48+
|Record | Dictionary\<string, object> |
49+
|Array | Array\<object> |
50+
51+
The same is true when data needs to be marshaled from C# to Azure Stream Analytics, which happens on the output value of a UDF. The table below shows what types are supported:
52+
53+
|**C# type** |**Azure Stream Analytics type** |
4254
|---------|---------|
4355
|long | bigint |
44-
|double | double |
56+
|double | float |
4557
|string | nvarchar(max) |
46-
|dateTime | dateTime |
47-
|struct | IRecord |
48-
|object | IRecord |
49-
|Array\<object> | IArray |
50-
|dictionary<string, object> | IRecord |
58+
|DateTime | dateTime |
59+
|struct | Record |
60+
|object | Record |
61+
|Array\<object> | Array |
62+
|Dictionary\<string, object> | Record |
5163

5264
## CodeBehind
5365
You can write user-defined functions in the **Script.asql** CodeBehind. Visual Studio tools will automatically compile the CodeBehind file into an assembly file. The assemblies are packaged as a zip file and uploaded to your storage account when you submit your job to Azure. You can learn how to write a C# UDF using CodeBehind by following the [C# UDF for Stream Analytics Edge jobs](stream-analytics-edge-csharp-udf.md) tutorial.

0 commit comments

Comments
 (0)