Skip to content
Snippets Groups Projects
  1. Dec 09, 2016
    • Shivaram Venkataraman's avatar
      [MINOR][SPARKR] Fix SparkR regex in copy command · eb2d9bfd
      Shivaram Venkataraman authored
      
      Fix SparkR package copy regex. The existing code leads to
      ```
      Copying release tarballs to /home/****/public_html/spark-nightly/spark-branch-2.1-bin/spark-2.1.1-SNAPSHOT-2016_12_08_22_38-e8f351f9-bin
      mput: SparkR-*: no files found
      ```
      
      Author: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
      
      Closes #16231 from shivaram/typo-sparkr-build.
      
      (cherry picked from commit be5fc6ef)
      Signed-off-by: default avatarShivaram Venkataraman <shivaram@cs.berkeley.edu>
      eb2d9bfd
    • Xiangrui Meng's avatar
      [SPARK-17822][R] Make JVMObjectTracker a member variable of RBackend · 0c6415ae
      Xiangrui Meng authored
      
      ## What changes were proposed in this pull request?
      
      * This PR changes `JVMObjectTracker` from `object` to `class` and let its instance associated with each RBackend. So we can manage the lifecycle of JVM objects when there are multiple `RBackend` sessions. `RBackend.close` will clear the object tracker explicitly.
      * I assume that `SQLUtils` and `RRunner` do not need to track JVM instances, which could be wrong.
      * Small refactor of `SerDe.sqlSerDe` to increase readability.
      
      ## How was this patch tested?
      
      * Added unit tests for `JVMObjectTracker`.
      * Wait for Jenkins to run full tests.
      
      Author: Xiangrui Meng <meng@databricks.com>
      
      Closes #16154 from mengxr/SPARK-17822.
      
      (cherry picked from commit fd48d80a)
      Signed-off-by: default avatarXiangrui Meng <meng@databricks.com>
      0c6415ae
    • Jacek Laskowski's avatar
      [MINOR][CORE][SQL][DOCS] Typo fixes · b226f10e
      Jacek Laskowski authored
      
      ## What changes were proposed in this pull request?
      
      Typo fixes
      
      ## How was this patch tested?
      
      Local build. Awaiting the official build.
      
      Author: Jacek Laskowski <jacek@japila.pl>
      
      Closes #16144 from jaceklaskowski/typo-fixes.
      
      (cherry picked from commit b162cc0c)
      Signed-off-by: default avatarSean Owen <sowen@cloudera.com>
      b226f10e
    • Zhan Zhang's avatar
      [SPARK-18637][SQL] Stateful UDF should be considered as nondeterministic · 72bf5199
      Zhan Zhang authored
      
      Make stateful udf as nondeterministic
      
      Add new test cases with both Stateful and Stateless UDF.
      Without the patch, the test cases will throw exception:
      
      1 did not equal 10
      ScalaTestFailureLocation: org.apache.spark.sql.hive.execution.HiveUDFSuite$$anonfun$21 at (HiveUDFSuite.scala:501)
      org.scalatest.exceptions.TestFailedException: 1 did not equal 10
              at org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:500)
              at org.scalatest.FunSuite.newAssertionFailedException(FunSuite.scala:1555)
              ...
      
      Author: Zhan Zhang <zhanzhang@fb.com>
      
      Closes #16068 from zhzhan/state.
      
      (cherry picked from commit 67587d96)
      Signed-off-by: default avatarWenchen Fan <wenchen@databricks.com>
      72bf5199
    • Felix Cheung's avatar
      Copy pyspark and SparkR packages to latest release dir too · 2c88e1dc
      Felix Cheung authored
      ## What changes were proposed in this pull request?
      
      Copy pyspark and SparkR packages to latest release dir, as per comment [here](https://github.com/apache/spark/pull/16226#discussion_r91664822
      
      )
      
      Author: Felix Cheung <felixcheung_m@hotmail.com>
      
      Closes #16227 from felixcheung/pyrftp.
      
      (cherry picked from commit c074c96d)
      Signed-off-by: default avatarShivaram Venkataraman <shivaram@cs.berkeley.edu>
      2c88e1dc
    • Shivaram Venkataraman's avatar
      Copy the SparkR source package with LFTP · e8f351f9
      Shivaram Venkataraman authored
      
      This PR adds a line in release-build.sh to copy the SparkR source archive using LFTP
      
      Author: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
      
      Closes #16226 from shivaram/fix-sparkr-copy-build.
      
      (cherry picked from commit 934035ae)
      Signed-off-by: default avatarShivaram Venkataraman <shivaram@cs.berkeley.edu>
      e8f351f9
    • wm624@hotmail.com's avatar
      [SPARK-18349][SPARKR] Update R API documentation on ml model summary · 4ceed95b
      wm624@hotmail.com authored
      
      ## What changes were proposed in this pull request?
      In this PR, the document of `summary` method is improved in the format:
      
      returns summary information of the fitted model, which is a list. The list includes .......
      
      Since `summary` in R is mainly about the model, which is not the same as `summary` object on scala side, if there is one, the scala API doc is not pointed here.
      
      In current document, some `return` have `.` and some don't have. `.` is added to missed ones.
      
      Since spark.logit `summary` has a big refactoring, this PR doesn't include this one. It will be changed when the `spark.logit` PR is merged.
      
      ## How was this patch tested?
      
      Manual build.
      
      Author: wm624@hotmail.com <wm624@hotmail.com>
      
      Closes #16150 from wangmiao1981/audit2.
      
      (cherry picked from commit 86a96034)
      Signed-off-by: default avatarFelix Cheung <felixcheung@apache.org>
      4ceed95b
  2. Dec 08, 2016
    • Shivaram Venkataraman's avatar
      [SPARKR][PYSPARK] Fix R source package name to match Spark version. Remove pip... · ef5646b4
      Shivaram Venkataraman authored
      [SPARKR][PYSPARK] Fix R source package name to match Spark version. Remove pip tar.gz from distribution
      
      ## What changes were proposed in this pull request?
      
      Fixes name of R source package so that the `cp` in release-build.sh works correctly.
      
      Issue discussed in https://github.com/apache/spark/pull/16014#issuecomment-265867125
      
      
      
      Author: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
      
      Closes #16221 from shivaram/fix-sparkr-release-build-name.
      
      (cherry picked from commit 4ac8b20b)
      Signed-off-by: default avatarShivaram Venkataraman <shivaram@cs.berkeley.edu>
      ef5646b4
    • Shixiong Zhu's avatar
      [SPARK-18774][CORE][SQL] Ignore non-existing files when ignoreCorruptFiles is enabled (branch 2.1) · 1cafc76e
      Shixiong Zhu authored
      ## What changes were proposed in this pull request?
      
      Backport #16203 to branch 2.1.
      
      ## How was this patch tested?
      
      Jennkins
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #16216 from zsxwing/SPARK-18774-2.1.
      1cafc76e
    • Tathagata Das's avatar
      [SPARK-18776][SS] Make Offset for FileStreamSource corrected formatted in json · fcd22e53
      Tathagata Das authored
      
      ## What changes were proposed in this pull request?
      
      - Changed FileStreamSource to use new FileStreamSourceOffset rather than LongOffset. The field is named as `logOffset` to make it more clear that this is a offset in the file stream log.
      - Fixed bug in FileStreamSourceLog, the field endId in the FileStreamSourceLog.get(startId, endId) was not being used at all. No test caught it earlier. Only my updated tests caught it.
      
      Other minor changes
      - Dont use batchId in the FileStreamSource, as calling it batch id is extremely miss leading. With multiple sources, it may happen that a new batch has no new data from a file source. So offset of FileStreamSource != batchId after that batch.
      
      ## How was this patch tested?
      
      Updated unit test.
      
      Author: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #16205 from tdas/SPARK-18776.
      
      (cherry picked from commit 458fa332)
      Signed-off-by: default avatarTathagata Das <tathagata.das1565@gmail.com>
      fcd22e53
    • Shivaram Venkataraman's avatar
      [SPARK-18590][SPARKR] Change the R source build to Hadoop 2.6 · e43209fe
      Shivaram Venkataraman authored
      This PR changes the SparkR source release tarball to be built using the Hadoop 2.6 profile. Previously it was using the without hadoop profile which leads to an error as discussed in https://github.com/apache/spark/pull/16014#issuecomment-265843991
      
      
      
      Author: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
      
      Closes #16218 from shivaram/fix-sparkr-release-build.
      
      (cherry picked from commit 202fcd21)
      Signed-off-by: default avatarShivaram Venkataraman <shivaram@cs.berkeley.edu>
      e43209fe
    • Reynold Xin's avatar
      [SPARK-18760][SQL] Consistent format specification for FileFormats · 9483242f
      Reynold Xin authored
      
      ## What changes were proposed in this pull request?
      This patch fixes the format specification in explain for file sources (Parquet and Text formats are the only two that are different from the rest):
      
      Before:
      ```
      scala> spark.read.text("test.text").explain()
      == Physical Plan ==
      *FileScan text [value#15] Batched: false, Format: org.apache.spark.sql.execution.datasources.text.TextFileFormatxyz, Location: InMemoryFileIndex[file:/scratch/rxin/spark/test.text], PartitionFilters: [], PushedFilters: [], ReadSchema: struct<value:string>
      ```
      
      After:
      ```
      scala> spark.read.text("test.text").explain()
      == Physical Plan ==
      *FileScan text [value#15] Batched: false, Format: Text, Location: InMemoryFileIndex[file:/scratch/rxin/spark/test.text], PartitionFilters: [], PushedFilters: [], ReadSchema: struct<value:string>
      ```
      
      Also closes #14680.
      
      ## How was this patch tested?
      Verified in spark-shell.
      
      Author: Reynold Xin <rxin@databricks.com>
      
      Closes #16187 from rxin/SPARK-18760.
      
      (cherry picked from commit 5f894d23)
      Signed-off-by: default avatarReynold Xin <rxin@databricks.com>
      9483242f
    • Shixiong Zhu's avatar
      [SPARK-18751][CORE] Fix deadlock when SparkContext.stop is called in Utils.tryOrStopSparkContext · a0356441
      Shixiong Zhu authored
      
      ## What changes were proposed in this pull request?
      
      When `SparkContext.stop` is called in `Utils.tryOrStopSparkContext` (the following three places), it will cause deadlock because the `stop` method needs to wait for the thread running `stop` to exit.
      
      - ContextCleaner.keepCleaning
      - LiveListenerBus.listenerThread.run
      - TaskSchedulerImpl.start
      
      This PR adds `SparkContext.stopInNewThread` and uses it to eliminate the potential deadlock. I also removed my changes in #15775 since they are not necessary now.
      
      ## How was this patch tested?
      
      Jenkins
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #16178 from zsxwing/fix-stop-deadlock.
      
      (cherry picked from commit 26432df9)
      Signed-off-by: default avatarShixiong Zhu <shixiong@databricks.com>
      a0356441
    • Felix Cheung's avatar
      [SPARK-18590][SPARKR] build R source package when making distribution · d69df907
      Felix Cheung authored
      This PR has 2 key changes. One, we are building source package (aka bundle package) for SparkR which could be released on CRAN. Two, we should include in the official Spark binary distributions SparkR installed from this source package instead (which would have help/vignettes rds needed for those to work when the SparkR package is loaded in R, whereas earlier approach with devtools does not)
      
      But, because of various differences in how R performs different tasks, this PR is a fair bit more complicated. More details below.
      
      This PR also includes a few minor fixes.
      
      These are the additional steps in make-distribution; please see [here](https://github.com/apache/spark/blob/master/R/CRAN_RELEASE.md
      
      ) on what's going to a CRAN release, which is now run during make-distribution.sh.
      1. package needs to be installed because the first code block in vignettes is `library(SparkR)` without lib path
      2. `R CMD build` will build vignettes (this process runs Spark/SparkR code and captures outputs into pdf documentation)
      3. `R CMD check` on the source package will install package and build vignettes again (this time from source packaged) - this is a key step required to release R package on CRAN
       (will skip tests here but tests will need to pass for CRAN release process to success - ideally, during release signoff we should install from the R source package and run tests)
      4. `R CMD Install` on the source package (this is the only way to generate doc/vignettes rds files correctly, not in step # 1)
       (the output of this step is what we package into Spark dist and sparkr.zip)
      
      Alternatively,
         R CMD build should already be installing the package in a temp directory though it might just be finding this location and set it to lib.loc parameter; another approach is perhaps we could try calling `R CMD INSTALL --build pkg` instead.
       But in any case, despite installing the package multiple times this is relatively fast.
      Building vignettes takes a while though.
      
      Manually, CI.
      
      Author: Felix Cheung <felixcheung_m@hotmail.com>
      
      Closes #16014 from felixcheung/rdist.
      
      (cherry picked from commit c3d3a9d0)
      Signed-off-by: default avatarShivaram Venkataraman <shivaram@cs.berkeley.edu>
      d69df907
    • Andrew Ray's avatar
      [SPARK-16589] [PYTHON] Chained cartesian produces incorrect number of records · e0173f14
      Andrew Ray authored
      
      ## What changes were proposed in this pull request?
      
      Fixes a bug in the python implementation of rdd cartesian product related to batching that showed up in repeated cartesian products with seemingly random results. The root cause being multiple iterators pulling from the same stream in the wrong order because of logic that ignored batching.
      
      `CartesianDeserializer` and `PairDeserializer` were changed to implement `_load_stream_without_unbatching` and borrow the one line implementation of `load_stream` from `BatchedSerializer`. The default implementation of `_load_stream_without_unbatching` was changed to give consistent results (always an iterable) so that it could be used without additional checks.
      
      `PairDeserializer` no longer extends `CartesianDeserializer` as it was not really proper. If wanted a new common super class could be added.
      
      Both `CartesianDeserializer` and `PairDeserializer` now only extend `Serializer` (which has no `dump_stream` implementation) since they are only meant for *de*serialization.
      
      ## How was this patch tested?
      
      Additional unit tests (sourced from #14248) plus one for testing a cartesian with zip.
      
      Author: Andrew Ray <ray.andrew@gmail.com>
      
      Closes #16121 from aray/fix-cartesian.
      
      (cherry picked from commit 3c68944b)
      Signed-off-by: default avatarDavies Liu <davies.liu@gmail.com>
      e0173f14
    • Liang-Chi Hsieh's avatar
      [SPARK-18667][PYSPARK][SQL] Change the way to group row in BatchEvalPythonExec... · 726217eb
      Liang-Chi Hsieh authored
      [SPARK-18667][PYSPARK][SQL] Change the way to group row in BatchEvalPythonExec so input_file_name function can work with UDF in pyspark
      
      ## What changes were proposed in this pull request?
      
      `input_file_name` doesn't return filename when working with UDF in PySpark. An example shows the problem:
      
          from pyspark.sql.functions import *
          from pyspark.sql.types import *
      
          def filename(path):
              return path
      
          sourceFile = udf(filename, StringType())
          spark.read.json("tmp.json").select(sourceFile(input_file_name())).show()
      
          +---------------------------+
          |filename(input_file_name())|
          +---------------------------+
          |                           |
          +---------------------------+
      
      The cause of this issue is, we group rows in `BatchEvalPythonExec` for batching processing of PythonUDF. Currently we group rows first and then evaluate expressions on the rows. If the data is less than the required number of rows for a group, the iterator will be consumed to the end before the evaluation. However, once the iterator reaches the end, we will unset input filename. So the input_file_name expression can't return correct filename.
      
      This patch fixes the approach to group the batch of rows. We evaluate the expression first and then group evaluated results to batch.
      
      ## How was this patch tested?
      
      Added unit test to PySpark.
      
      Please review http://spark.apache.org/contributing.html
      
       before opening a pull request.
      
      Author: Liang-Chi Hsieh <viirya@gmail.com>
      
      Closes #16115 from viirya/fix-py-udf-input-filename.
      
      (cherry picked from commit 6a5a7254)
      Signed-off-by: default avatarWenchen Fan <wenchen@databricks.com>
      726217eb
    • Yanbo Liang's avatar
      [SPARK-18325][SPARKR][ML] SparkR ML wrappers example code and user guide · 9095c152
      Yanbo Liang authored
      
      ## What changes were proposed in this pull request?
      * Add all R examples for ML wrappers which were added during 2.1 release cycle.
      * Split the whole ```ml.R``` example file into individual example for each algorithm, which will be convenient for users to rerun them.
      * Add corresponding examples to ML user guide.
      * Update ML section of SparkR user guide.
      
      Note: MLlib Scala/Java/Python examples will be consistent, however, SparkR examples may different from them, since R users may use the algorithms in a different way, for example, using R ```formula``` to specify ```featuresCol``` and ```labelCol```.
      
      ## How was this patch tested?
      Run all examples manually.
      
      Author: Yanbo Liang <ybliang8@gmail.com>
      
      Closes #16148 from yanboliang/spark-18325.
      
      (cherry picked from commit 9bf8f3cd)
      Signed-off-by: default avatarYanbo Liang <ybliang8@gmail.com>
      9095c152
    • Patrick Wendell's avatar
      48aa6775
    • Patrick Wendell's avatar
      Preparing Spark release v2.1.0-rc2 · 08071749
      Patrick Wendell authored
      08071749
  3. Dec 07, 2016
    • Yanbo Liang's avatar
      [SPARK-18326][SPARKR][ML] Review SparkR ML wrappers API for 2.1 · 1c3f1da8
      Yanbo Liang authored
      ## What changes were proposed in this pull request?
      Reviewing SparkR ML wrappers API for 2.1 release, mainly two issues:
      * Remove ```probabilityCol``` from the argument list of ```spark.logit``` and ```spark.randomForest```. Since it was used when making prediction and should be an argument of ```predict```, and we will work on this at [SPARK-18618](https://issues.apache.org/jira/browse/SPARK-18618
      
      ) in the next release cycle.
      * Fix ```spark.als``` params to make it consistent with MLlib.
      
      ## How was this patch tested?
      Existing tests.
      
      Author: Yanbo Liang <ybliang8@gmail.com>
      
      Closes #16169 from yanboliang/spark-18326.
      
      (cherry picked from commit 97255497)
      Signed-off-by: default avatarYanbo Liang <ybliang8@gmail.com>
      1c3f1da8
    • sethah's avatar
      [SPARK-18705][ML][DOC] Update user guide to reflect one pass solver for L1 and elastic-net · ab865cfd
      sethah authored
      
      ## What changes were proposed in this pull request?
      
      WeightedLeastSquares now supports L1 and elastic net penalties and has an additional solver option: QuasiNewton. The docs are updated to reflect this change.
      
      ## How was this patch tested?
      
      Docs only. Generated documentation to make sure Latex looks ok.
      
      Author: sethah <seth.hendrickson16@gmail.com>
      
      Closes #16139 from sethah/SPARK-18705.
      
      (cherry picked from commit 82253617)
      Signed-off-by: default avatarYanbo Liang <ybliang8@gmail.com>
      ab865cfd
    • Tathagata Das's avatar
      [SPARK-18758][SS] StreamingQueryListener events from a StreamingQuery should... · 617ce3ba
      Tathagata Das authored
      [SPARK-18758][SS] StreamingQueryListener events from a StreamingQuery should be sent only to the listeners in the same session as the query
      
      ## What changes were proposed in this pull request?
      
      Listeners added with `sparkSession.streams.addListener(l)` are added to a SparkSession. So events only from queries in the same session as a listener should be posted to the listener. Currently, all the events gets rerouted through the Spark's main listener bus, that is,
      - StreamingQuery posts event to StreamingQueryListenerBus. Only the queries associated with the same session as the bus posts events to it.
      - StreamingQueryListenerBus posts event to Spark's main LiveListenerBus as a SparkEvent.
      - StreamingQueryListenerBus also subscribes to LiveListenerBus events thus getting back the posted event in a different thread.
      - The received is posted to the registered listeners.
      
      The problem is that *all StreamingQueryListenerBuses in all sessions* gets the events and posts them to their listeners. This is wrong.
      
      In this PR, I solve it by making StreamingQueryListenerBus track active queries (by their runIds) when a query posts the QueryStarted event to the bus. This allows the rerouted events to be filtered using the tracked queries.
      
      Note that this list needs to be maintained separately
      from the `StreamingQueryManager.activeQueries` because a terminated query is cleared from
      `StreamingQueryManager.activeQueries` as soon as it is stopped, but the this ListenerBus must
      clear a query only after the termination event of that query has been posted lazily, much after the query has been terminated.
      
      Credit goes to zsxwing for coming up with the initial idea.
      
      ## How was this patch tested?
      Updated test harness code to use the correct session, and added new unit test.
      
      Author: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #16186 from tdas/SPARK-18758.
      
      (cherry picked from commit 9ab725ea)
      Signed-off-by: default avatarTathagata Das <tathagata.das1565@gmail.com>
      617ce3ba
    • wm624@hotmail.com's avatar
      [SPARK-18633][ML][EXAMPLE] Add multiclass logistic regression summary python example and document · 839c2eb9
      wm624@hotmail.com authored
      
      ## What changes were proposed in this pull request?
      Logistic Regression summary is added in Python API. We need to add example and document for summary.
      
      The newly added example is consistent with Scala and Java examples.
      
      ## How was this patch tested?
      
      Manually tests: Run the example with spark-submit; copy & paste code into pyspark; build document and check the document.
      
      Author: wm624@hotmail.com <wm624@hotmail.com>
      
      Closes #16064 from wangmiao1981/py.
      
      (cherry picked from commit aad11209)
      Signed-off-by: default avatarJoseph K. Bradley <joseph@databricks.com>
      839c2eb9
    • Michael Armbrust's avatar
      [SPARK-18754][SS] Rename recentProgresses to recentProgress · 1c641971
      Michael Armbrust authored
      
      Based on an informal survey, users find this option easier to understand / remember.
      
      Author: Michael Armbrust <michael@databricks.com>
      
      Closes #16182 from marmbrus/renameRecentProgress.
      
      (cherry picked from commit 70b2bf71)
      Signed-off-by: default avatarTathagata Das <tathagata.das1565@gmail.com>
      1c641971
    • Shixiong Zhu's avatar
      [SPARK-18588][TESTS] Fix flaky test: KafkaSourceStressForDontFailOnDataLossSuite · e9b3afac
      Shixiong Zhu authored
      
      ## What changes were proposed in this pull request?
      
      Fixed the following failures:
      
      ```
      org.scalatest.exceptions.TestFailedDueToTimeoutException: The code passed to eventually never returned normally. Attempted 3745 times over 1.0000790851666665 minutes. Last failure message: assertion failed: failOnDataLoss-0 not deleted after timeout.
      ```
      
      ```
      sbt.ForkMain$ForkError: org.apache.spark.sql.streaming.StreamingQueryException: Query query-66 terminated with exception: null
      	at org.apache.spark.sql.execution.streaming.StreamExecution.org$apache$spark$sql$execution$streaming$StreamExecution$$runBatches(StreamExecution.scala:252)
      	at org.apache.spark.sql.execution.streaming.StreamExecution$$anon$1.run(StreamExecution.scala:146)
      Caused by: sbt.ForkMain$ForkError: java.lang.NullPointerException: null
      	at java.util.ArrayList.addAll(ArrayList.java:577)
      	at org.apache.kafka.clients.Metadata.getClusterForCurrentTopics(Metadata.java:257)
      	at org.apache.kafka.clients.Metadata.update(Metadata.java:177)
      	at org.apache.kafka.clients.NetworkClient$DefaultMetadataUpdater.handleResponse(NetworkClient.java:605)
      	at org.apache.kafka.clients.NetworkClient$DefaultMetadataUpdater.maybeHandleCompletedReceive(NetworkClient.java:582)
      	at org.apache.kafka.clients.NetworkClient.handleCompletedReceives(NetworkClient.java:450)
      	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:269)
      	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.clientPoll(ConsumerNetworkClient.java:360)
      	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:224)
      	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:192)
      	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.awaitPendingRequests(ConsumerNetworkClient.java:260)
      	at org.apache.kafka.clients.consumer.internals.AbstractCoordinator.ensureActiveGroup(AbstractCoordinator.java:222)
      	at org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.ensurePartitionAssignment(ConsumerCoordinator.java:366)
      	at org.apache.kafka.clients.consumer.KafkaConsumer.pollOnce(KafkaConsumer.java:978)
      	at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:938)
      	at
      ...
      ```
      
      ## How was this patch tested?
      
      Tested in #16048 by running many times.
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #16109 from zsxwing/fix-kafka-flaky-test.
      
      (cherry picked from commit edc87e18)
      Signed-off-by: default avatarTathagata Das <tathagata.das1565@gmail.com>
      e9b3afac
    • sarutak's avatar
      [SPARK-18762][WEBUI] Web UI should be http:4040 instead of https:4040 · 76e1f165
      sarutak authored
      ## What changes were proposed in this pull request?
      
      When SSL is enabled, the Spark shell shows:
      ```
      Spark context Web UI available at https://192.168.99.1:4040
      
      
      ```
      This is wrong because 4040 is http, not https. It redirects to the https port.
      More importantly, this introduces several broken links in the UI. For example, in the master UI, the worker link is https:8081 instead of http:8081 or https:8481.
      
      CC: mengxr liancheng
      
      I manually tested accessing by accessing MasterPage, WorkerPage and HistoryServer with SSL enabled.
      
      Author: sarutak <sarutak@oss.nttdata.co.jp>
      
      Closes #16190 from sarutak/SPARK-18761.
      
      (cherry picked from commit bb94f61a)
      Signed-off-by: default avatarMarcelo Vanzin <vanzin@cloudera.com>
      76e1f165
    • Shixiong Zhu's avatar
      [SPARK-18764][CORE] Add a warning log when skipping a corrupted file · acb6ac5d
      Shixiong Zhu authored
      
      ## What changes were proposed in this pull request?
      
      It's better to add a warning log when skipping a corrupted file. It will be helpful when we want to finish the job first, then find them in the log and fix these files.
      
      ## How was this patch tested?
      
      Jenkins
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #16192 from zsxwing/SPARK-18764.
      
      (cherry picked from commit dbf3e298)
      Signed-off-by: default avatarShixiong Zhu <shixiong@databricks.com>
      acb6ac5d
    • Andrew Ray's avatar
      [SPARK-17760][SQL] AnalysisException with dataframe pivot when groupBy column is not attribute · 5dbcd4fc
      Andrew Ray authored
      
      ## What changes were proposed in this pull request?
      
      Fixes AnalysisException for pivot queries that have group by columns that are expressions and not attributes by substituting the expressions output attribute in the second aggregation and final projection.
      
      ## How was this patch tested?
      
      existing and additional unit tests
      
      Author: Andrew Ray <ray.andrew@gmail.com>
      
      Closes #16177 from aray/SPARK-17760.
      
      (cherry picked from commit f1fca81b)
      Signed-off-by: default avatarHerman van Hovell <hvanhovell@databricks.com>
      5dbcd4fc
    • Jie Xiong's avatar
      [SPARK-18208][SHUFFLE] Executor OOM due to a growing LongArray in BytesToBytesMap · 4432a2a8
      Jie Xiong authored
      
      ## What changes were proposed in this pull request?
      
      BytesToBytesMap currently does not release the in-memory storage (the longArray variable) after it spills to disk. This is typically not a problem during aggregation because the longArray should be much smaller than the pages, and because we grow the longArray at a conservative rate.
      
      However this can lead to an OOM when an already running task is allocated more than its fair share, this can happen because of a scheduling delay. In this case the longArray can grow beyond the fair share of memory for the task. This becomes problematic when the task spills and the long array is not freed, that causes subsequent memory allocation requests to be denied by the memory manager resulting in an OOM.
      
      This PR fixes this issuing by freeing the longArray when the BytesToBytesMap spills.
      
      ## How was this patch tested?
      
      Existing tests and tested on realworld workloads.
      
      Author: Jie Xiong <jiexiong@fb.com>
      Author: jiexiong <jiexiong@gmail.com>
      
      Closes #15722 from jiexiong/jie_oom_fix.
      
      (cherry picked from commit c496d03b)
      Signed-off-by: default avatarHerman van Hovell <hvanhovell@databricks.com>
      4432a2a8
    • Sean Owen's avatar
      [SPARK-18678][ML] Skewed reservoir sampling in SamplingUtils · 51754d6d
      Sean Owen authored
      
      ## What changes were proposed in this pull request?
      
      Fix reservoir sampling bias for small k. An off-by-one error meant that the probability of replacement was slightly too high -- k/(l-1) after l element instead of k/l, which matters for small k.
      
      ## How was this patch tested?
      
      Existing test plus new test case.
      
      Author: Sean Owen <sowen@cloudera.com>
      
      Closes #16129 from srowen/SPARK-18678.
      
      (cherry picked from commit 79f5f281)
      Signed-off-by: default avatarSean Owen <sowen@cloudera.com>
      51754d6d
    • actuaryzhang's avatar
      [SPARK-18701][ML] Fix Poisson GLM failure due to wrong initialization · 99c293ee
      actuaryzhang authored
      
      Poisson GLM fails for many standard data sets (see example in test or JIRA). The issue is incorrect initialization leading to almost zero probability and weights. Specifically, the mean is initialized as the response, which could be zero. Applying the log link results in very negative numbers (protected against -Inf), which again leads to close to zero probability and weights in the weighted least squares. Fix and test are included in the commits.
      
      ## What changes were proposed in this pull request?
      Update initialization in Poisson GLM
      
      ## How was this patch tested?
      Add test in GeneralizedLinearRegressionSuite
      
      srowen sethah yanboliang HyukjinKwon mengxr
      
      Author: actuaryzhang <actuaryzhang10@gmail.com>
      
      Closes #16131 from actuaryzhang/master.
      
      (cherry picked from commit b8280271)
      Signed-off-by: default avatarSean Owen <sowen@cloudera.com>
      99c293ee
    • Yanbo Liang's avatar
      [SPARK-18686][SPARKR][ML] Several cleanup and improvements for spark.logit. · 340e9aea
      Yanbo Liang authored
      
      ## What changes were proposed in this pull request?
      Several cleanup and improvements for ```spark.logit```:
      * ```summary``` should return coefficients matrix, and should output labels for each class if the model is multinomial logistic regression model.
      * ```summary``` should not return ```areaUnderROC, roc, pr, ...```, since most of them are DataFrame which are less important for R users. Meanwhile, these metrics ignore instance weights (setting all to 1.0) which will be changed in later Spark version. In case it will introduce breaking changes, we do not expose them currently.
      * SparkR test improvement: comparing the training result with native R glmnet.
      * Remove argument ```aggregationDepth``` from ```spark.logit```, since it's an expert Param(related with Spark architecture and job execution) that would be used rarely by R users.
      
      ## How was this patch tested?
      Unit tests.
      
      The ```summary``` output after this change:
      multinomial logistic regression:
      ```
      > df <- suppressWarnings(createDataFrame(iris))
      > model <- spark.logit(df, Species ~ ., regParam = 0.5)
      > summary(model)
      $coefficients
                   versicolor  virginica   setosa
      (Intercept)  1.514031    -2.609108   1.095077
      Sepal_Length 0.02511006  0.2649821   -0.2900921
      Sepal_Width  -0.5291215  -0.02016446 0.549286
      Petal_Length 0.03647411  0.1544119   -0.190886
      Petal_Width  0.000236092 0.4195804   -0.4198165
      ```
      binomial logistic regression:
      ```
      > df <- suppressWarnings(createDataFrame(iris))
      > training <- df[df$Species %in% c("versicolor", "virginica"), ]
      > model <- spark.logit(training, Species ~ ., regParam = 0.5)
      > summary(model)
      $coefficients
                   Estimate
      (Intercept)  -6.053815
      Sepal_Length 0.2449379
      Sepal_Width  0.1648321
      Petal_Length 0.4730718
      Petal_Width  1.031947
      ```
      
      Author: Yanbo Liang <ybliang8@gmail.com>
      
      Closes #16117 from yanboliang/spark-18686.
      
      (cherry picked from commit 90b59d1b)
      Signed-off-by: default avatarYanbo Liang <ybliang8@gmail.com>
      340e9aea
  4. Dec 06, 2016
    • Tathagata Das's avatar
      [SPARK-18671][SS][TEST-MAVEN] Follow up PR to fix test for Maven · 3750c6e9
      Tathagata Das authored
      
      ## What changes were proposed in this pull request?
      
      Maven compilation seem to not allow resource is sql/test to be easily referred to in kafka-0-10-sql tests. So moved the kafka-source-offset-version-2.1.0 from sql test resources to kafka-0-10-sql test resources.
      
      ## How was this patch tested?
      
      Manually ran maven test
      
      Author: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #16183 from tdas/SPARK-18671-1.
      
      (cherry picked from commit 5c6bcdbd)
      Signed-off-by: default avatarTathagata Das <tathagata.das1565@gmail.com>
      3750c6e9
    • Tathagata Das's avatar
      [SPARK-18734][SS] Represent timestamp in StreamingQueryProgress as formatted... · 9b5bc2a6
      Tathagata Das authored
      [SPARK-18734][SS] Represent timestamp in StreamingQueryProgress as formatted string instead of millis
      
      ## What changes were proposed in this pull request?
      
      Easier to read while debugging as a formatted string (in ISO8601 format) than in millis
      
      ## How was this patch tested?
      Updated unit tests
      
      Author: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #16166 from tdas/SPARK-18734.
      
      (cherry picked from commit 539bb3cf)
      Signed-off-by: default avatarShixiong Zhu <shixiong@databricks.com>
      9b5bc2a6
    • Shuai Lin's avatar
      [SPARK-18652][PYTHON] Include the example data and third-party licenses in pyspark package. · 65f5331a
      Shuai Lin authored
      
      ## What changes were proposed in this pull request?
      
      Since we already include the python examples in the pyspark package, we should include the example data with it as well.
      
      We should also include the third-party licences since we distribute their jars with the pyspark package.
      
      ## How was this patch tested?
      
      Manually tested with python2.7 and python3.4
      ```sh
      $ ./build/mvn -DskipTests -Phive -Phive-thriftserver -Pyarn -Pmesos clean package
      $ cd python
      $ python setup.py sdist
      $ pip install  dist/pyspark-2.1.0.dev0.tar.gz
      
      $ ls -1 /usr/local/lib/python2.7/dist-packages/pyspark/data/
      graphx
      mllib
      streaming
      
      $ du -sh /usr/local/lib/python2.7/dist-packages/pyspark/data/
      600K    /usr/local/lib/python2.7/dist-packages/pyspark/data/
      
      $ ls -1  /usr/local/lib/python2.7/dist-packages/pyspark/licenses/|head -5
      LICENSE-AnchorJS.txt
      LICENSE-DPark.txt
      LICENSE-Mockito.txt
      LICENSE-SnapTree.txt
      LICENSE-antlr.txt
      ```
      
      Author: Shuai Lin <linshuai2012@gmail.com>
      
      Closes #16082 from lins05/include-data-in-pyspark-dist.
      
      (cherry picked from commit bd9a4a5a)
      Signed-off-by: default avatarSean Owen <sowen@cloudera.com>
      65f5331a
    • Tathagata Das's avatar
      [SPARK-18671][SS][TEST] Added tests to ensure stability of that all Structured... · d20e0d6b
      Tathagata Das authored
      [SPARK-18671][SS][TEST] Added tests to ensure stability of that all Structured Streaming log formats
      
      ## What changes were proposed in this pull request?
      
      To be able to restart StreamingQueries across Spark version, we have already made the logs (offset log, file source log, file sink log) use json. We should added tests with actual json files in the Spark such that any incompatible changes in reading the logs is immediately caught. This PR add tests for FileStreamSourceLog, FileStreamSinkLog, and OffsetSeqLog.
      
      ## How was this patch tested?
      new unit tests
      
      Author: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #16128 from tdas/SPARK-18671.
      
      (cherry picked from commit 1ef6b296)
      Signed-off-by: default avatarShixiong Zhu <shixiong@databricks.com>
      d20e0d6b
    • Reynold Xin's avatar
      [SPARK-18714][SQL] Add a simple time function to SparkSession · ace4079c
      Reynold Xin authored
      
      ## What changes were proposed in this pull request?
      Many Spark developers often want to test the runtime of some function in interactive debugging and testing. This patch adds a simple time function to SparkSession:
      
      ```
      scala> spark.time { spark.range(1000).count() }
      Time taken: 77 ms
      res1: Long = 1000
      ```
      
      ## How was this patch tested?
      I tested this interactively in spark-shell.
      
      Author: Reynold Xin <rxin@databricks.com>
      
      Closes #16140 from rxin/SPARK-18714.
      
      (cherry picked from commit cb1f10b4)
      Signed-off-by: default avatarHerman van Hovell <hvanhovell@databricks.com>
      ace4079c
    • Herman van Hovell's avatar
      [SPARK-18634][SQL][TRIVIAL] Touch-up Generate · e362d998
      Herman van Hovell authored
      ## What changes were proposed in this pull request?
      I jumped the gun on merging https://github.com/apache/spark/pull/16120
      
      , and missed a tiny potential problem. This PR fixes that by changing a val into a def; this should prevent potential serialization/initialization weirdness from happening.
      
      ## How was this patch tested?
      Existing tests.
      
      Author: Herman van Hovell <hvanhovell@databricks.com>
      
      Closes #16170 from hvanhovell/SPARK-18634.
      
      (cherry picked from commit 381ef4ea)
      Signed-off-by: default avatarHerman van Hovell <hvanhovell@databricks.com>
      e362d998
  5. Dec 05, 2016
    • Shixiong Zhu's avatar
      [SPARK-18721][SS] Fix ForeachSink with watermark + append · 655297b3
      Shixiong Zhu authored
      
      ## What changes were proposed in this pull request?
      
      Right now ForeachSink creates a new physical plan, so StreamExecution cannot retrieval metrics and watermark.
      
      This PR changes ForeachSink to manually convert InternalRows to objects without creating a new plan.
      
      ## How was this patch tested?
      
      `test("foreach with watermark: append")`.
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #16160 from zsxwing/SPARK-18721.
      
      (cherry picked from commit 7863c623)
      Signed-off-by: default avatarTathagata Das <tathagata.das1565@gmail.com>
      655297b3
    • Michael Allman's avatar
      [SPARK-18572][SQL] Add a method `listPartitionNames` to `ExternalCatalog` · 8ca6a82c
      Michael Allman authored
      (Link to Jira issue: https://issues.apache.org/jira/browse/SPARK-18572
      
      )
      
      ## What changes were proposed in this pull request?
      
      Currently Spark answers the `SHOW PARTITIONS` command by fetching all of the table's partition metadata from the external catalog and constructing partition names therefrom. The Hive client has a `getPartitionNames` method which is many times faster for this purpose, with the performance improvement scaling with the number of partitions in a table.
      
      To test the performance impact of this PR, I ran the `SHOW PARTITIONS` command on two Hive tables with large numbers of partitions. One table has ~17,800 partitions, and the other has ~95,000 partitions. For the purposes of this PR, I'll call the former table `table1` and the latter table `table2`. I ran 5 trials for each table with before-and-after versions of this PR. The results are as follows:
      
      Spark at bdc8153e, `SHOW PARTITIONS table1`, times in seconds:
      7.901
      3.983
      4.018
      4.331
      4.261
      
      Spark at bdc8153e, `SHOW PARTITIONS table2`
      (Timed out after 10 minutes with a `SocketTimeoutException`.)
      
      Spark at this PR, `SHOW PARTITIONS table1`, times in seconds:
      3.801
      0.449
      0.395
      0.348
      0.336
      
      Spark at this PR, `SHOW PARTITIONS table2`, times in seconds:
      5.184
      1.63
      1.474
      1.519
      1.41
      
      Taking the best times from each trial, we get a 12x performance improvement for a table with ~17,800 partitions and at least a 426x improvement for a table with ~95,000 partitions. More significantly, the latter command doesn't even complete with the current code in master.
      
      This is actually a patch we've been using in-house at VideoAmp since Spark 1.1. It's made all the difference in the practical usability of our largest tables. Even with tables with about 1,000 partitions there's a performance improvement of about 2-3x.
      
      ## How was this patch tested?
      
      I added a unit test to `VersionsSuite` which tests that the Hive client's `getPartitionNames` method returns the correct number of partitions.
      
      Author: Michael Allman <michael@videoamp.com>
      
      Closes #15998 from mallman/spark-18572-list_partition_names.
      
      (cherry picked from commit 772ddbea)
      Signed-off-by: default avatarWenchen Fan <wenchen@databricks.com>
      8ca6a82c
Loading