Skip to content

Commit

Permalink
Add type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
yuokada committed Dec 8, 2019
1 parent 3a73fa2 commit c1c7685
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ object OrcOutputPluginHelper {
case _ => false
}

def getSchema(fpath: String) = {
val schema = fpath.split("://").toList.apply(0)
def getSchema(fpath: String): String = {
val schema = fpath.split("://").toList.head
schema match {
case "s3" | "s3a" | "s3n" => schema
case _ => {
Expand All @@ -46,12 +46,13 @@ object OrcOutputPluginHelper {
}
}

def parseS3Url(s3url: String) = {
def parseS3Url(s3url: String): AmazonS3URILikeObject = {
val parts = s3url.split("(://|/)").toList
val bucket = parts.apply(1)
val key = parts.slice(2, parts.size).mkString("/")
new OrcOutputPluginHelper.AmazonS3URILikeObject(bucket, key)
}

case class AmazonS3URILikeObject(@BeanProperty bucket: String, @BeanProperty key: String)

}

0 comments on commit c1c7685

Please sign in to comment.