5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-20 10:51:21 +08:00

SQOOP-2817: Sqoop2: NullValueTest fails when running against MySQL database

(Abraham Fine via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2016-02-04 14:26:46 -08:00
parent cea627fa14
commit bb81a890b1

View File

@ -100,7 +100,7 @@ private boolean usingCustomNullValue() {
private String[] getCsv() { private String[] getCsv() {
return new String[] { return new String[] {
"1,'USA'," + nullValue + ",'San Francisco'", "1,'USA','2004-10-23 00:00:00.000','San Francisco'",
"2,'USA','2004-10-24 00:00:00.000'," + nullValue, "2,'USA','2004-10-24 00:00:00.000'," + nullValue,
"3," + nullValue + ",'2004-10-25 00:00:00.000','Brno'", "3," + nullValue + ",'2004-10-25 00:00:00.000','Brno'",
"4,'USA','2004-10-26 00:00:00.000','Palo Alto'" "4,'USA','2004-10-26 00:00:00.000','Palo Alto'"
@ -158,7 +158,7 @@ public void testFromHdfs() throws Exception {
executeJob(job); executeJob(job);
Assert.assertEquals(4L, provider.rowCount(getTableName())); Assert.assertEquals(4L, provider.rowCount(getTableName()));
assertRowInCities(1, "USA", null, "San Francisco"); assertRowInCities(1, "USA", Timestamp.valueOf("2004-10-23 00:00:00.000"), "San Francisco");
assertRowInCities(2, "USA", Timestamp.valueOf("2004-10-24 00:00:00.000"), (String) null); assertRowInCities(2, "USA", Timestamp.valueOf("2004-10-24 00:00:00.000"), (String) null);
assertRowInCities(3, (String) null, Timestamp.valueOf("2004-10-25 00:00:00.000"), "Brno"); assertRowInCities(3, (String) null, Timestamp.valueOf("2004-10-25 00:00:00.000"), "Brno");
assertRowInCities(4, "USA", Timestamp.valueOf("2004-10-26 00:00:00.000"), "Palo Alto"); assertRowInCities(4, "USA", Timestamp.valueOf("2004-10-26 00:00:00.000"), "Palo Alto");
@ -166,7 +166,7 @@ public void testFromHdfs() throws Exception {
@Test @Test
public void testToHdfs() throws Exception { public void testToHdfs() throws Exception {
provider.insertRow(getTableName(), 1, "USA", (java.sql.Timestamp) null, "San Francisco"); provider.insertRow(getTableName(), 1, "USA", Timestamp.valueOf("2004-10-23 00:00:00.000"), "San Francisco");
provider.insertRow(getTableName(), 2, "USA", Timestamp.valueOf("2004-10-24 00:00:00.000"), (String) null); provider.insertRow(getTableName(), 2, "USA", Timestamp.valueOf("2004-10-24 00:00:00.000"), (String) null);
provider.insertRow(getTableName(), 3, (String) null, Timestamp.valueOf("2004-10-25 00:00:00.000"), "Brno"); provider.insertRow(getTableName(), 3, (String) null, Timestamp.valueOf("2004-10-25 00:00:00.000"), "Brno");
provider.insertRow(getTableName(), 4, "USA", Timestamp.valueOf("2004-10-26 00:00:00.000"), "Palo Alto"); provider.insertRow(getTableName(), 4, "USA", Timestamp.valueOf("2004-10-26 00:00:00.000"), "Palo Alto");