Skip to content
Snippets Groups Projects
  1. Dec 21, 2016
    • Shixiong Zhu's avatar
      [SPARK-18588][SS][KAFKA] Create a new KafkaConsumer when error happens to fix the flaky test · 95efc895
      Shixiong Zhu authored
      ## What changes were proposed in this pull request?
      
      When KafkaSource fails on Kafka errors, we should create a new consumer to retry rather than using the existing broken one because it's possible that the broken one will fail again.
      
      This PR also assigns a new group id to the new created consumer for a possible race condition:  the broken consumer cannot talk with the Kafka cluster in `close` but the new consumer can talk to Kafka cluster. I'm not sure if this will happen or not. Just for safety to avoid that the Kafka cluster thinks there are two consumers with the same group id in a short time window. (Note: CachedKafkaConsumer doesn't need this fix since `assign` never uses the group id.)
      
      ## How was this patch tested?
      
      In https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/70370/console , it ran this flaky test 120 times and all passed.
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #16282 from zsxwing/kafka-fix.
      95efc895
    • Reynold Xin's avatar
      [SPARK-18775][SQL] Limit the max number of records written per file · 354e9361
      Reynold Xin authored
      ## What changes were proposed in this pull request?
      Currently, Spark writes a single file out per task, sometimes leading to very large files. It would be great to have an option to limit the max number of records written per file in a task, to avoid humongous files.
      
      This patch introduces a new write config option `maxRecordsPerFile` (default to a session-wide setting `spark.sql.files.maxRecordsPerFile`) that limits the max number of records written to a single file. A non-positive value indicates there is no limit (same behavior as not having this flag).
      
      ## How was this patch tested?
      Added test cases in PartitionedWriteSuite for both dynamic partition insert and non-dynamic partition insert.
      
      Author: Reynold Xin <rxin@databricks.com>
      
      Closes #16204 from rxin/SPARK-18775.
      354e9361
    • Shixiong Zhu's avatar
      [SPARK-18954][TESTS] Fix flaky test: o.a.s.streaming.BasicOperationsSuite rdd... · 078c71c2
      Shixiong Zhu authored
      [SPARK-18954][TESTS] Fix flaky test: o.a.s.streaming.BasicOperationsSuite rdd cleanup - map and window
      
      ## What changes were proposed in this pull request?
      
      The issue in this test is the cleanup of RDDs may not be able to finish before stopping StreamingContext. This PR basically just puts the assertions into `eventually` and runs it before stopping StreamingContext.
      
      ## How was this patch tested?
      
      Jenkins
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #16362 from zsxwing/SPARK-18954.
      078c71c2
    • Shixiong Zhu's avatar
      [SPARK-18031][TESTS] Fix flaky test ExecutorAllocationManagerSuite.basic functionality · ccfe60a8
      Shixiong Zhu authored
      ## What changes were proposed in this pull request?
      
      The failure is because in `test("basic functionality")`, it doesn't block until `ExecutorAllocationManager.manageAllocation` is called. This PR just adds StreamManualClock to allow the tests to block on expected wait time to make the test deterministic.
      
      ## How was this patch tested?
      
      Jenkins
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #16321 from zsxwing/SPARK-18031.
      ccfe60a8
    • Tathagata Das's avatar
      [SPARK-18894][SS] Fix event time watermark delay threshold specified in months or years · 607a1e63
      Tathagata Das authored
      ## What changes were proposed in this pull request?
      
      Two changes
      - Fix how delays specified in months and years are translated to milliseconds
      - Following up on #16258, not show watermark when there is no watermarking in the query
      
      ## How was this patch tested?
      Updated and new unit tests
      
      Author: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #16304 from tdas/SPARK-18834-1.
      607a1e63
    • Yin Huai's avatar
      [SPARK-18951] Upgrade com.thoughtworks.paranamer/paranamer to 2.6 · 1a643889
      Yin Huai authored
      ## What changes were proposed in this pull request?
      I recently hit a bug of com.thoughtworks.paranamer/paranamer, which causes jackson fail to handle byte array defined in a case class. Then I find https://github.com/FasterXML/jackson-module-scala/issues/48, which suggests that it is caused by a bug in paranamer. Let's upgrade paranamer. Since we are using jackson 2.6.5 and jackson-module-paranamer 2.6.5 use com.thoughtworks.paranamer/paranamer 2.6, I suggests that we upgrade paranamer to 2.6.
      
      Author: Yin Huai <yhuai@databricks.com>
      
      Closes #16359 from yhuai/SPARK-18951.
      1a643889
    • Wenchen Fan's avatar
      [SPARK-18947][SQL] SQLContext.tableNames should not call Catalog.listTables · b7650f11
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      It's a huge waste to call `Catalog.listTables` in `SQLContext.tableNames`, which only need the table names, while `Catalog.listTables` will get the table metadata for each table name.
      
      ## How was this patch tested?
      
      N/A
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #16352 from cloud-fan/minor.
      b7650f11
    • Dongjoon Hyun's avatar
      [SPARK-18923][DOC][BUILD] Support skipping R/Python API docs · ba4468bb
      Dongjoon Hyun authored
      ## What changes were proposed in this pull request?
      
      We can build Python API docs by `cd ./python/docs && make html for Python` and R API docs by `cd ./R && sh create-docs.sh for R` separately. However, `jekyll` fails in some environments.
      
      This PR aims to support `SKIP_PYTHONDOC` and `SKIP_RDOC` for documentation build in `docs` folder. Currently, we can use `SKIP_SCALADOC` or `SKIP_API`. The reason providing additional options is that the Spark documentation build uses a number of tools to build HTML docs and API docs in Scala, Python and R. Specifically, for Python and R,
      
      - Python API docs requires `sphinx`.
      - R API docs requires `R` installation and `knitr` (and more others libraries).
      
      In other words, we cannot generate Python API docs without R installation. Also, we cannot generate R API docs without Python `sphinx` installation. If Spark provides `SKIP_PYTHONDOC` and `SKIP_RDOC` like `SKIP_SCALADOC`, it would be more convenient.
      
      ## How was this patch tested?
      
      Manual.
      
      **Skipping Scala/Java/Python API Doc Build**
      ```bash
      $ cd docs
      $ SKIP_SCALADOC=1 SKIP_PYTHONDOC=1 jekyll build
      $ ls api
      DESCRIPTION R
      ```
      
      **Skipping Scala/Java/R API Doc Build**
      ```bash
      $ cd docs
      $ SKIP_SCALADOC=1 SKIP_RDOC=1 jekyll build
      $ ls api
      python
      ```
      
      Author: Dongjoon Hyun <dongjoon@apache.org>
      
      Closes #16336 from dongjoon-hyun/SPARK-18923.
      ba4468bb
    • gatorsmile's avatar
      [SPARK-18949][SQL] Add recoverPartitions API to Catalog · 24c0c941
      gatorsmile authored
      ### What changes were proposed in this pull request?
      
      Currently, we only have a SQL interface for recovering all the partitions in the directory of a table and update the catalog. `MSCK REPAIR TABLE` or `ALTER TABLE table RECOVER PARTITIONS`. (Actually, very hard for me to remember `MSCK` and have no clue what it means)
      
      After the new "Scalable Partition Handling", the table repair becomes much more important for making visible the data in the created data source partitioned table.
      
      Thus, this PR is to add it into the Catalog interface. After this PR, users can repair the table by
      ```Scala
      spark.catalog.recoverPartitions("testTable")
      ```
      
      ### How was this patch tested?
      Modified the existing test cases.
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #16356 from gatorsmile/repairTable.
      24c0c941
  2. Dec 20, 2016
    • Burak Yavuz's avatar
      [SPARK-18900][FLAKY-TEST] StateStoreSuite.maintenance · b2dd8ec6
      Burak Yavuz authored
      ## What changes were proposed in this pull request?
      
      It was pretty flaky before 10 days ago.
      https://spark-tests.appspot.com/test-details?suite_name=org.apache.spark.sql.execution.streaming.state.StateStoreSuite&test_name=maintenance
      
      Since no code changes went into this code path to not be so flaky, I'm just increasing the timeouts such that load related flakiness shouldn't be a problem. As you may see from the testing, I haven't been able to reproduce it.
      
      ## How was this patch tested?
      
      2000 retries 5 times
      
      Author: Burak Yavuz <brkyvz@gmail.com>
      
      Closes #16314 from brkyvz/maint-flaky.
      b2dd8ec6
    • Holden Karau's avatar
      [SPARK-18576][PYTHON] Add basic TaskContext information to PySpark · 047a9d92
      Holden Karau authored
      ## What changes were proposed in this pull request?
      
      Adds basic TaskContext information to PySpark.
      
      ## How was this patch tested?
      
      New unit tests to `tests.py` & existing unit tests.
      
      Author: Holden Karau <holden@us.ibm.com>
      
      Closes #16211 from holdenk/SPARK-18576-pyspark-taskcontext.
      047a9d92
    • Burak Yavuz's avatar
      [SPARK-18927][SS] MemorySink for StructuredStreaming can't recover from... · caed8932
      Burak Yavuz authored
      [SPARK-18927][SS] MemorySink for StructuredStreaming can't recover from checkpoint if location is provided in SessionConf
      
      ## What changes were proposed in this pull request?
      
      Checkpoint Location can be defined for a StructuredStreaming on a per-query basis by the `DataStreamWriter` options, but it can also be provided through SparkSession configurations. It should be able to recover in both cases when the OutputMode is Complete for MemorySinks.
      
      ## How was this patch tested?
      
      Unit tests
      
      Author: Burak Yavuz <brkyvz@gmail.com>
      
      Closes #16342 from brkyvz/chk-rec.
      caed8932
    • Liang-Chi Hsieh's avatar
      [SPARK-18281] [SQL] [PYSPARK] Remove timeout for reading data through socket for local iterator · 95c95b71
      Liang-Chi Hsieh authored
      ## What changes were proposed in this pull request?
      
      There is a timeout failure when using `rdd.toLocalIterator()` or `df.toLocalIterator()` for a PySpark RDD and DataFrame:
      
          df = spark.createDataFrame([[1],[2],[3]])
          it = df.toLocalIterator()
          row = next(it)
      
          df2 = df.repartition(1000)  # create many empty partitions which increase materialization time so causing timeout
          it2 = df2.toLocalIterator()
          row = next(it2)
      
      The cause of this issue is, we open a socket to serve the data from JVM side. We set timeout for connection and reading through the socket in Python side. In Python we use a generator to read the data, so we only begin to connect the socket once we start to ask data from it. If we don't consume it immediately, there is connection timeout.
      
      In the other side, the materialization time for RDD partitions is unpredictable. So we can't set a timeout for reading data through the socket. Otherwise, it is very possibly to fail.
      
      ## How was this patch tested?
      
      Added tests into PySpark.
      
      Please review http://spark.apache.org/contributing.html before opening a pull request.
      
      Author: Liang-Chi Hsieh <viirya@gmail.com>
      
      Closes #16263 from viirya/fix-pyspark-localiterator.
      95c95b71
    • Reynold Xin's avatar
      Tiny style improvement. · 150d26ca
      Reynold Xin authored
      150d26ca
  3. Dec 19, 2016
    • Wenchen Fan's avatar
      [SPARK-18899][SPARK-18912][SPARK-18913][SQL] refactor the error checking when... · f923c849
      Wenchen Fan authored
      [SPARK-18899][SPARK-18912][SPARK-18913][SQL] refactor the error checking when append data to an existing table
      
      ## What changes were proposed in this pull request?
      
      When we append data to an existing table with `DataFrameWriter.saveAsTable`, we will do various checks to make sure the appended data is consistent with the existing data.
      
      However, we get the information of the existing table by matching the table relation, instead of looking at the table metadata. This is error-prone, e.g. we only check the number of columns for `HadoopFsRelation`, we forget to check bucketing, etc.
      
      This PR refactors the error checking by looking at the metadata of the existing table, and fix several bugs:
      * SPARK-18899: We forget to check if the specified bucketing matched the existing table, which may lead to a problematic table that has different bucketing in different data files.
      * SPARK-18912: We forget to check the number of columns for non-file-based data source table
      * SPARK-18913: We don't support append data to a table with special column names.
      
      ## How was this patch tested?
      new regression test.
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #16313 from cloud-fan/bug1.
      f923c849
    • Josh Rosen's avatar
      [SPARK-18761][CORE] Introduce "task reaper" to oversee task killing in executors · fa829ce2
      Josh Rosen authored
      ## What changes were proposed in this pull request?
      
      Spark's current task cancellation / task killing mechanism is "best effort" because some tasks may not be interruptible or may not respond to their "killed" flags being set. If a significant fraction of a cluster's task slots are occupied by tasks that have been marked as killed but remain running then this can lead to a situation where new jobs and tasks are starved of resources that are being used by these zombie tasks.
      
      This patch aims to address this problem by adding a "task reaper" mechanism to executors. At a high-level, task killing now launches a new thread which attempts to kill the task and then watches the task and periodically checks whether it has been killed. The TaskReaper will periodically re-attempt to call `TaskRunner.kill()` and will log warnings if the task keeps running. I modified TaskRunner to rename its thread at the start of the task, allowing TaskReaper to take a thread dump and filter it in order to log stacktraces from the exact task thread that we are waiting to finish. If the task has not stopped after a configurable timeout then the TaskReaper will throw an exception to trigger executor JVM death, thereby forcibly freeing any resources consumed by the zombie tasks.
      
      This feature is flagged off by default and is controlled by four new configurations under the `spark.task.reaper.*` namespace. See the updated `configuration.md` doc for details.
      
      ## How was this patch tested?
      
      Tested via a new test case in `JobCancellationSuite`, plus manual testing.
      
      Author: Josh Rosen <joshrosen@databricks.com>
      
      Closes #16189 from JoshRosen/cancellation.
      fa829ce2
    • Josh Rosen's avatar
      [SPARK-18928] Check TaskContext.isInterrupted() in FileScanRDD, JDBCRDD & UnsafeSorter · 5857b9ac
      Josh Rosen authored
      ## What changes were proposed in this pull request?
      
      In order to respond to task cancellation, Spark tasks must periodically check `TaskContext.isInterrupted()`, but this check is missing on a few critical read paths used in Spark SQL, including `FileScanRDD`, `JDBCRDD`, and UnsafeSorter-based sorts. This can cause interrupted / cancelled tasks to continue running and become zombies (as also described in #16189).
      
      This patch aims to fix this problem by adding `TaskContext.isInterrupted()` checks to these paths. Note that I could have used `InterruptibleIterator` to simply wrap a bunch of iterators but in some cases this would have an adverse performance penalty or might not be effective due to certain special uses of Iterators in Spark SQL. Instead, I inlined `InterruptibleIterator`-style logic into existing iterator subclasses.
      
      ## How was this patch tested?
      
      Tested manually in `spark-shell` with two different reproductions of non-cancellable tasks, one involving scans of huge files and another involving sort-merge joins that spill to disk. Both causes of zombie tasks are fixed by the changes added here.
      
      Author: Josh Rosen <joshrosen@databricks.com>
      
      Closes #16340 from JoshRosen/sql-task-interruption.
      5857b9ac
    • Shivaram Venkataraman's avatar
      [SPARK-18836][CORE] Serialize one copy of task metrics in DAGScheduler · 4cb49412
      Shivaram Venkataraman authored
      ## What changes were proposed in this pull request?
      
      Right now we serialize the empty task metrics once per task – Since this is shared across all tasks we could use the same serialized task metrics across all tasks of a stage.
      
      ## How was this patch tested?
      
      - [x] Run tests on EC2 to measure performance improvement
      
      Author: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
      
      Closes #16261 from shivaram/task-metrics-one-copy.
      4cb49412
    • jiangxingbo's avatar
      [SPARK-18624][SQL] Implicit cast ArrayType(InternalType) · 70d495dc
      jiangxingbo authored
      ## What changes were proposed in this pull request?
      
      Currently `ImplicitTypeCasts` doesn't handle casts between `ArrayType`s, this is not convenient, we should add a rule to enable casting from `ArrayType(InternalType)` to `ArrayType(newInternalType)`.
      
      Goals:
      1. Add a rule to `ImplicitTypeCasts` to enable casting between `ArrayType`s;
      2. Simplify `Percentile` and `ApproximatePercentile`.
      
      ## How was this patch tested?
      
      Updated test cases in `TypeCoercionSuite`.
      
      Author: jiangxingbo <jiangxb1987@gmail.com>
      
      Closes #16057 from jiangxb1987/implicit-cast-complex-types.
      70d495dc
    • Wenchen Fan's avatar
      [SPARK-18921][SQL] check database existence with Hive.databaseExists instead of getDatabase · 7a75ee1c
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      It's weird that we use `Hive.getDatabase` to check the existence of a database, while Hive has a `databaseExists` interface.
      
      What's worse, `Hive.getDatabase` will produce an error message if the database doesn't exist, which is annoying when we only want to check the database existence.
      
      This PR fixes this and use `Hive.databaseExists` to check database existence.
      
      ## How was this patch tested?
      
      N/A
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #16332 from cloud-fan/minor.
      7a75ee1c
    • xuanyuanking's avatar
      [SPARK-18700][SQL] Add StripedLock for each table's relation in cache · 24482858
      xuanyuanking authored
      ## What changes were proposed in this pull request?
      
      As the scenario describe in [SPARK-18700](https://issues.apache.org/jira/browse/SPARK-18700), when cachedDataSourceTables invalided, the coming few queries will fetch all FileStatus in listLeafFiles function. In the condition of table has many partitions, these jobs will occupy much memory of driver finally may cause driver OOM.
      
      In this patch, add StripedLock for each table's relation in cache not for the whole cachedDataSourceTables, each table's load cache operation protected by it.
      
      ## How was this patch tested?
      
      Add a multi-thread access table test in `PartitionedTablePerfStatsSuite` and check it only loading once using metrics in `HiveCatalogMetrics`
      
      Author: xuanyuanking <xyliyuanjian@gmail.com>
      
      Closes #16135 from xuanyuanking/SPARK-18700.
      24482858
    • Zakaria_Hili's avatar
      [SPARK-18356][ML] KMeans should cache RDD before training · 7db09abb
      Zakaria_Hili authored
      ## What changes were proposed in this pull request?
      
      According to request of Mr. Joseph Bradley , I did this update of my PR https://github.com/apache/spark/pull/15965 in order to eliminate the extrat fit() method.
      
      jkbradley
      ## How was this patch tested?
      Pass existing tests
      
      Author: Zakaria_Hili <zakahili@gmail.com>
      Author: HILI Zakaria <zakahili@gmail.com>
      
      Closes #16295 from ZakariaHili/zakbranch.
      7db09abb
  4. Dec 18, 2016
    • Yuming Wang's avatar
      [SPARK-18827][CORE] Fix cannot read broadcast on disk · 1e5c51f3
      Yuming Wang authored
      ## What changes were proposed in this pull request?
      `NoSuchElementException` will throw since https://github.com/apache/spark/pull/15056 if a broadcast cannot cache in memory. The reason is that that change cannot cover `!unrolled.hasNext` in `next()` function.
      
      This change is to cover the `!unrolled.hasNext` and check `hasNext` before calling `next` in `blockManager.getLocalValues` to make it  more robust.
      
      We can cache and read broadcast even it cannot fit in memory from this pull request.
      
      Exception log:
      ```
      16/12/10 10:10:04 INFO UnifiedMemoryManager: Will not store broadcast_131 as the required space (1048576 bytes) exceeds our memory limit (122764 bytes)
      16/12/10 10:10:04 WARN MemoryStore: Failed to reserve initial memory threshold of 1024.0 KB for computing block broadcast_131 in memory.
      16/12/10 10:10:04 WARN MemoryStore: Not enough space to cache broadcast_131 in memory! (computed 384.0 B so far)
      16/12/10 10:10:04 INFO MemoryStore: Memory use = 95.6 KB (blocks) + 0.0 B (scratch space shared across 0 tasks(s)) = 95.6 KB. Storage limit = 119.9 KB.
      16/12/10 10:10:04 ERROR Utils: Exception encountered
      java.util.NoSuchElementException
      	at org.apache.spark.util.collection.PrimitiveVector$$anon$1.next(PrimitiveVector.scala:58)
      	at org.apache.spark.storage.memory.PartiallyUnrolledIterator.next(MemoryStore.scala:700)
      	at org.apache.spark.util.CompletionIterator.next(CompletionIterator.scala:30)
      	at org.apache.spark.broadcast.TorrentBroadcast$$anonfun$readBroadcastBlock$1$$anonfun$2.apply(TorrentBroadcast.scala:210)
      	at org.apache.spark.broadcast.TorrentBroadcast$$anonfun$readBroadcastBlock$1$$anonfun$2.apply(TorrentBroadcast.scala:210)
      	at scala.Option.map(Option.scala:146)
      	at org.apache.spark.broadcast.TorrentBroadcast$$anonfun$readBroadcastBlock$1.apply(TorrentBroadcast.scala:210)
      	at org.apache.spark.util.Utils$.tryOrIOException(Utils.scala:1269)
      	at org.apache.spark.broadcast.TorrentBroadcast.readBroadcastBlock(TorrentBroadcast.scala:206)
      	at org.apache.spark.broadcast.TorrentBroadcast._value$lzycompute(TorrentBroadcast.scala:66)
      	at org.apache.spark.broadcast.TorrentBroadcast._value(TorrentBroadcast.scala:66)
      	at org.apache.spark.broadcast.TorrentBroadcast.getValue(TorrentBroadcast.scala:96)
      	at org.apache.spark.broadcast.Broadcast.value(Broadcast.scala:70)
      	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:86)
      	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
      	at org.apache.spark.scheduler.Task.run(Task.scala:108)
      	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      16/12/10 10:10:04 ERROR Executor: Exception in task 1.0 in stage 86.0 (TID 134423)
      java.io.IOException: java.util.NoSuchElementException
      	at org.apache.spark.util.Utils$.tryOrIOException(Utils.scala:1276)
      	at org.apache.spark.broadcast.TorrentBroadcast.readBroadcastBlock(TorrentBroadcast.scala:206)
      	at org.apache.spark.broadcast.TorrentBroadcast._value$lzycompute(TorrentBroadcast.scala:66)
      	at org.apache.spark.broadcast.TorrentBroadcast._value(TorrentBroadcast.scala:66)
      	at org.apache.spark.broadcast.TorrentBroadcast.getValue(TorrentBroadcast.scala:96)
      	at org.apache.spark.broadcast.Broadcast.value(Broadcast.scala:70)
      	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:86)
      	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
      	at org.apache.spark.scheduler.Task.run(Task.scala:108)
      	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.util.NoSuchElementException
      	at org.apache.spark.util.collection.PrimitiveVector$$anon$1.next(PrimitiveVector.scala:58)
      	at org.apache.spark.storage.memory.PartiallyUnrolledIterator.next(MemoryStore.scala:700)
      	at org.apache.spark.util.CompletionIterator.next(CompletionIterator.scala:30)
      	at org.apache.spark.broadcast.TorrentBroadcast$$anonfun$readBroadcastBlock$1$$anonfun$2.apply(TorrentBroadcast.scala:210)
      	at org.apache.spark.broadcast.TorrentBroadcast$$anonfun$readBroadcastBlock$1$$anonfun$2.apply(TorrentBroadcast.scala:210)
      	at scala.Option.map(Option.scala:146)
      	at org.apache.spark.broadcast.TorrentBroadcast$$anonfun$readBroadcastBlock$1.apply(TorrentBroadcast.scala:210)
      	at org.apache.spark.util.Utils$.tryOrIOException(Utils.scala:1269)
      	... 12 more
      ```
      
      ## How was this patch tested?
      
      Add unit test
      
      Author: Yuming Wang <wgyumg@gmail.com>
      
      Closes #16252 from wangyum/SPARK-18827.
      1e5c51f3
    • gatorsmile's avatar
      [SPARK-18918][DOC] Missing </td> in Configuration page · c0c9e1d2
      gatorsmile authored
      ### What changes were proposed in this pull request?
      The configuration page looks messy now, as shown in the nightly build:
      https://people.apache.org/~pwendell/spark-nightly/spark-master-docs/latest/configuration.html
      
      Starting from the following location:
      
      ![screenshot 2016-12-18 00 26 33](https://cloud.githubusercontent.com/assets/11567269/21292396/ace4719c-c4b8-11e6-8dfd-d9ab95be43d5.png)
      
      ### How was this patch tested?
      Attached is the screenshot generated in my local computer after the fix.
      [Configuration - Spark 2.2.0 Documentation.pdf](https://github.com/apache/spark/files/659315/Configuration.-.Spark.2.2.0.Documentation.pdf)
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #16327 from gatorsmile/docFix.
      c0c9e1d2
  5. Dec 17, 2016
  6. Dec 16, 2016
    • hyukjinkwon's avatar
      [SPARK-18895][TESTS] Fix resource-closing-related and path-related test... · 2bc1c951
      hyukjinkwon authored
      [SPARK-18895][TESTS] Fix resource-closing-related and path-related test failures in identified ones on Windows
      
      ## What changes were proposed in this pull request?
      
      There are several tests failing due to resource-closing-related and path-related  problems on Windows as below.
      
      - `RPackageUtilsSuite`:
      
      ```
      - build an R package from a jar end to end *** FAILED *** (1 second, 625 milliseconds)
        java.io.IOException: Unable to delete file: C:\projects\spark\target\tmp\1481729427517-0\a\dep2\d\dep2-d.jar
        at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2279)
        at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653)
        at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535)
      
      - faulty R package shows documentation *** FAILED *** (359 milliseconds)
        java.io.IOException: Unable to delete file: C:\projects\spark\target\tmp\1481729428970-0\dep1-c.jar
        at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2279)
        at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653)
        at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535)
      
      - SparkR zipping works properly *** FAILED *** (47 milliseconds)
        java.util.regex.PatternSyntaxException: Unknown character property name {r} near index 4
      
      C:\projects\spark\target\tmp\1481729429282-0
      
          ^
        at java.util.regex.Pattern.error(Pattern.java:1955)
        at java.util.regex.Pattern.charPropertyNodeFor(Pattern.java:2781)
      ```
      
      - `InputOutputMetricsSuite`:
      
      ```
      - input metrics for old hadoop with coalesce *** FAILED *** (240 milliseconds)
        java.io.IOException: Not a file: file:/C:/projects/spark/core/ignored
        at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:277)
        at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:202)
        at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:252)
      
      - input metrics with cache and coalesce *** FAILED *** (109 milliseconds)
        java.io.IOException: Not a file: file:/C:/projects/spark/core/ignored
        at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:277)
        at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:202)
        at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:252)
      
      - input metrics for new Hadoop API with coalesce *** FAILED *** (0 milliseconds)
        java.lang.IllegalArgumentException: Wrong FS: file://C:\projects\spark\target\tmp\spark-9366ec94-dac7-4a5c-a74b-3e7594a692ab\test\InputOutputMetricsSuite.txt, expected: file:///
        at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:642)
        at org.apache.hadoop.fs.FileSystem.makeQualified(FileSystem.java:462)
        at org.apache.hadoop.fs.FilterFileSystem.makeQualified(FilterFileSystem.java:114)
      
      - input metrics when reading text file *** FAILED *** (110 milliseconds)
        java.io.IOException: Not a file: file:/C:/projects/spark/core/ignored
        at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:277)
        at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:202)
        at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:252)
      
      - input metrics on records read - simple *** FAILED *** (125 milliseconds)
        java.io.IOException: Not a file: file:/C:/projects/spark/core/ignored
        at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:277)
        at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:202)
        at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:252)
      
      - input metrics on records read - more stages *** FAILED *** (110 milliseconds)
        java.io.IOException: Not a file: file:/C:/projects/spark/core/ignored
        at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:277)
        at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:202)
        at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:252)
      
      - input metrics on records - New Hadoop API *** FAILED *** (16 milliseconds)
        java.lang.IllegalArgumentException: Wrong FS: file://C:\projects\spark\target\tmp\spark-3f10a1a4-7820-4772-b821-25fd7523bf6f\test\InputOutputMetricsSuite.txt, expected: file:///
        at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:642)
        at org.apache.hadoop.fs.FileSystem.makeQualified(FileSystem.java:462)
        at org.apache.hadoop.fs.FilterFileSystem.makeQualified(FilterFileSystem.java:114)
      
      - input metrics on records read with cache *** FAILED *** (93 milliseconds)
        java.io.IOException: Not a file: file:/C:/projects/spark/core/ignored
        at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:277)
        at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:202)
        at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:252)
      
      - input read/write and shuffle read/write metrics all line up *** FAILED *** (93 milliseconds)
        java.io.IOException: Not a file: file:/C:/projects/spark/core/ignored
        at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:277)
        at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:202)
        at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:252)
      
      - input metrics with interleaved reads *** FAILED *** (0 milliseconds)
        java.lang.IllegalArgumentException: Wrong FS: file://C:\projects\spark\target\tmp\spark-2638d893-e89b-47ce-acd0-bbaeee78dd9b\InputOutputMetricsSuite_cart.txt, expected: file:///
        at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:642)
        at org.apache.hadoop.fs.FileSystem.makeQualified(FileSystem.java:462)
        at org.apache.hadoop.fs.FilterFileSystem.makeQualified(FilterFileSystem.java:114)
      
      - input metrics with old CombineFileInputFormat *** FAILED *** (157 milliseconds)
        17947 was not greater than or equal to 300000 (InputOutputMetricsSuite.scala:324)
        org.scalatest.exceptions.TestFailedException:
        at org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:500)
        at org.scalatest.FunSuite.newAssertionFailedException(FunSuite.scala:1555)
        at org.scalatest.Assertions$AssertionsHelper.macroAssert(Assertions.scala:466)
      
      - input metrics with new CombineFileInputFormat *** FAILED *** (16 milliseconds)
        java.lang.IllegalArgumentException: Wrong FS: file://C:\projects\spark\target\tmp\spark-11920c08-19d8-4c7c-9fba-28ed72b79f80\test\InputOutputMetricsSuite.txt, expected: file:///
        at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:642)
        at org.apache.hadoop.fs.FileSystem.makeQualified(FileSystem.java:462)
        at org.apache.hadoop.fs.FilterFileSystem.makeQualified(FilterFileSystem.java:114)
      ```
      
      - `ReplayListenerSuite`:
      
      ```
      - End-to-end replay *** FAILED *** (121 milliseconds)
        java.io.IOException: No FileSystem for scheme: C
        at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2421)
        at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2428)
      
      - End-to-end replay with compression *** FAILED *** (516 milliseconds)
        java.io.IOException: No FileSystem for scheme: C
        at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2421)
        at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2428)
        at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:88)
      ```
      
      - `EventLoggingListenerSuite`:
      
      ```
      - End-to-end event logging *** FAILED *** (7 seconds, 435 milliseconds)
        java.io.IOException: No FileSystem for scheme: C
        at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2421)
        at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2428)
        at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:88)
      
      - End-to-end event logging with compression *** FAILED *** (1 second)
        java.io.IOException: No FileSystem for scheme: C
        at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2421)
        at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2428)
        at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:88)
      
      - Event log name *** FAILED *** (16 milliseconds)
        "file:/[]base-dir/app1" did not equal "file:/[C:/]base-dir/app1" (EventLoggingListenerSuite.scala:123)
        org.scalatest.exceptions.TestFailedException:
        at org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:500)
        at org.scalatest.FunSuite.newAssertionFailedException(FunSuite.scala:1555)
        at org.scalatest.Assertions$AssertionsHelper.macroAssert(Assertions.scala:466)
      ```
      
      This PR proposes to fix the test failures on Windows
      
      ## How was this patch tested?
      
      Manually tested via AppVeyor
      
      **Before**
      
      `RPackageUtilsSuite`: https://ci.appveyor.com/project/spark-test/spark/build/273-RPackageUtilsSuite-before
      `InputOutputMetricsSuite`: https://ci.appveyor.com/project/spark-test/spark/build/272-InputOutputMetricsSuite-before
      `ReplayListenerSuite`: https://ci.appveyor.com/project/spark-test/spark/build/274-ReplayListenerSuite-before
      `EventLoggingListenerSuite`: https://ci.appveyor.com/project/spark-test/spark/build/275-EventLoggingListenerSuite-before
      
      **After**
      
      `RPackageUtilsSuite`: https://ci.appveyor.com/project/spark-test/spark/build/270-RPackageUtilsSuite
      `InputOutputMetricsSuite`: https://ci.appveyor.com/project/spark-test/spark/build/271-InputOutputMetricsSuite
      `ReplayListenerSuite`: https://ci.appveyor.com/project/spark-test/spark/build/277-ReplayListenerSuite-after
      `EventLoggingListenerSuite`: https://ci.appveyor.com/project/spark-test/spark/build/278-EventLoggingListenerSuite-after
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #16305 from HyukjinKwon/RPackageUtilsSuite-InputOutputMetricsSuite.
      2bc1c951
    • Shixiong Zhu's avatar
      [SPARK-18904][SS][TESTS] Merge two FileStreamSourceSuite files · 4faa8a3e
      Shixiong Zhu authored
      ## What changes were proposed in this pull request?
      
      Merge two FileStreamSourceSuite files into one file.
      
      ## How was this patch tested?
      
      Jenkins
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #16315 from zsxwing/FileStreamSourceSuite.
      4faa8a3e
    • Mark Hamstra's avatar
      [SPARK-17769][CORE][SCHEDULER] Some FetchFailure refactoring · 295db825
      Mark Hamstra authored
      ## What changes were proposed in this pull request?
      
      Readability rewrites.
      Changed order of `failedStage.failedOnFetchAndShouldAbort(task.stageAttemptId)` and `disallowStageRetryForTest` evaluation.
      Stage resubmission guard condition changed from `failedStages.isEmpty` to `!failedStages.contains(failedStage)`
      Log all resubmission of stages
      ## How was this patch tested?
      
      existing tests
      
      Author: Mark Hamstra <markhamstra@gmail.com>
      
      Closes #15335 from markhamstra/SPARK-17769.
      295db825
    • Dongjoon Hyun's avatar
      [SPARK-18897][SPARKR] Fix SparkR SQL Test to drop test table · 1169db44
      Dongjoon Hyun authored
      ## What changes were proposed in this pull request?
      
      SparkR tests, `R/run-tests.sh`, succeeds only once because `test_sparkSQL.R` does not clean up the test table, `people`.
      
      As a result, the rows in `people` table are accumulated at every run and the test cases fail.
      
      The following is the failure result for the second run.
      
      ```r
      Failed -------------------------------------------------------------------------
      1. Failure: create DataFrame from RDD (test_sparkSQL.R#204) -------------------
      collect(sql("SELECT age from people WHERE name = 'Bob'"))$age not equal to c(16).
      Lengths differ: 2 vs 1
      
      2. Failure: create DataFrame from RDD (test_sparkSQL.R#206) -------------------
      collect(sql("SELECT height from people WHERE name ='Bob'"))$height not equal to c(176.5).
      Lengths differ: 2 vs 1
      ```
      
      ## How was this patch tested?
      
      Manual. Run `run-tests.sh` twice and check if it passes without failures.
      
      Author: Dongjoon Hyun <dongjoon@apache.org>
      
      Closes #16310 from dongjoon-hyun/SPARK-18897.
      1169db44
    • hyukjinkwon's avatar
      [MINOR][BUILD] Fix lint-check failures and javadoc8 break · ed84cd06
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      This PR proposes to fix lint-check failures and javadoc8 break.
      
      Few errors were introduced as below:
      
      **lint-check failures**
      
      ```
      [ERROR] src/test/java/org/apache/spark/network/TransportClientFactorySuite.java:[45,1] (imports) RedundantImport: Duplicate import to line 43 - org.apache.spark.network.util.MapConfigProvider.
      [ERROR] src/main/java/org/apache/spark/unsafe/types/CalendarInterval.java:[255,10] (modifier) RedundantModifier: Redundant 'final' modifier.
      ```
      
      **javadoc8**
      
      ```
      [error] .../spark/sql/core/target/java/org/apache/spark/sql/streaming/StreamingQueryProgress.java:19: error: bad use of '>'
      [error]  *                   "max" -> "2016-12-05T20:54:20.827Z"  // maximum event time seen in this trigger
      [error]                             ^
      [error] .../spark/sql/core/target/java/org/apache/spark/sql/streaming/StreamingQueryProgress.java:20: error: bad use of '>'
      [error]  *                   "min" -> "2016-12-05T20:54:20.827Z"  // minimum event time seen in this trigger
      [error]                             ^
      [error] .../spark/sql/core/target/java/org/apache/spark/sql/streaming/StreamingQueryProgress.java:21: error: bad use of '>'
      [error]  *                   "avg" -> "2016-12-05T20:54:20.827Z"  // average event time seen in this trigger
      [error]                             ^
      [error] .../spark/sql/core/target/java/org/apache/spark/sql/streaming/StreamingQueryProgress.java:22: error: bad use of '>'
      [error]  *                   "watermark" -> "2016-12-05T20:54:20.827Z"  // watermark used in this trigger
      [error]
      ```
      
      ## How was this patch tested?
      
      Manually checked as below:
      
      **lint-check failures**
      
      ```
      ./dev/lint-java
      Checkstyle checks passed.
      ```
      
      **javadoc8**
      
      This seems hidden in the API doc but I manually checked after removing access modifier as below:
      
      It looks not rendering properly (scaladoc).
      
      ![2016-12-16 3 40 34](https://cloud.githubusercontent.com/assets/6477701/21255175/8df1fe6e-c3ad-11e6-8cda-ce7f76c6677a.png)
      
      After this PR, it renders as below:
      
      - scaladoc
        ![2016-12-16 3 40 23](https://cloud.githubusercontent.com/assets/6477701/21255135/4a11dab6-c3ad-11e6-8ab2-b091c4f45029.png)
      
      - javadoc
        ![2016-12-16 3 41 10](https://cloud.githubusercontent.com/assets/6477701/21255137/4bba1d9c-c3ad-11e6-9b88-62f1f697b56a.png)
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #16307 from HyukjinKwon/lint-javadoc8.
      ed84cd06
    • Aliaksandr.Bedrytski's avatar
      [SPARK-18708][CORE] Improvement/improve docs in spark context file · f7a574a6
      Aliaksandr.Bedrytski authored
      ## What changes were proposed in this pull request?
      
      SparkContext.scala was created a long time ago and contains several types of Scaladocs/Javadocs mixed together. Public methods/fields should have a Scaladoc that is formatted in the same way everywhere. This pull request also adds scaladoc to methods/fields that did not have it before.
      
      ## How was this patch tested?
      
      No actual code was modified, only comments.
      
      Please review http://spark.apache.org/contributing.html before opening a pull request.
      
      Author: Aliaksandr.Bedrytski <aliaksandr.bedrytski@valtech.co.uk>
      
      Closes #16137 from Mironor/improvement/improve-docs-in-spark-context-file.
      f7a574a6
    • Michal Senkyr's avatar
      [SPARK-18723][DOC] Expanded programming guide information on wholeTex… · 836c95b1
      Michal Senkyr authored
      ## What changes were proposed in this pull request?
      
      Add additional information to wholeTextFiles in the Programming Guide. Also explain partitioning policy difference in relation to textFile and its impact on performance.
      
      Also added reference to the underlying CombineFileInputFormat
      
      ## How was this patch tested?
      
      Manual build of documentation and inspection in browser
      
      ```
      cd docs
      jekyll serve --watch
      ```
      
      Author: Michal Senkyr <mike.senkyr@gmail.com>
      
      Closes #16157 from michalsenkyr/wholeTextFilesExpandedDocs.
      836c95b1
    • Takeshi YAMAMURO's avatar
      [SPARK-18108][SQL] Fix a schema inconsistent bug that makes a parquet reader fail to read data · dc2a4d4a
      Takeshi YAMAMURO authored
      ## What changes were proposed in this pull request?
      A vectorized parquet reader fails to read column data if data schema and partition schema overlap with each other and inferred types in the partition schema differ from ones in the data schema. An example code to reproduce this bug is as follows;
      
      ```
      scala> case class A(a: Long, b: Int)
      scala> val as = Seq(A(1, 2))
      scala> spark.createDataFrame(as).write.parquet("/data/a=1/")
      scala> val df = spark.read.parquet("/data/")
      scala> df.printSchema
      root
       |-- a: long (nullable = true)
       |-- b: integer (nullable = true)
      scala> df.collect
      java.lang.NullPointerException
              at org.apache.spark.sql.execution.vectorized.OnHeapColumnVector.getLong(OnHeapColumnVector.java:283)
              at org.apache.spark.sql.execution.vectorized.ColumnarBatch$Row.getLong(ColumnarBatch.java:191)
              at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.apply(Unknown Source)
              at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.apply(Unknown Source)
              at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
              at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
      ```
      The root cause is that a logical layer (`HadoopFsRelation`) and a physical layer (`VectorizedParquetRecordReader`) have a different assumption on partition schema; the logical layer trusts the data schema to infer the type the overlapped partition columns, and, on the other hand, the physical layer trusts partition schema which is inferred from path string. To fix this bug, this pr simply updates `HadoopFsRelation.schema` to respect the partition columns position in data schema and respect the partition columns type in partition schema.
      
      ## How was this patch tested?
      Add tests in `ParquetPartitionDiscoverySuite`
      
      Author: Takeshi YAMAMURO <linguin.m.s@gmail.com>
      
      Closes #16030 from maropu/SPARK-18108.
      dc2a4d4a
    • root's avatar
      [SPARK-18742][CORE] Clarify that user-defined BroadcastFactory is not supported · 53ab8fb3
      root authored
      ## What changes were proposed in this pull request?
      After SPARK-12588 Remove HTTPBroadcast [1], the one and only implementation of BroadcastFactory is TorrentBroadcastFactory and the spark.broadcast.factory conf has removed.
      
      however the scaladoc says [2]:
      
      /**
       * An interface for all the broadcast implementations in Spark (to allow
       * multiple broadcast implementations). SparkContext uses a user-specified
       * BroadcastFactory implementation to instantiate a particular broadcast for the
       * entire Spark job.
       */
      
      so we should modify the comment that SparkContext will not use a  user-specified BroadcastFactory implementation
      
      [1] https://issues.apache.org/jira/browse/SPARK-12588
      [2] https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/broadcast/BroadcastFactory.scala#L25-L30
      
      ## How was this patch tested?
      unit test added
      
      Author: root <root@iZbp1gsnrlfzjxh82cz80vZ.(none)>
      Author: windpiger <songjun@outlook.com>
      
      Closes #16173 from windpiger/addBroadFactoryConf.
      53ab8fb3
    • Shixiong Zhu's avatar
      [SPARK-18850][SS] Make StreamExecution and progress classes serializable · d7f3058e
      Shixiong Zhu authored
      ## What changes were proposed in this pull request?
      
      This PR adds StreamingQueryWrapper to make StreamExecution and progress classes serializable because it is too easy for it to get captured with normal usage. If StreamingQueryWrapper gets captured in a closure but no place calls its methods, it should not fail the Spark tasks. However if its methods are called, then this PR will throw a better message.
      
      ## How was this patch tested?
      
      `test("StreamingQuery should be Serializable but cannot be used in executors")`
      `test("progress classes should be Serializable")`
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #16272 from zsxwing/SPARK-18850.
      d7f3058e
    • Andrew Ray's avatar
      [SPARK-18845][GRAPHX] PageRank has incorrect initialization value that leads to slow convergence · 78062b85
      Andrew Ray authored
      ## What changes were proposed in this pull request?
      
      Change the initial value in all PageRank implementations to be `1.0` instead of `resetProb` (default `0.15`) and use `outerJoinVertices` instead of `joinVertices` so that source vertices get updated in each iteration.
      
      This seems to have been introduced a long time ago in https://github.com/apache/spark/commit/15a564598fe63003652b1e24527c432080b5976c#diff-b2bf3f97dcd2f19d61c921836159cda9L90
      
      With the exception of graphs with sinks (which currently give incorrect results see SPARK-18847) this gives faster convergence as the sum of ranks is already correct (sum of ranks should be number of vertices).
      
      Convergence comparision benchmark for small graph: http://imgur.com/a/HkkZf
      Code for benchmark: https://gist.github.com/aray/a7de1f3801a810f8b1fa00c271a1fefd
      
      ## How was this patch tested?
      
      (corrected) existing unit tests and additional test that verifies against result of igraph and NetworkX on a loop with a source.
      
      Author: Andrew Ray <ray.andrew@gmail.com>
      
      Closes #16271 from aray/pagerank-initial-value.
      78062b85
  7. Dec 15, 2016
    • Reynold Xin's avatar
      [SPARK-18892][SQL] Alias percentile_approx approx_percentile · 172a52f5
      Reynold Xin authored
      ## What changes were proposed in this pull request?
      percentile_approx is the name used in Hive, and approx_percentile is the name used in Presto. approx_percentile is actually more consistent with our approx_count_distinct. Given the cost to alias SQL functions is low (one-liner), it'd be better to just alias them so it is easier to use.
      
      ## How was this patch tested?
      Technically I could add an end-to-end test to verify this one-line change, but it seemed too trivial to me.
      
      Author: Reynold Xin <rxin@databricks.com>
      
      Closes #16300 from rxin/SPARK-18892.
      172a52f5
    • Shivaram Venkataraman's avatar
      [MINOR] Handle fact that mv is different on linux, mac · 5a44f18a
      Shivaram Venkataraman authored
      Follow up to https://github.com/apache/spark/commit/ae853e8f3bdbd16427e6f1ffade4f63abaf74abb as `mv` throws an error on the Jenkins machines if source and destinations are the same.
      
      Author: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
      
      Closes #16302 from shivaram/sparkr-no-mv-fix.
      5a44f18a
    • Shivaram Venkataraman's avatar
      [MINOR] Only rename SparkR tar.gz if names mismatch · 9634018c
      Shivaram Venkataraman authored
      ## What changes were proposed in this pull request?
      
      For release builds the R_PACKAGE_VERSION and VERSION are the same (e.g., 2.1.0). Thus `cp` throws an error which causes the build to fail.
      
      ## How was this patch tested?
      
      Manually by executing the following script
      ```
      set -o pipefail
      set -e
      set -x
      
      touch a
      
      R_PACKAGE_VERSION=2.1.0
      VERSION=2.1.0
      
      if [ "$R_PACKAGE_VERSION" != "$VERSION" ]; then
        cp a a
      fi
      ```
      
      Author: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
      
      Closes #16299 from shivaram/sparkr-cp-fix.
      9634018c
Loading