Skip to content

Commit 9338053

Browse files
committed
Empty Database not generating an execute sql file. #98
1 parent 9b8e1dd commit 9338053

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

dependency-reduced-pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.cloudera.utils.hadoop</groupId>
55
<artifactId>hms-mirror</artifactId>
66
<name>hms-mirror</name>
7-
<version>1.6.5.9-SNAPSHOT</version>
7+
<version>1.6.5.10-SNAPSHOT</version>
88
<url>https://github.com/cloudera-labs/hms_mirror</url>
99
<build>
1010
<finalName>${project.artifactId}</finalName>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<groupId>com.cloudera.utils.hadoop</groupId>
2424
<artifactId>hms-mirror</artifactId>
25-
<version>1.6.5.9-SNAPSHOT</version>
25+
<version>1.6.5.10-SNAPSHOT</version>
2626
<name>hms-mirror</name>
2727

2828
<url>https://github.com/cloudera-labs/hms_mirror</url>

src/main/java/com/cloudera/utils/hadoop/hms/mirror/Conversion.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public String executeSql(Environment environment, String database) {
7878
for (Pair sqlPair : dbSql) {
7979
sb.append("-- ").append(sqlPair.getDescription()).append("\n");
8080
sb.append(sqlPair.getAction()).append(";\n");
81+
found = Boolean.TRUE;
8182
}
8283
}
8384

src/main/java/com/cloudera/utils/hadoop/hms/mirror/StatsCalculator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public static void setSessionOptions(Cluster cluster, EnvironmentTable controlEn
175175
}
176176

177177
private static SerdeType serdeFromStats(Map<String, Object> stats) {
178-
String sStype = stats.get(FILE_FORMAT).toString();
178+
String sStype = stats.getOrDefault(FILE_FORMAT, "UNKNOWN").toString();
179179
SerdeType serdeType = null;
180180
if (sStype == null) {
181181
serdeType = SerdeType.UNKNOWN;

src/test/java/com/cloudera/utils/hadoop/hms/EndToEndLegacyToCDPTest.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,10 @@ public void so_ro() {
10851085
Mirror mirror = new Mirror();
10861086
long rtn = mirror.go(args);
10871087
long check = MessageCode.RO_DB_DOESNT_EXIST.getLong();
1088+
1089+
// TODO: Current testing doesn't have ability to check a filesystem, which this test relies on.
1090+
// This test is expected to fail at this point.
1091+
10881092
assertEquals("Return Code Failure: " + rtn + " doesn't match: " + check * -1, check * -1, rtn);
10891093

10901094
}
@@ -1109,6 +1113,8 @@ public void so_ro_sync() {
11091113
rtn = mirror.go(args);
11101114
long check = MessageCode.RO_DB_DOESNT_EXIST.getLong();
11111115

1116+
// TODO: Current testing doesn't have ability to check a filesystem, which this test relies on.
1117+
// This test is expected to fail at this point.
11121118
assertEquals("Return Code Failure: " + rtn + " doesn't match: " + check * -1, check * -1, rtn);
11131119

11141120
}
@@ -1133,7 +1139,8 @@ public void so_ro_tf() {
11331139
Mirror mirror = new Mirror();
11341140
rtn = mirror.go(args);
11351141
long check = MessageCode.RO_DB_DOESNT_EXIST.getLong();
1136-
1142+
// TODO: Current testing doesn't have ability to check a filesystem, which this test relies on.
1143+
// This test is expected to fail at this point.
11371144
assertEquals("Return Code Failure: " + rtn + " doesn't match: " + check * -1, check * -1, rtn);
11381145

11391146
}
@@ -2079,7 +2086,8 @@ public void sql_ro() {
20792086
rtn = mirror.go(args);
20802087
// Should fail because DB dir doesn't exist. RO assumes data moved already.
20812088
long check = MessageCode.RO_DB_DOESNT_EXIST.getLong();
2082-
2089+
// TODO: Current testing doesn't have ability to check a filesystem, which this test relies on.
2090+
// This test is expected to fail at this point.
20832091
assertEquals("Return Code Failure: " + rtn + " doesn't match: " + check * -1, check * -1, rtn);
20842092

20852093
}

0 commit comments

Comments
 (0)