We want to create the partitions in hive table, but the partition name have some spaces. So it cant create the partitions. Currently we are using the java. We tried to escape the space but all are throwing exception.
URL -s3n://comp-data-bckp/data/datav/sample_test/sample_test_inner/2016-06-27/hive/warehouse/datav/sample_test_inner/platform=SONY PS3
HiveConf hiveConf= new HiveConf();
hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, URL);
hiveConf.setIntVar(HiveConf.ConfVars.METASTORE_CLIENT_SOCKET_TIMEOUT, 60);
CliSessionState css = new CliSessionState(hiveConf);
css.in = System.in;
css.out = null;
css.err = null;
css.setIsSilent(true);
SessionState.start(css);
CliDriver cli = new CliDriver();
int response = cli.processLine(statements);
SessionState s = SessionState.get();
if (s != null && s.out != null && s.out != System.out)
{
s.out.close();
}
return response;
java.net.URISyntaxException: Illegal character in path at index 126: s3n://comp-data-bckp/data/datav/sample_test/sample_test_inner/2016-06-27/hive/warehouse/datav/sample_test_inner/platform=SONY PS3
When we try to escape the space character with below options system still throws the above error.
- \\ (eg. S3n://…./ platform=SONY\\ PS3)
- %20 (eg. S3n://…./ platform=SONY%20PS3)
- + (eg. S3n://…./ platform=SONY+PS3)
Please assist if there are any options to escape it and provide inputs for proceeding further.