[SPARK-22000][SQL][FOLLOW-UP] Fix bad test to ensure it can test properly

## What changes were proposed in this pull request?

There was some mistake on test code: it has wrong assertion. The patch proposes fixing it, as well as fixing other stuff to make test really pass.

## How was this patch tested?

Fixed unit test.

Closes #24112 from HeartSaVioR/SPARK-22000-hotfix.

Authored-by: Jungtaek Lim (HeartSaVioR) <kabhwan@gmail.com>
Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
This commit is contained in:
Jungtaek Lim (HeartSaVioR) 2019-03-17 08:25:40 +09:00 committed by Takeshi Yamamuro
parent 6a6075ac96
commit 4adbcdc424

View file

@ -154,7 +154,7 @@ public class JavaBeanDeserializationSuite implements Serializable {
List<RecordSpark22000> records = dataset.collectAsList(); List<RecordSpark22000> records = dataset.collectAsList();
Assert.assertEquals(records, records); Assert.assertEquals(expectedRecords, records);
} }
@Test @Test
@ -211,7 +211,7 @@ public class JavaBeanDeserializationSuite implements Serializable {
record.setDoubleField(String.valueOf(recordRow.getDouble(4))); record.setDoubleField(String.valueOf(recordRow.getDouble(4)));
record.setStringField(recordRow.getString(5)); record.setStringField(recordRow.getString(5));
record.setBooleanField(String.valueOf(recordRow.getBoolean(6))); record.setBooleanField(String.valueOf(recordRow.getBoolean(6)));
record.setTimestampField(String.valueOf(recordRow.getTimestamp(7).getTime() * 1000)); record.setTimestampField(String.valueOf(recordRow.getTimestamp(7)));
// This would figure out that null value will not become "null". // This would figure out that null value will not become "null".
record.setNullIntField(null); record.setNullIntField(null);
return record; return record;