diff --git a/src/Microsoft.InsightsGenerator/Workflow.cs b/src/Microsoft.InsightsGenerator/Workflow.cs index 96e2c8641c..b1795a7698 100644 --- a/src/Microsoft.InsightsGenerator/Workflow.cs +++ b/src/Microsoft.InsightsGenerator/Workflow.cs @@ -12,105 +12,47 @@ namespace Microsoft.InsightsGenerator { public class Workflow { - private readonly ConcurrentQueue _siggenQueue = new ConcurrentQueue(); - private readonly ConcurrentQueue _rulesQueue = new ConcurrentQueue(); + public async Task ProcessInputData(DataArray rulesData, + CancellationToken cancellationToken = new CancellationToken()) + { + // added cancellationToken just in case for future + cancellationToken.ThrowIfCancellationRequested(); - private static Workflow _instance; + //Get the signature result + SignatureGenerator siggen = new SignatureGenerator(rulesData); - // Lock synchronization object - private static readonly object syncLock = new object(); + string insights = null; - - public static Workflow Instance(CancellationToken cancellationToken = new CancellationToken()) - { - // Uses lazy initialization. thread safe for now. - if (_instance == null) + await Task.Run(() => { - lock (syncLock) + try { - - if (_instance == null) + DataTransformer transformer = new DataTransformer(); + transformer.Transform(rulesData); + SignatureGeneratorResult result = siggen.Learn(); + // call the rules engine processor + if (result?.Insights == null) { - _instance = new Workflow(); - _instance.ProcessInputData(cancellationToken).ConfigureAwait(false); + Console.WriteLine("Failure in generating insights, Input not recognized!"); + } + else + { + insights = RulesEngine.FindMatchedTemplate(result.Insights, rulesData); + Console.WriteLine( + $"Good News! Insights generator has provided you the chart text: \n{insights}\n"); } - } - } - - return _instance; - } - - public void IngestSiggen(object input) - { - if (_instance == null) - { - throw new ApplicationException("Please initialize the singleton class using Workflow.getInstance() and call _instance.IngestSiggen"); - } - - if (input == null) - { - throw new ArgumentException("Unable to ingest Siggen. Input object is null."); - } - _instance._siggenQueue.Enqueue(input); - } - - public void IngestRules(DataArray input) - { - if (_instance == null) - { - throw new ApplicationException("Please initialize the singleton class using Workflow.getInstance() and call _instance.IngestRules"); - } - - if (input == null) - { - throw new ArgumentException(" Unable to ingest Rules. Input object is null."); - } - _instance._rulesQueue.Enqueue(input); - } - - private async Task ProcessInputData(CancellationToken cancellationToken) - { - - cancellationToken.ThrowIfCancellationRequested(); - - //while (!cancellationToken.IsCancellationRequested) - //{ - // bool siggenInput = _instance._siggenQueue.TryDequeue(out object siggen); - - // if (siggenInput && siggen != null) - // { - // // call the siggen processor - // } - // else - // { - // await Task.Delay(TimeSpan.FromMinutes(1), cancellationToken).ConfigureAwait(false); - // } - //} - - bool rulesInput = _instance._rulesQueue.TryDequeue(out DataArray rulesData); - if (rulesInput && rulesData != null) - { - //Get the signature result - SignatureGenerator siggen = new SignatureGenerator(rulesData); - SignatureGeneratorResult result = siggen.Learn(); - // call the rules engine processor - if (result?.Insights == null) - { - Console.WriteLine("Failure in generating insights, Input not recognized!"); } - else + catch (Exception ex) { - string insights = RulesEngine.FindMatchedTemplate(result.Insights, rulesData); - Console.WriteLine($"Good News! Insights generator has provided you the chart text: \n{insights}\n"); + Console.WriteLine(ex.ToString()); + throw; } - - } - else - { - //await Task.Delay(TimeSpan.FromMinutes(1), cancellationToken).ConfigureAwait(false); - } + + }, cancellationToken); + + return insights; } } } diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.de.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.de.xlf index 505a699dab..cdbd3f2817 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.de.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.de.xlf @@ -2321,13 +2321,13 @@ Export bacpac - BACPAC exportieren + BACPAC-Datei exportieren Import bacpac - BACPAC importieren + BACPAC-Datei importieren @@ -2391,6 +2391,36 @@ . Parameters: 0 - filePath (string) + + Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'. + Ungültiger Wert "{0}" für ColumnEncryption. Gültige Werte sind "Enabled" und "Disabled". + . + Parameters: 0 - columnEncryptionSetting (string) + + + Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS' and 'HGS'. + Ungültiger Wert "{0}" für EnclaveAttestationProtocol. Gültige Werte sind "AAS" und "HGS". + . + Parameters: 0 - enclaveAttestationProtocol (string) + + + The Attestation Protocol and Enclave Attestation URL requires Always Encrypted to be set to Enabled. + Für das Nachweisprotokoll und die Enclave-Nachweis-URL muss Always Encrypted auf "Enabled" festgelegt sein. + + + + + An error was encountered during execution of batch. Exiting. + Fehler bei der Batchausführung. Der Vorgang wird beendet. + + + + + Encountered unsupported token {0} + Es wurde ein nicht unterstütztes Token "{0}" gefunden. + + + \ No newline at end of file diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.es.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.es.xlf index d964f3752a..84a78ca7ca 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.es.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.es.xlf @@ -2391,6 +2391,36 @@ . Parameters: 0 - filePath (string) + + Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'. + El valor "{0}" no es válido para ComlumEncryption. Los valores válidos son "Enabled" y "Disabled". + . + Parameters: 0 - columnEncryptionSetting (string) + + + Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS' and 'HGS'. + El valor "{0}" no es válido para EnclaveAttestationProtocol. Los valores válidos son "AAS" y "HGS". + . + Parameters: 0 - enclaveAttestationProtocol (string) + + + The Attestation Protocol and Enclave Attestation URL requires Always Encrypted to be set to Enabled. + El protocolo de atestación y la dirección URL de atestación de enclave requieren que Always Encrypted esté habilitado. + + + + + An error was encountered during execution of batch. Exiting. + Error durante la ejecución del lote. Saliendo. + + + + + Encountered unsupported token {0} + Se ha encontrado un token no admitido {0} + + + \ No newline at end of file diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.fr.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.fr.xlf index 1cd6a74b34..abe0ab8a94 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.fr.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.fr.xlf @@ -2391,6 +2391,36 @@ . Parameters: 0 - filePath (string) + + Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'. + Valeur « {0} » non valide pour ComlumEncryption. Les valeurs valides sont « Enabled » et « Disabled ». + . + Parameters: 0 - columnEncryptionSetting (string) + + + Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS' and 'HGS'. + Valeur « {0} » non valide pour EnclaveAttestationProtocol. Les valeurs valides sont « AAS » et « HGS ». + . + Parameters: 0 - enclaveAttestationProtocol (string) + + + The Attestation Protocol and Enclave Attestation URL requires Always Encrypted to be set to Enabled. + Le protocole d'attestation et l'URL d'attestation d'enclave exigent l'activation d'Always Encrypted. + + + + + An error was encountered during execution of batch. Exiting. + Une erreur s'est produite durant l'exécution du lot. Fermeture en cours. + + + + + Encountered unsupported token {0} + Jeton non pris en charge détecté ({0}) + + + \ No newline at end of file diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.it.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.it.xlf index 8556526f51..f05960dbbd 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.it.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.it.xlf @@ -2391,6 +2391,36 @@ . Parameters: 0 - filePath (string) + + Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'. + Il valore '{0}' non è valido per ComlumEncryption. I valori validi sono 'Enabled' e 'Disabled'. + . + Parameters: 0 - columnEncryptionSetting (string) + + + Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS' and 'HGS'. + Il valore '{0}' non è valido per EnclaveAttestationProtocol. I valori validi sono 'AAS' e 'HGS'. + . + Parameters: 0 - enclaveAttestationProtocol (string) + + + The Attestation Protocol and Enclave Attestation URL requires Always Encrypted to be set to Enabled. + Il protocollo di attestazione e l'URL di attestazione dell'enclave richiedono che Always Encrypted sia impostato su Abilitato. + + + + + An error was encountered during execution of batch. Exiting. + Si è verificato un errore durante l'esecuzione del batch. Chiusura in corso. + + + + + Encountered unsupported token {0} + È stato rilevato il token {0} non supportato + + + \ No newline at end of file diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ja.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ja.xlf index cba09cf315..c845d33a0c 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ja.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ja.xlf @@ -2391,6 +2391,36 @@ . Parameters: 0 - filePath (string) + + Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'. + ComlumEncryption の値 '{0}' が無効です。有効な値は 'Enabled' と 'Disabled' です。 + . + Parameters: 0 - columnEncryptionSetting (string) + + + Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS' and 'HGS'. + EnclaveAttestationProtocol の値 '{0}' が無効です。有効な値は、'AAS' と 'HGS' です。 + . + Parameters: 0 - enclaveAttestationProtocol (string) + + + The Attestation Protocol and Enclave Attestation URL requires Always Encrypted to be set to Enabled. + 構成証明プロトコルおよびエンクレーブ構成証明の URL では、Always Encrypted を Enabled に設定することが必要です。 + + + + + An error was encountered during execution of batch. Exiting. + バッチの実行中にエラーが発生しました。終了します。 + + + + + Encountered unsupported token {0} + サポートされていないトークン {0} が見つかりました + + + \ No newline at end of file diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ko.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ko.xlf index d1b56aae7d..69050b9300 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ko.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ko.xlf @@ -1898,7 +1898,7 @@ Value {0} is too large to fit in column of type {1} - 값 {0}이 너무 커서 {1} 유형의 열에 맞지 않습니다. + 값 {0}이(가) 너무 커서 {1} 유형의 열에 맞지 않습니다. . Parameters: 0 - value (string), 1 - columnType (string) @@ -2391,6 +2391,36 @@ . Parameters: 0 - filePath (string) + + Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'. + ComlumEncryption에 대한 '{0}' 값이 잘못되었습니다. 유효한 값은 'Enabled' 및 'Disabled'입니다. + . + Parameters: 0 - columnEncryptionSetting (string) + + + Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS' and 'HGS'. + EnclaveAttestationProtocol에 대한 '{0}' 값이 잘못되었습니다. 유효한 값은 'AAS' 및 'HGS'입니다. + . + Parameters: 0 - enclaveAttestationProtocol (string) + + + The Attestation Protocol and Enclave Attestation URL requires Always Encrypted to be set to Enabled. + 증명 프로토콜 및 enclave 증명 URL을 사용하려면 Always Encrypted를 Enabled(사용)로 설정해야 합니다. + + + + + An error was encountered during execution of batch. Exiting. + 일괄 처리를 실행하는 동안 오류가 발생하여 종료합니다. + + + + + Encountered unsupported token {0} + 지원되지 않는 {0} 토큰이 발생했습니다. + + + \ No newline at end of file diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.pt-BR.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.pt-BR.xlf index b4317e1775..3857a77813 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.pt-BR.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.pt-BR.xlf @@ -2391,6 +2391,36 @@ . Parameters: 0 - filePath (string) + + Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'. + Valor inválido '{0}' para ComlumEncryption. Os valores válidos são 'Habilitado' e 'Desabilitado'. + . + Parameters: 0 - columnEncryptionSetting (string) + + + Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS' and 'HGS'. + Valor inválido '{0}' para EnclaveAttestationProtocol. Os valores válidos são 'AAS' e 'HGS'. + . + Parameters: 0 - enclaveAttestationProtocol (string) + + + The Attestation Protocol and Enclave Attestation URL requires Always Encrypted to be set to Enabled. + O Protocolo de Atestado e a URL de Atestado de Enclave exigem que a opção Always Encrypted seja definida como Habilitada. + + + + + An error was encountered during execution of batch. Exiting. + Erro durante a execução do lote. Saindo. + + + + + Encountered unsupported token {0} + Token sem suporte encontrado {0} + + + \ No newline at end of file diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ru.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ru.xlf index 423e1693bf..96ee905a32 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ru.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.ru.xlf @@ -2391,6 +2391,36 @@ . Parameters: 0 - filePath (string) + + Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'. + Недопустимое значение "{0}" для ColumnEncryption. Допустимые значения: "Enabled" (Включено) и "Disabled" (Отключено). + . + Parameters: 0 - columnEncryptionSetting (string) + + + Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS' and 'HGS'. + Недопустимое значение "{0}" для EnclaveAttestationProtocol. Допустимые значения: "AAS" и "HGS". + . + Parameters: 0 - enclaveAttestationProtocol (string) + + + The Attestation Protocol and Enclave Attestation URL requires Always Encrypted to be set to Enabled. + Протокол аттестации и URL аттестации анклава требуют задать для Always Encrypted значение Enabled (Включено). + + + + + An error was encountered during execution of batch. Exiting. + При выполнении пакета возникла ошибка. Выполняется выход. + + + + + Encountered unsupported token {0} + Обнаружен неподдерживаемый токен {0}. + + + \ No newline at end of file diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.zh-hans.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.zh-hans.xlf index a490a1c464..3a210ddf78 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.zh-hans.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.zh-hans.xlf @@ -136,13 +136,13 @@ (1 row affected) - (1 行受到影响) + (1 行受到影响) ({0} rows affected) - ({0} 行受到影响) + ({0} 行受到影响) . Parameters: 0 - rows (long) @@ -1922,7 +1922,7 @@ -- TODO: Set parameter values here. - -- 待办事项:在此处设置参数值 + -- 待办事项: 在此处设置参数值 @@ -2209,13 +2209,13 @@ Failed to create session: {0} - 创建会话失败:{0} + 创建会话失败: {0} . Parameters: 0 - error (String) Failed to pause session: {0} - 暂停会话失败:{0} + 暂停会话失败: {0} . Parameters: 0 - error (String) @@ -2321,13 +2321,13 @@ Export bacpac - 导出 DACPAC + 导出 BACPAC Import bacpac - 导入 DACPAC + 导入 BACPAC @@ -2391,6 +2391,36 @@ . Parameters: 0 - filePath (string) + + Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'. + ComlumEncryption 的值“{0}”无效。有效值为 "Enabled" 和 "Disabled"。 + . + Parameters: 0 - columnEncryptionSetting (string) + + + Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS' and 'HGS'. + EnclaveAttestationProtocol 的值“{0}”无效。有效值为 "AAS" 和 "HGS"。 + . + Parameters: 0 - enclaveAttestationProtocol (string) + + + The Attestation Protocol and Enclave Attestation URL requires Always Encrypted to be set to Enabled. + 证明协议和 Enclave 证明 URL 需要将 Always Encrypted 设置为“启用”。 + + + + + An error was encountered during execution of batch. Exiting. + 在执行批处理期间遇到错误。正在退出。 + + + + + Encountered unsupported token {0} + 遇到不支持的令牌 {0} + + + \ No newline at end of file diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.zh-hant.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.zh-hant.xlf index 31caf6c5b1..5558732fe8 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.zh-hant.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/transXliff/sr.zh-hant.xlf @@ -784,13 +784,13 @@ Master Key - 主要索引鍵 + 主要金鑰 Master Keys - 主要索引鍵 + 主要金鑰 @@ -2391,6 +2391,36 @@ . Parameters: 0 - filePath (string) + + Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'. + ComlumEncryption 的值 '{0}' 無效。有效值為 'Enabled' 及 'Disabled'。 + . + Parameters: 0 - columnEncryptionSetting (string) + + + Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS' and 'HGS'. + EnclaveAttestationProtocol 的值 '{0}' 無效。有效值為 'AAS' 及 'HGS'。 + . + Parameters: 0 - enclaveAttestationProtocol (string) + + + The Attestation Protocol and Enclave Attestation URL requires Always Encrypted to be set to Enabled. + 證明通訊協定與記憶體保護區證明 URL 需要將 Always Encrypted 設定為「啟用」。 + + + + + An error was encountered during execution of batch. Exiting. + 執行批次期間發生錯誤,結束中。 + + + + + Encountered unsupported token {0} + 發現不支援的權杖 {0} + + + \ No newline at end of file diff --git a/test/Microsoft.InsightsGenerator.UnitTests/WorkflowTests.cs b/test/Microsoft.InsightsGenerator.UnitTests/WorkflowTests.cs new file mode 100644 index 0000000000..d7e0878719 --- /dev/null +++ b/test/Microsoft.InsightsGenerator.UnitTests/WorkflowTests.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; + +namespace Microsoft.InsightsGenerator.UnitTests +{ + public class WorkFlowTests + { + [Fact] + public void ProcessInputDataNotNullResultTest() + { + Workflow workflow = new Workflow(); + string insights = workflow.ProcessInputData(getSampleDataArray()).GetAwaiter().GetResult(); + Assert.NotNull(insights); + Assert.NotEmpty(insights); + } + + [Fact] + public void ProcessInputExactMatchResultTest() + { + Workflow workflow = new Workflow(); + string insights = workflow.ProcessInputData(getSampleDataArray()).GetAwaiter().GetResult(); + Assert.NotNull(insights); + Assert.NotEmpty(insights); + var expectedTopSliceInsight = @"topPerSlice +5 +Category1 +3 +China (455) 34.89% +Turkey (254) 19.48% +United States (188) 14.42% +Category2 +3 +Japan (171) 91.94% +China (10) 5.38% +United States (3) 1.61% +Category3 +3 +United States (106) 15.5% +Brazil (91) 13.3% +Korea (61) 8.92% +Category4 +3 +United States (38) 38% +China (12) 12% +Korea (8) 8% +Category5 +3 +Korea (21) 65.62% +United States (6) 18.75% +Canada (3) 9.38%"; + Assert.True(expectedTopSliceInsight.Equals(insights)); + } + + private DataArray getSampleDataArray() + { + string sampleTableString = + @"Country Count Category +China 455 Category1 +Turkey 254 Category1 +United States 188 Category1 +Japan 171 Category2 +United States 106 Category3 +Brazil 91 Category3 +Thailand 67 Category1 +Korea 61 Category3 +Russia 61 Category1 +China 60 Category3 +Brazil 57 Category1 +Germany 51 Category3 +Turkey 49 Category3 +Russia 45 Category3 +Japan 44 Category3 +United States 38 Category4 +Thailand 37 Category3 +India 36 Category3 +Germany 35 Category1 +France 33 Category1 +India 31 Category1 +Japan 28 Category1 +Mexico 27 Category3 +Canada 23 Category3 +Mexico 22 Category1 +Vietnam 22 Category3 +Korea 21 Category1 +Korea 21 Category5 +United Kingdom 20 Category3 +Vietnam 18 Category1 +Canada 17 Category1 +United Kingdom 17 Category1 +China 12 Category4 +France 12 Category3 +China 10 Category2 +Korea 8 Category4 +Brazil 6 Category4 +Russia 6 Category4 +United States 6 Category5 +France 5 Category4 +Germany 5 Category4 +United Kingdom 5 Category4 +Thailand 4 Category4 +Turkey 4 Category4 +Canada 3 Category5 +Mexico 3 Category4 +United States 3 Category2 +Canada 2 Category4 +Germany 1 Category2 +India 1 Category4 +India 1 Category5 +Japan 1 Category4 +Japan 1 Category5 +Korea 1 Category2"; + + string[] sampleRows = sampleTableString.Split(Environment.NewLine); + + + var columnNames = sampleRows[0].Split(" "); + + List sampleRowList = new List(); + + for (int i = 1; i < sampleRows.Length; i++) + { + sampleRowList.Add(sampleRows[i].Split(" ")); + } + + DataArray result = new DataArray(); + result.ColumnNames = columnNames; + result.Cells = sampleRowList.ToArray(); + return result; + } + } +} \ No newline at end of file