GitHub user windpiger opened a pull request:
https://github.com/apache/spark/pull/17149
[SPARK-19257][SQL][WIP]location for table/partition/database should be
java.net.URI
## What changes were proposed in this pull request?
Currently we treat the location of table/partition/database as URI string.
It will be safer if we can make the type of location as java.net.URI.
In this PR, there are following classes changes:
**1. CatalogDatabase**
```
case class CatalogDatabase(
name: String,
description: String,
locationUri: String,
properties: Map[String, String])
--->
case class CatalogDatabase(
name: String,
description: String,
locationUri: URI,
properties: Map[String, String])
```
**2. CatalogStorageFormat**
```
case class CatalogStorageFormat(
locationUri: Option[String],
inputFormat: Option[String],
outputFormat: Option[String],
serde: Option[String],
compressed: Boolean,
properties: Map[String, String])
---->
case class CatalogStorageFormat(
locationUri: Option[URI],
inputFormat: Option[String],
outputFormat: Option[String],
serde: Option[String],
compressed: Boolean,
properties: Map[String, String])
```
Before and After this PR, it is transparent for user, there is no change
that the user should concern. The `String` to `URI` just happened in SparkSQL
internally.
Here list some operation related location:
**1. whitespace in the location**
**2. colon(:) in the location**
**3. percent sign(%) in the location**
## How was this patch tested?
N/A
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/windpiger/spark changeStringToURI
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/17149.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #17149
----
commit 38436e84d4647d545e1ff44a5012de6d161c2af4
Author: windpiger <[email protected]>
Date: 2017-03-03T07:23:47Z
convert to URI
commit 69a16464dc179094af89cdc3077e279fe4656959
Author: windpiger <[email protected]>
Date: 2017-03-03T09:46:34Z
fix some sytle
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]