Skip to content

Commit

Permalink
Scala Hadoop Enrich: removed %3D support (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
fblundun committed Jun 25, 2014
1 parent 281c7a9 commit cda6b35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ScalazArgs(args: Args) {
*/
def requiredz(key: String): ValidatedMessage[String] = args.list(key) match {
case List() => "Required argument [%s] not found".format(key).toProcessingMessage.fail[String]
case List(a) => decodeEquals(a).success
case List(a) => a.success
case _ => "List of values found for argument [%s], should be one".format(key).toProcessingMessage.fail[String]
}

Expand All @@ -88,19 +88,8 @@ class ScalazArgs(args: Args) {
*/
def optionalz(key: String): ValidatedMessage[Option[String]] = args.list(key) match {
case List() => None.success
case List(a) => Some(decodeEquals(a)).success
case List(a) => Some(a).success
case _ => "List of values found for argument [%s], should be at most one".format(key).toProcessingMessage.fail
}

/**
* URL-decodes %3D to =
* Used to get around Scalding Args which
* assumes = is part of an arg=val assignment
* @param str An argument string possibly
* containing one or more %3D
* @return the incoming argument string, with
* any instance of %3D replaced with =
*/
private def decodeEquals(str: String): String =
str.replaceAll("%3D", "=")
}
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Scala Hadoop Enrich: bumped to Scala Common Enrich 0.5.0
Scala Hadoop Enrich: created EnrichmentConfigRegistry.scala
Scala Hadoop Enrich: passed etl_tstamp into Scala Common Enrich (#817)
Scala Hadoop Enrich: removed event_vendor and ue_name and renamed ue_properties to unstruct_event (#835)
Scala Hadoop Enrich: removed %3D support (#850) - TODO
Scala Hadoop Enrich: removed %3D support (#850)
Scala Hadoop Enrich: bumped Scalding to 0.10.0 (#848)
Scala Hadoop Enrich: removed %3D support for old Scalding support (#849) - TODO
Redshift: bumped table-def to 0.4.0
Expand Down

0 comments on commit cda6b35

Please sign in to comment.