cleanup: Fix more build warnings in DataStreamSuite
Alot more
This commit is contained in:
1 parent
989d103eef
commit
bcd207f89e
118 files changed
+1812
-1597
No files matched your search
@@ -1,6 +1,9 @@
|
||||
using Spark.Core.Diagnostics;
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
|
||||
namespace BCG {
|
||||
[DataStreamUserRespresentation("CSVSaver")]
|
||||
@@ -77,7 +80,7 @@ namespace BCG {
|
||||
if (col != "id") {
|
||||
string colText = String.Empty;
|
||||
if (r[col] != null && r[col] != DBNull.Value)
|
||||
colText = r[col].ToString();
|
||||
colText = r[col]?.ToString() ?? string.Empty;
|
||||
if (r.schema[col].colType == typeof(string))
|
||||
colText = "\"" + colText + "\"";
|
||||
rv += (i++ == 0 ? colText : "," + colText);
|
||||
@@ -135,13 +138,14 @@ namespace BCG {
|
||||
}
|
||||
|
||||
public class CSVReaderStreamMapper : IStreamMapper {
|
||||
private IBlueTableSchema mySchema;
|
||||
IBlueTableSchema? mySchema;
|
||||
private readonly string[] myOutputSchemaStringArray;
|
||||
|
||||
public CSVReaderStreamMapper(string outputSchema) {
|
||||
myOutputSchemaStringArray = outputSchema.Split(' ');
|
||||
}
|
||||
|
||||
[MemberNotNull(nameof(mySchema))]
|
||||
public IBlueTableSchema getOutputSchema(IBlueTableSchema inputSchema) {
|
||||
if (mySchema == null) {
|
||||
ColumnInfo[] ci = inputSchema.columnInfo;
|
||||
@@ -161,6 +165,7 @@ namespace BCG {
|
||||
}
|
||||
|
||||
public IBlueRow map(IBlueRow row) {
|
||||
ExceptionAssert.NotNull(mySchema);
|
||||
object[] vals = new object[row.schema.columnInfo.Length];
|
||||
row.Values.CopyTo(vals, 0);
|
||||
for (int i = 0; i < mySchema.columnInfo.Length; i++) {
|
||||
|
||||
Reference in new issue
Block a user