diff --git ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java index 2ca63b3..b32c4f0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -28,6 +28,10 @@ import static org.apache.hadoop.hive.serde.Constants.MAPKEY_DELIM; import static org.apache.hadoop.hive.serde.Constants.SERIALIZATION_FORMAT; import static org.apache.hadoop.hive.serde.Constants.STRING_TYPE_NAME; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.io.PrintStream; + import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -1932,7 +1936,12 @@ public class Hive { // use FsShell to move data to .Trash first rather than delete permanently FsShell fshell = new FsShell(); fshell.setConf(conf); + // Redirecting output to serve -S flag + PrintStream original = System.out; + System.setOut(new PrintStream(new OutputStream() { + public void write(int b) {/*DO NOTHING*/}})); fshell.run(new String[]{"-rmr", oldPath.toString()}); + System.setOut(original); } } catch (Exception e) { //swallow the exception