Azure / Azure/usql

Not displaying all element in XML extractor in U-Sql

Open
#131 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
231
Forks
666
PR merge metrics
No merged PRs in 30d

Description

I am new to U-Sql and trying to extract xml element. Here is my XML code.
`
test 1
test 2
`

Trying to display all "Disposition" values. But final output displaying "Test 2" only. I have code as below.

`DECLARE @testFile string ="Marlboro20180301000000_child.xml";
@xmlElementRowPath= EXTRACT Disposition string
FROM @testFile
USING new Microsoft.Analytics.Samples.Formats.Xml.XmlExtractor("Dispositions",
new SQL.MAP{
{"Disposition","Disposition"}
}
);

@words =
SELECT Ar.word, COUNT(*) AS count
FROM @xmlElementRowPath
CROSS APPLY
EXPLODE(new SQL.ARRAY( Disposition.Split(','))) AS Ar(word)
GROUP BY Ar.word;
//ORDER BY count DESC;
OUTPUT @words
TO "test.csv"
USING Outputters.Csv();`

Correct me about my mistakes.

Thanks
Lalith

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.