Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
case-insensitive option matches
  • Loading branch information
maropu committed Sep 14, 2017
commit b543e710dae79da33a9334d5bbe4bb474a44b39c
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,20 @@ class TPCDSQueryBenchmarkArguments(val args: Array[String]) {
parseArgs(args.toList)
validateArguments()

private def optionMatch(optionName: String, s: String): Boolean = {
optionName == s.toLowerCase(Locale.ROOT)
}

private def parseArgs(inputArgs: List[String]): Unit = {
var args = inputArgs

while(args.nonEmpty) {
while (args.nonEmpty) {
args match {
case ("--data-location") :: value :: tail =>
case optName :: value :: tail if optionMatch("--data-location", optName) =>
dataLocation = value
args = tail

case ("--query-filter") :: value :: tail =>
case optName :: value :: tail if optionMatch("--query-filter", optName) =>
queryFilter = value.toLowerCase(Locale.ROOT).split(",").map(_.trim).toSet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also make "--data-location" case insensitive?

Copy link
Member Author

@maropu maropu Sep 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

args = tail

Expand Down