Skip to content

Commit 149044a

Browse files
committed
PR review comments changes
1 parent 09bdf4d commit 149044a

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

src/csharp/Microsoft.Spark.E2ETest/IpcTests/Sql/SparkSessionTests.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,6 @@ public void TestCreateDataFrame()
137137
DataFrame df = _spark.CreateDataFrame(data);
138138
ValidateDataFrame(data.Select(a => new object[] { a }), df, schema);
139139
}
140-
141-
// Calling CreateDataFrame(IEnumerable<long> _) without schema
142-
{
143-
var data = new List<long>(new long[] { 2L, 3L });
144-
var schema = new StructType(new List<StructField>()
145-
{
146-
new StructField("_1", new LongType())
147-
});
148-
149-
DataFrame df = _spark.CreateDataFrame(data);
150-
ValidateDataFrame(data.Select(a => new object[] { a }), df, schema);
151-
}
152140
}
153141

154142
/// <summary>
@@ -166,9 +154,7 @@ private void ValidateDataFrame(IEnumerable<object[]> data, DataFrame df, StructT
166154
int i = 0;
167155
foreach (object[] expectedValues in data)
168156
{
169-
object[] actualValues = rows[i].Values;
170-
Assert.Equal(expectedValues.Length, actualValues.Length);
171-
Assert.True(actualValues.SequenceEqual(expectedValues));
157+
Assert.Equal(expectedValues, rows[i].Values);
172158
++i;
173159
}
174160
}

src/csharp/Microsoft.Spark/Sql/SparkSession.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,6 @@ public DataFrame CreateDataFrame(IEnumerable<int> data) =>
172172
public DataFrame CreateDataFrame(IEnumerable<string> data) =>
173173
CreateDataFrame(ToGenericRows(data), SchemaWithSingleColumn(new StringType()));
174174

175-
/// <summary>
176-
/// Creates a Dataframe given data as <see cref="IEnumerable"/> of type <see cref="long"/>
177-
/// </summary>
178-
/// <param name="data"></param>
179-
/// <returns>Dataframe object</returns>
180-
public DataFrame CreateDataFrame(IEnumerable<long> data) =>
181-
CreateDataFrame(ToGenericRows(data), SchemaWithSingleColumn(new LongType()));
182-
183175
/// <summary>
184176
/// Creates a Dataframe given data as <see cref="IEnumerable"/> of type <see cref="double"/>
185177
/// </summary>
@@ -196,8 +188,6 @@ public DataFrame CreateDataFrame(IEnumerable<double> data) =>
196188
public DataFrame CreateDataFrame(IEnumerable<bool> data) =>
197189
CreateDataFrame(ToGenericRows(data), SchemaWithSingleColumn(new BooleanType()));
198190

199-
//TODO: Add support for System.Single (float)
200-
201191
/// <summary>
202192
/// Executes a SQL query using Spark, returning the result as a DataFrame.
203193
/// </summary>
@@ -295,8 +285,8 @@ private StructType SchemaWithSingleColumn(DataType dataType) =>
295285
new StructType(new[] { new StructField("_1", dataType) });
296286

297287
/// <summary>
298-
/// Converts rows of type T to <see cref="GenericRow"/> to return a
299-
/// <see cref="IEnumerable"/> of type <see cref="GenericRow"/>.
288+
/// This method is transforming each element of IEnumerable of type T input into a single
289+
/// columned GenericRow.
300290
/// </summary>
301291
/// <typeparam name="T">Datatype of values in rows</typeparam>
302292
/// <param name="rows">List of values of type T</param>

0 commit comments

Comments
 (0)