Skip to content

Commit f2592db

Browse files
authored
Merge pull request #201134 from normesta/normesta-reg-updates-8
Fixing code
2 parents 95917c6 + dabb8ec commit f2592db

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

articles/storage/blobs/data-lake-storage-query-acceleration-how-to.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: normesta
55
ms.subservice: data-lake-storage-gen2
66
ms.service: storage
77
ms.topic: how-to
8-
ms.date: 04/11/2022
8+
ms.date: 06/09/2022
99
ms.author: normesta
1010
ms.reviewer: jamsbak
1111
ms.custom: devx-track-csharp, devx-track-azurepowershell
@@ -241,10 +241,25 @@ private static async Task DumpQueryCsv(BlockBlobClient blob, string query, bool
241241
{
242242
try
243243
{
244-
var options = new BlobQueryOptions() {
245-
InputTextConfiguration = new BlobQueryCsvTextOptions() { HasHeaders = headers },
246-
OutputTextConfiguration = new BlobQueryCsvTextOptions() { HasHeaders = true },
247-
ProgressHandler = new Progress<long>((finishedBytes) => Console.Error.WriteLine($"Data read: {finishedBytes}"))
244+
var options = new BlobQueryOptions()
245+
{
246+
InputTextConfiguration = new BlobQueryCsvTextOptions()
247+
{
248+
HasHeaders = true,
249+
RecordSeparator = "\n",
250+
ColumnSeparator = ",",
251+
EscapeCharacter = '\\',
252+
QuotationCharacter = '"'
253+
},
254+
OutputTextConfiguration = new BlobQueryCsvTextOptions()
255+
{
256+
HasHeaders = true,
257+
RecordSeparator = "\n",
258+
ColumnSeparator = ",",
259+
EscapeCharacter = '\\',
260+
QuotationCharacter = '"' },
261+
ProgressHandler = new Progress<long>((finishedBytes) =>
262+
Console.Error.WriteLine($"Data read: {finishedBytes}"))
248263
};
249264
options.ErrorHandler += (BlobQueryError err) => {
250265
Console.ForegroundColor = ConsoleColor.Red;
@@ -256,7 +271,8 @@ private static async Task DumpQueryCsv(BlockBlobClient blob, string query, bool
256271
query,
257272
options)).Value.Content))
258273
{
259-
using (var parser = new CsvReader(reader, new CsvConfiguration(CultureInfo.CurrentCulture, hasHeaderRecord: true) { HasHeaderRecord = true }))
274+
using (var parser = new CsvReader
275+
(reader, new CsvConfiguration(CultureInfo.CurrentCulture) { HasHeaderRecord = true }))
260276
{
261277
while (await parser.ReadAsync())
262278
{
@@ -267,7 +283,7 @@ private static async Task DumpQueryCsv(BlockBlobClient blob, string query, bool
267283
}
268284
catch (Exception ex)
269285
{
270-
Console.Error.WriteLine("Exception: " + ex.ToString());
286+
System.Windows.Forms.MessageBox.Show("Exception: " + ex.ToString());
271287
}
272288
}
273289

0 commit comments

Comments
 (0)