Github user steveloughran commented on a diff in the pull request: https://github.com/apache/spark/pull/8512#discussion_r47081146 --- Diff: core/src/test/scala/org/apache/spark/deploy/SparkS3UtilSuite.scala --- @@ -0,0 +1,90 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.deploy + +import java.util.Date + +import scala.collection.mutable.ArrayBuffer + +import org.apache.hadoop.fs.{FileStatus, Path} +import org.apache.hadoop.mapred.{InputSplit, FileInputFormat, JobConf} + +import org.apache.spark.SparkFunSuite + +class SparkS3UtilSuite extends SparkFunSuite { + test("s3ListingEnabled function") { + val jobConf = new JobConf() + + // Disabled by user + SparkS3Util.sparkConf.set("spark.s3.bulk.listing.enabled", "false") + FileInputFormat.setInputPaths(jobConf, "s3://bucket/dir/file") + assert(SparkS3Util.s3BulkListingEnabled(jobConf) == false) + + // Input paths contain wildcards + SparkS3Util.sparkConf.set("spark.s3.bulk.listing.enabled", "true") + FileInputFormat.setInputPaths(jobConf, "s3://bucket/dir/*") + assert(SparkS3Util.s3BulkListingEnabled(jobConf) == false) + + // Input paths copntain non-S3 files + SparkS3Util.sparkConf.set("spark.s3.bulk.listing.enabled", "true") + FileInputFormat.setInputPaths(jobConf, "file://dir/file") + assert(SparkS3Util.s3BulkListingEnabled(jobConf) == false) + } + + test("isSplitable function") { --- End diff -- go on, spell Splittable correctly, even if the mis-spelling is hard coded in the Hadoop API
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org