diff --git a/hcatalog/build-support/checkstyle/coding_style.xml b/hcatalog/build-support/checkstyle/coding_style.xml
index c90f3ce..3bbeddc 100644
--- a/hcatalog/build-support/checkstyle/coding_style.xml
+++ b/hcatalog/build-support/checkstyle/coding_style.xml
@@ -58,6 +58,7 @@ imposed on others.
+
diff --git a/hcatalog/core/src/main/java/org/apache/hcatalog/cli/HCatCli.java b/hcatalog/core/src/main/java/org/apache/hcatalog/cli/HCatCli.java
index 574851f..14bf1c4 100644
--- a/hcatalog/core/src/main/java/org/apache/hcatalog/cli/HCatCli.java
+++ b/hcatalog/core/src/main/java/org/apache/hcatalog/cli/HCatCli.java
@@ -57,278 +57,278 @@
*/
public class HCatCli {
- @SuppressWarnings("static-access")
- public static void main(String[] args) {
+ @SuppressWarnings("static-access")
+ public static void main(String[] args) {
- try {
- LogUtils.initHiveLog4j();
- } catch (LogInitializationException e) {
+ try {
+ LogUtils.initHiveLog4j();
+ } catch (LogInitializationException e) {
- }
-
- CliSessionState ss = new CliSessionState(new HiveConf(SessionState.class));
- ss.in = System.in;
- try {
- ss.out = new PrintStream(System.out, true, "UTF-8");
- ss.err = new PrintStream(System.err, true, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- System.exit(1);
- }
-
- HiveConf conf = ss.getConf();
-
- HiveConf.setVar(conf, ConfVars.SEMANTIC_ANALYZER_HOOK, HCatSemanticAnalyzer.class.getName());
-
- SessionState.start(ss);
-
- Options options = new Options();
-
- // -e 'quoted-query-string'
- options.addOption(OptionBuilder
- .hasArg()
- .withArgName("exec")
- .withDescription("hcat command given from command line")
- .create('e'));
-
- // -f
- options.addOption(OptionBuilder
- .hasArg()
- .withArgName("file")
- .withDescription("hcat commands in file")
- .create('f'));
-
- // -g
- options.addOption(OptionBuilder
- .hasArg().
- withArgName("group").
- withDescription("group for the db/table specified in CREATE statement").
- create('g'));
-
- // -p
- options.addOption(OptionBuilder
- .hasArg()
- .withArgName("perms")
- .withDescription("permissions for the db/table specified in CREATE statement")
- .create('p'));
-
- // -D
- options.addOption(OptionBuilder
- .hasArgs(2)
- .withArgName("property=value")
- .withValueSeparator()
- .withDescription("use hadoop value for given property")
- .create('D'));
-
- // [-h|--help]
- options.addOption(new Option("h", "help", false, "Print help information"));
-
- Parser parser = new GnuParser();
- CommandLine cmdLine = null;
-
- try {
- cmdLine = parser.parse(options, args);
-
- } catch (ParseException e) {
- printUsage(options, ss.err);
- System.exit(1);
- }
- // -e
- String execString = (String) cmdLine.getOptionValue('e');
- // -f
- String fileName = (String) cmdLine.getOptionValue('f');
- // -h
- if (cmdLine.hasOption('h')) {
- printUsage(options, ss.out);
- System.exit(0);
- }
-
- if (execString != null && fileName != null) {
- ss.err.println("The '-e' and '-f' options cannot be specified simultaneously");
- printUsage(options, ss.err);
- System.exit(1);
- }
-
- // -p
- String perms = (String) cmdLine.getOptionValue('p');
- if (perms != null) {
- validatePermissions(ss, conf, perms);
- }
-
- // -g
- String grp = (String) cmdLine.getOptionValue('g');
- if (grp != null) {
- conf.set(HCatConstants.HCAT_GROUP, grp);
- }
-
- // -D
- setConfProperties(conf, cmdLine.getOptionProperties("D"));
-
- if (execString != null) {
- System.exit(processLine(execString));
- }
+ }
- try {
- if (fileName != null) {
- System.exit(processFile(fileName));
- }
- } catch (FileNotFoundException e) {
- ss.err.println("Input file not found. (" + e.getMessage() + ")");
- System.exit(1);
- } catch (IOException e) {
- ss.err.println("Could not open input file for reading. (" + e.getMessage() + ")");
- System.exit(1);
- }
+ CliSessionState ss = new CliSessionState(new HiveConf(SessionState.class));
+ ss.in = System.in;
+ try {
+ ss.out = new PrintStream(System.out, true, "UTF-8");
+ ss.err = new PrintStream(System.err, true, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ System.exit(1);
+ }
- // -h
- printUsage(options, ss.err);
- System.exit(1);
+ HiveConf conf = ss.getConf();
+
+ HiveConf.setVar(conf, ConfVars.SEMANTIC_ANALYZER_HOOK, HCatSemanticAnalyzer.class.getName());
+
+ SessionState.start(ss);
+
+ Options options = new Options();
+
+ // -e 'quoted-query-string'
+ options.addOption(OptionBuilder
+ .hasArg()
+ .withArgName("exec")
+ .withDescription("hcat command given from command line")
+ .create('e'));
+
+ // -f
+ options.addOption(OptionBuilder
+ .hasArg()
+ .withArgName("file")
+ .withDescription("hcat commands in file")
+ .create('f'));
+
+ // -g
+ options.addOption(OptionBuilder
+ .hasArg().
+ withArgName("group").
+ withDescription("group for the db/table specified in CREATE statement").
+ create('g'));
+
+ // -p
+ options.addOption(OptionBuilder
+ .hasArg()
+ .withArgName("perms")
+ .withDescription("permissions for the db/table specified in CREATE statement")
+ .create('p'));
+
+ // -D
+ options.addOption(OptionBuilder
+ .hasArgs(2)
+ .withArgName("property=value")
+ .withValueSeparator()
+ .withDescription("use hadoop value for given property")
+ .create('D'));
+
+ // [-h|--help]
+ options.addOption(new Option("h", "help", false, "Print help information"));
+
+ Parser parser = new GnuParser();
+ CommandLine cmdLine = null;
+
+ try {
+ cmdLine = parser.parse(options, args);
+
+ } catch (ParseException e) {
+ printUsage(options, ss.err);
+ System.exit(1);
+ }
+ // -e
+ String execString = (String) cmdLine.getOptionValue('e');
+ // -f
+ String fileName = (String) cmdLine.getOptionValue('f');
+ // -h
+ if (cmdLine.hasOption('h')) {
+ printUsage(options, ss.out);
+ System.exit(0);
}
- private static void setConfProperties(HiveConf conf, Properties props) {
- for (java.util.Map.Entry