You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to U-Sql and trying to extract xml element. Here is my XML code. <Dispositions> <Disposition>test 1</Disposition> <Disposition> test 2</Disposition> </Dispositions>
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<string,string>{
{"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
The text was updated successfully, but these errors were encountered:
I am new to U-Sql and trying to extract xml element. Here is my XML code.
<Dispositions> <Disposition>test 1</Disposition> <Disposition> test 2</Disposition> </Dispositions>
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<string,string>{
{"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
The text was updated successfully, but these errors were encountered: