Repository: hive Updated Branches: refs/heads/master ffce22589 -> edb7b8893
HIVE-11147 : MetaTool doesn't update FS root location for partitions with space in name (Wei Zheng via Thejas Nair) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/edb7b889 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/edb7b889 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/edb7b889 Branch: refs/heads/master Commit: edb7b889336398f3c3b72b29eea85ef3457e6abb Parents: ffce225 Author: Thejas Nair <the...@hortonworks.com> Authored: Tue Jun 30 20:06:24 2015 -0700 Committer: Thejas Nair <the...@hortonworks.com> Committed: Tue Jun 30 20:06:24 2015 -0700 ---------------------------------------------------------------------- .../hadoop/hive/metastore/ObjectStore.java | 26 +++++++------------- 1 file changed, 9 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/edb7b889/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java ---------------------------------------------------------------------- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java index 417ecc8..4273c0b 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java @@ -23,7 +23,6 @@ import static org.apache.commons.lang.StringUtils.join; import java.io.IOException; import java.net.InetAddress; import java.net.URI; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -58,6 +57,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configurable; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.common.FileUtils; import org.apache.hadoop.hive.common.ObjectPair; import org.apache.hadoop.hive.common.classification.InterfaceAudience; @@ -5568,10 +5568,8 @@ public class ObjectStore implements RawStore, Configurable { URI locationURI = null; String location = mDB.getLocationUri(); try { - locationURI = new URI(location); - } catch(URISyntaxException e) { - badRecords.add(location); - } catch (NullPointerException e) { + locationURI = new Path(location).toUri(); + } catch (IllegalArgumentException e) { badRecords.add(location); } if (locationURI == null) { @@ -5631,10 +5629,8 @@ public class ObjectStore implements RawStore, Configurable { if (parameters.containsKey(tblPropKey)) { String tablePropLocation = parameters.get(tblPropKey); try { - tablePropLocationURI = new URI(tablePropLocation); - } catch (URISyntaxException e) { - badRecords.add(tablePropLocation); - } catch (NullPointerException e) { + tablePropLocationURI = new Path(tablePropLocation).toUri(); + } catch (IllegalArgumentException e) { badRecords.add(tablePropLocation); } // if tablePropKey that was passed in lead to a valid URI resolution, update it if @@ -5778,10 +5774,8 @@ public class ObjectStore implements RawStore, Configurable { URI locationURI = null; String location = mSDS.getLocation(); try { - locationURI = new URI(location); - } catch (URISyntaxException e) { - badRecords.add(location); - } catch (NullPointerException e) { + locationURI = new Path(location).toUri(); + } catch (IllegalArgumentException e) { badRecords.add(location); } if (locationURI == null) { @@ -5859,10 +5853,8 @@ public class ObjectStore implements RawStore, Configurable { String schemaLoc = mSerde.getParameters().get(serdeProp); URI schemaLocURI = null; try { - schemaLocURI = new URI(schemaLoc); - } catch (URISyntaxException e) { - badRecords.add(schemaLoc); - } catch (NullPointerException e) { + schemaLocURI = new Path(schemaLoc).toUri(); + } catch (IllegalArgumentException e) { badRecords.add(schemaLoc); } if (schemaLocURI == null) {