Skip to content
Snippets Groups Projects
  1. Jan 23, 2017
    • Dongjoon Hyun's avatar
      [SPARK-19218][SQL] Fix SET command to show a result correctly and in a sorted order · c4a6519c
      Dongjoon Hyun authored
      ## What changes were proposed in this pull request?
      
      This PR aims to fix the following two things.
      
      1. `sql("SET -v").collect()` or `sql("SET -v").show()` raises the following exceptions for String configuration with default value, `null`. For the test, please see [Jenkins result](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71539/testReport/) and https://github.com/apache/spark/commit/60953bf1f1ba144e709fdae3903a390ff9479fd0 in #16624 .
      
      ```
      sbt.ForkMain$ForkError: java.lang.RuntimeException: Error while decoding: java.lang.NullPointerException
      createexternalrow(input[0, string, false].toString, input[1, string, false].toString, input[2, string, false].toString, StructField(key,StringType,false), StructField(value,StringType,false), StructField(meaning,StringType,false))
      :- input[0, string, false].toString
      :  +- input[0, string, false]
      :- input[1, string, false].toString
      :  +- input[1, string, false]
      +- input[2, string, false].toString
         +- input[2, string, false]
      ```
      
      2. Currently, `SET` and `SET -v` commands show unsorted result.
          We had better show a sorted result for UX. Also, this is compatible with Hive.
      
      **BEFORE**
      ```
      scala> sql("set").show(false)
      ...
      |spark.driver.host              |10.22.16.140                                                                                                                                 |
      |spark.driver.port              |63893                                                                                                                                        |
      |spark.repl.class.uri           |spark://10.22.16.140:63893/classes                                                                                                           |
      ...
      |spark.app.name                 |Spark shell                                                                                                                                  |
      |spark.driver.memory            |4G                                                                                                                                           |
      |spark.executor.id              |driver                                                                                                                                       |
      |spark.submit.deployMode        |client                                                                                                                                       |
      |spark.master                   |local[*]                                                                                                                                     |
      |spark.home                     |/Users/dhyun/spark                                                                                                                           |
      |spark.sql.catalogImplementation|hive                                                                                                                                         |
      |spark.app.id                   |local-1484333618945                                                                                                                          |
      ```
      
      **AFTER**
      
      ```
      scala> sql("set").show(false)
      ...
      |spark.app.id                   |local-1484333925649                                                                                                                          |
      |spark.app.name                 |Spark shell                                                                                                                                  |
      |spark.driver.host              |10.22.16.140                                                                                                                                 |
      |spark.driver.memory            |4G                                                                                                                                           |
      |spark.driver.port              |64994                                                                                                                                        |
      |spark.executor.id              |driver                                                                                                                                       |
      |spark.jars                     |                                                                                                                                             |
      |spark.master                   |local[*]                                                                                                                                     |
      |spark.repl.class.uri           |spark://10.22.16.140:64994/classes                                                                                                           |
      |spark.sql.catalogImplementation|hive                                                                                                                                         |
      |spark.submit.deployMode        |client                                                                                                                                       |
      ```
      
      ## How was this patch tested?
      
      Jenkins with a new test case.
      
      Author: Dongjoon Hyun <dongjoon@apache.org>
      
      Closes #16579 from dongjoon-hyun/SPARK-19218.
      c4a6519c
    • actuaryzhang's avatar
      [SPARK-19155][ML] Make family case insensitive in GLM · f067acef
      actuaryzhang authored
      ## What changes were proposed in this pull request?
      This is a supplement to PR #16516 which did not make the value from `getFamily` case insensitive. Current tests of poisson/binomial glm with weight fail when specifying 'Poisson' or 'Binomial', because the calculation of `dispersion` and `pValue` checks the value of family retrieved from `getFamily`
      ```
      model.getFamily == Binomial.name || model.getFamily == Poisson.name
      ```
      
      ## How was this patch tested?
      Update existing tests for 'Poisson' and 'Binomial'.
      
      yanboliang felixcheung imatiach-msft
      
      Author: actuaryzhang <actuaryzhang10@gmail.com>
      
      Closes #16675 from actuaryzhang/family.
      f067acef
  2. Jan 22, 2017
    • Wenchen Fan's avatar
      [SPARK-19309][SQL] disable common subexpression elimination for conditional expressions · de6ad3df
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      As I pointed out in https://github.com/apache/spark/pull/15807#issuecomment-259143655 , the current subexpression elimination framework has a problem, it always evaluates all common subexpressions at the beginning, even they are inside conditional expressions and may not be accessed.
      
      Ideally we should implement it like scala lazy val, so we only evaluate it when it gets accessed at lease once. https://github.com/apache/spark/issues/15837 tries this approach, but it seems too complicated and may introduce performance regression.
      
      This PR simply stops common subexpression elimination for conditional expressions, with some cleanup.
      
      ## How was this patch tested?
      
      regression test
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #16659 from cloud-fan/codegen.
      de6ad3df
    • gatorsmile's avatar
      [SPARK-19229][SQL] Disallow Creating Hive Source Tables when Hive Support is Not Enabled · 772035e7
      gatorsmile authored
      ### What changes were proposed in this pull request?
      It is weird to create Hive source tables when using InMemoryCatalog. We are unable to operate it. This PR is to block users to create Hive source tables.
      
      ### How was this patch tested?
      Fixed the test cases
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #16587 from gatorsmile/blockHiveTable.
      772035e7
    • hyukjinkwon's avatar
      [SPARK-16101][SQL] Refactoring CSV read path to be consistent with JSON data source · 74e65cb7
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      This PR refactors CSV read path to be consistent with JSON data source. It makes the methods in classes have consistent arguments with JSON ones.
      
      `UnivocityParser` and `JacksonParser`
      
      ``` scala
      private[csv] class UnivocityParser(
          schema: StructType,
          requiredSchema: StructType,
          options: CSVOptions) extends Logging {
        ...
      
      def parse(input: String): Seq[InternalRow] = {
        ...
      ```
      
      ``` scala
      class JacksonParser(
          schema: StructType,
          columnNameOfCorruptRecord: String,
          options: JSONOptions) extends Logging {
        ...
      
      def parse(input: String): Option[InternalRow] = {
        ...
      ```
      
      These allow parsing an iterator (`String` to `InternalRow`) as below for both JSON and CSV:
      
      ```scala
      iter.flatMap(parser.parse)
      ```
      
      ## How was this patch tested?
      
      Existing tests should cover this.
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #16669 from HyukjinKwon/SPARK-16101-read.
      74e65cb7
  3. Jan 21, 2017
    • Yanbo Liang's avatar
      [SPARK-19291][SPARKR][ML] spark.gaussianMixture supports output log-likelihood. · 0c589e37
      Yanbo Liang authored
      ## What changes were proposed in this pull request?
      ```spark.gaussianMixture``` supports output total log-likelihood for the model like R ```mvnormalmixEM```.
      
      ## How was this patch tested?
      R unit test.
      
      Author: Yanbo Liang <ybliang8@gmail.com>
      
      Closes #16646 from yanboliang/spark-19291.
      0c589e37
    • Yanbo Liang's avatar
      [SPARK-19155][ML] MLlib GeneralizedLinearRegression family and link should case insensitive · 3dcad9fa
      Yanbo Liang authored
      ## What changes were proposed in this pull request?
      MLlib ```GeneralizedLinearRegression``` ```family``` and ```link``` should be case insensitive. This is consistent with some other MLlib params such as [```featureSubsetStrategy```](https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/tree/treeParams.scala#L415).
      
      ## How was this patch tested?
      Update corresponding tests.
      
      Author: Yanbo Liang <ybliang8@gmail.com>
      
      Closes #16516 from yanboliang/spark-19133.
      3dcad9fa
    • windpiger's avatar
      [SPARK-19153][SQL] DataFrameWriter.saveAsTable work with create partitioned table · aa014eb7
      windpiger authored
      ## What changes were proposed in this pull request?
      
      After [SPARK-19107](https://issues.apache.org/jira/browse/SPARK-19153), we now can treat hive as a data source and create hive tables with DataFrameWriter and Catalog. However, the support is not completed, there are still some cases we do not support.
      
      this PR provide DataFrameWriter.saveAsTable work with hive format to create partitioned table.
      
      ## How was this patch tested?
      unit test added
      
      Author: windpiger <songjun@outlook.com>
      
      Closes #16593 from windpiger/saveAsTableWithPartitionedTable.
      aa014eb7
    • hyukjinkwon's avatar
      [SPARK-19117][SPARK-18922][TESTS] Fix the rest of flaky, newly introduced and... · 6113fe78
      hyukjinkwon authored
      [SPARK-19117][SPARK-18922][TESTS] Fix the rest of flaky, newly introduced and missed test failures on Windows
      
      ## What changes were proposed in this pull request?
      
      **Failed tests**
      
      ```
      org.apache.spark.sql.hive.execution.HiveQuerySuite:
       - transform with SerDe3 *** FAILED ***
       - transform with SerDe4 *** FAILED ***
      ```
      
      ```
      org.apache.spark.sql.hive.execution.HiveDDLSuite:
       - create hive serde table with new syntax *** FAILED ***
       - add/drop partition with location - managed table *** FAILED ***
      ```
      
      ```
      org.apache.spark.sql.hive.ParquetMetastoreSuite:
       - Explicitly added partitions should be readable after load *** FAILED ***
       - Non-partitioned table readable after load *** FAILED ***
      ```
      
      **Aborted tests**
      
      ```
      Exception encountered when attempting to run a suite with class name: org.apache.spark.sql.hive.execution.HiveSerDeSuite *** ABORTED *** (157 milliseconds)
         org.apache.spark.sql.AnalysisException: LOAD DATA input path does not exist: C:projectssparksqlhive   argetscala-2.11   est-classesdatafilessales.txt;
      ```
      
      **Flaky tests(failed 9ish out of 10)**
      
      ```
      org.apache.spark.scheduler.SparkListenerSuite:
       - local metrics *** FAILED ***
      ```
      
      ## How was this patch tested?
      
      Manually tested via AppVeyor.
      
      **Failed tests**
      
      ```
      org.apache.spark.sql.hive.execution.HiveQuerySuite:
       - transform with SerDe3 !!! CANCELED !!! (0 milliseconds)
       - transform with SerDe4 !!! CANCELED !!! (0 milliseconds)
      ```
      
      ```
      org.apache.spark.sql.hive.execution.HiveDDLSuite:
       - create hive serde table with new syntax (1 second, 672 milliseconds)
       - add/drop partition with location - managed table (2 seconds, 391 milliseconds)
      ```
      
      ```
      org.apache.spark.sql.hive.ParquetMetastoreSuite:
       - Explicitly added partitions should be readable after load (609 milliseconds)
       - Non-partitioned table readable after load (344 milliseconds)
      ```
      
      **Aborted tests**
      
      ```
      spark.sql.hive.execution.HiveSerDeSuite:
       - Read with RegexSerDe (2 seconds, 142 milliseconds)
       - Read and write with LazySimpleSerDe (tab separated) (2 seconds)
       - Read with AvroSerDe (1 second, 47 milliseconds)
       - Read Partitioned with AvroSerDe (1 second, 422 milliseconds)
      ```
      
      **Flaky tests (failed 9ish out of 10)**
      
      ```
      org.apache.spark.scheduler.SparkListenerSuite:
       - local metrics (4 seconds, 562 milliseconds)
      ```
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #16586 from HyukjinKwon/set-path-appveyor.
      Unverified
      6113fe78
    • Xin Ren's avatar
      [SPARK-17724][STREAMING][WEBUI] Unevaluated new lines in tooltip in DAG Visualization of a job · bcdabaac
      Xin Ren authored
      https://issues.apache.org/jira/browse/SPARK-17724
      
      ## What changes were proposed in this pull request?
      For unevaluated `\n`, evaluate it and enable line break, for Streaming WebUI `stages` page and `job` page.
      (I didn't change Scala source file, since Jetty server has to somehow indicate line break and js to code display it.)
      (This PR is a continue from previous PR https://github.com/apache/spark/pull/15353 for the same issue, sorry being so long time)
      
      Two changes:
      
      1. RDD Node tooltipText is actually showing the `<circle>`  `title` property, so I set extra attribute in `spark-dag-viz.js`: `.attr("data-html", "true")`
      
      `<circle x="-5" y="-5" r="5" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="ParallelCollectionRDD [9]\nmakeRDD at QueueStream.scala:49"></circle>`
      
      2. Static `<tspan>` text of each stage, split by `/n`, and append an extra `<tspan>` element to its parentNode
      
      `<text><tspan xml:space="preserve" dy="1em" x="1">reduceByKey</tspan><tspan xml:space="preserve" dy="1em" x="1">reduceByKey/n 23:34:49</tspan></text>
      `
      
      ## UI changes
      Screenshot **before fix**, `\n` is not evaluated in both circle tooltipText and static text:
      ![screen shot 2017-01-19 at 12 21 54 am](https://cloud.githubusercontent.com/assets/3925641/22098829/53c7f49c-dddd-11e6-9daa-b3ddb6044114.png)
      
      Screenshot **after fix**:
      ![screen shot 2017-01-19 at 12 20 30 am](https://cloud.githubusercontent.com/assets/3925641/22098806/294910d4-dddd-11e6-9948-d942e09f545e.png)
      
      ## How was this patch tested?
      Tested locally. For Streaming WebUI `stages` page and `job` page, on multiple browsers:
      - Chrome
      - Firefox
      - Safari
      
      Author: Xin Ren <renxin.ubc@gmail.com>
      
      Closes #16643 from keypointt/SPARK-17724-2nd.
      Unverified
      bcdabaac
  4. Jan 20, 2017
    • Wenchen Fan's avatar
      [SPARK-19305][SQL] partitioned table should always put partition columns at the end of table schema · 3c2ba9fc
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      For data source tables, we will always reorder the specified table schema, or the query in CTAS, to put partition columns at the end. e.g. `CREATE TABLE t(a int, b int, c int, d int) USING parquet PARTITIONED BY (d, b)` will create a table with schema `<a, c, d, b>`
      
      Hive serde tables don't have this problem before, because its CREATE TABLE syntax specifies data schema and partition schema individually.
      
      However, after we unifed the CREATE TABLE syntax, Hive serde table also need to do the reorder. This PR puts the reorder logic in a analyzer rule,  which works with both data source tables and Hive serde tables.
      
      ## How was this patch tested?
      
      new regression test
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #16655 from cloud-fan/schema.
      3c2ba9fc
    • sureshthalamati's avatar
      [SPARK-14536][SQL] fix to handle null value in array type column for postgres. · f174cdc7
      sureshthalamati authored
      ## What changes were proposed in this pull request?
      
      JDBC  read  is failing with  NPE due to missing null value check for array data type if the source table has null values in the array type column.  For null values Resultset.getArray()  returns null.
      This PR adds null safe check to the Resultset.getArray() value before invoking method on the Array object.
      ## How was this patch tested?
      
      Updated the PostgresIntegration test suite to test null values. Ran docker integration tests on my laptop.
      
      Author: sureshthalamati <suresh.thalamati@gmail.com>
      
      Closes #15192 from sureshthalamati/jdbc_array_null_fix-SPARK-14536.
      f174cdc7
    • hyukjinkwon's avatar
      [SPARK-16101][SQL] Refactoring CSV write path to be consistent with JSON data source · 54268b42
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      This PR refactors CSV write path to be consistent with JSON data source.
      
      This PR makes the methods in classes have consistent arguments with JSON ones.
        - `UnivocityGenerator` and `JacksonGenerator`
      
          ``` scala
          private[csv] class UnivocityGenerator(
              schema: StructType,
              writer: Writer,
              options: CSVOptions = new CSVOptions(Map.empty[String, String])) {
          ...
      
          def write ...
          def close ...
          def flush ...
          ```
      
          ``` scala
          private[sql] class JacksonGenerator(
             schema: StructType,
             writer: Writer,
             options: JSONOptions = new JSONOptions(Map.empty[String, String])) {
          ...
      
          def write ...
          def close ...
          def flush ...
          ```
      
      - This PR also makes the classes put in together in a consistent manner with JSON.
        - `CsvFileFormat`
      
          ``` scala
          CsvFileFormat
          CsvOutputWriter
          ```
      
        - `JsonFileFormat`
      
          ``` scala
          JsonFileFormat
          JsonOutputWriter
          ```
      
      ## How was this patch tested?
      
      Existing tests should cover this.
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #16496 from HyukjinKwon/SPARK-16101-write.
      54268b42
    • Shixiong Zhu's avatar
      [SPARK-19267][SS] Fix a race condition when stopping StateStore · ea31f92b
      Shixiong Zhu authored
      ## What changes were proposed in this pull request?
      
      There is a race condition when stopping StateStore which makes `StateStoreSuite.maintenance` flaky. `StateStore.stop` doesn't wait for the running task to finish, and an out-of-date task may fail `doMaintenance` and cancel the new task. Here is a reproducer: https://github.com/zsxwing/spark/commit/dde1b5b106ba034861cf19e16883cfe181faa6f3
      
      This PR adds MaintenanceTask to eliminate the race condition.
      
      ## How was this patch tested?
      
      Jenkins
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      Author: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #16627 from zsxwing/SPARK-19267.
      ea31f92b
    • Davies Liu's avatar
      [SPARK-18589][SQL] Fix Python UDF accessing attributes from both side of join · 9b7a03f1
      Davies Liu authored
      ## What changes were proposed in this pull request?
      
      PythonUDF is unevaluable, which can not be used inside a join condition, currently the optimizer will push a PythonUDF which accessing both side of join into the join condition, then the query will fail to plan.
      
      This PR fix this issue by checking the expression is evaluable  or not before pushing it into Join.
      
      ## How was this patch tested?
      
      Add a regression test.
      
      Author: Davies Liu <davies@databricks.com>
      
      Closes #16581 from davies/pyudf_join.
      9b7a03f1
    • Tathagata Das's avatar
      [SPARK-19314][SS][CATALYST] Do not allow sort before aggregation in Structured Streaming plan · 552e5f08
      Tathagata Das authored
      ## What changes were proposed in this pull request?
      
      Sort in a streaming plan should be allowed only after a aggregation in complete mode. Currently it is incorrectly allowed when present anywhere in the plan. It gives unpredictable potentially incorrect results.
      
      ## How was this patch tested?
      New test
      
      Author: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #16662 from tdas/SPARK-19314.
      552e5f08
    • Parag Chaudhari's avatar
      [SPARK-19069][CORE] Expose task 'status' and 'duration' in spark history server REST API. · e20d9b15
      Parag Chaudhari authored
      ## What changes were proposed in this pull request?
      
      Although Spark history server UI shows task ‘status’ and ‘duration’ fields, it does not expose these fields in the REST API response. For the Spark history server API users, it is not possible to determine task status and duration. Spark history server has access to task status and duration from event log, but it is not exposing these in API. This patch is proposed to expose task ‘status’ and ‘duration’ fields in Spark history server REST API.
      
      ## How was this patch tested?
      
      Modified existing test cases in org.apache.spark.deploy.history.HistoryServerSuite.
      
      Author: Parag Chaudhari <paragpc@amazon.com>
      
      Closes #16473 from paragpc/expose_task_status.
      e20d9b15
    • sarutak's avatar
      [SPARK-19302][DOC][MINOR] Fix the wrong item format in security.md · d50d12b4
      sarutak authored
      ## What changes were proposed in this pull request?
      
      In docs/security.md, there is a description as follows.
      
      ```
       steps to configure the key-stores and the trust-store for the standalone deployment mode is as
       follows:
       * Generate a keys pair for each node
       * Export the public key of the key pair to a file on each node
       * Import all exported public keys into a single trust-store
      ```
      
      According to markdown format, the first item should follow a blank line.
      
      ## How was this patch tested?
      
      Manually tested.
      
      Following captures are rendered web page before and after fix.
      
      * before
      ![before](https://cloud.githubusercontent.com/assets/4736016/22136731/b358115c-df19-11e6-8f6c-2f7b65766265.png)
      
      * after
      ![after](https://cloud.githubusercontent.com/assets/4736016/22136745/c6366ff8-df19-11e6-840d-e7e894218f9c.png)
      
      Author: sarutak <sarutak@oss.nttdata.co.jp>
      
      Closes #16653 from sarutak/SPARK-19302.
      Unverified
      d50d12b4
    • wangzhenhua's avatar
      [SPARK-19271][SQL] Change non-cbo estimation of aggregate · 039ed9fe
      wangzhenhua authored
      ## What changes were proposed in this pull request?
      
      Change non-cbo estimation behavior of aggregate:
      - If groupExpression is empty, we can know row count (=1) and the corresponding size;
      - otherwise, estimation falls back to UnaryNode's computeStats method, which should not propagate rowCount and attributeStats in Statistics because they are not estimated in that method.
      
      ## How was this patch tested?
      
      Added test case
      
      Author: wangzhenhua <wangzhenhua@huawei.com>
      
      Closes #16631 from wzhfy/aggNoCbo.
      039ed9fe
  5. Jan 19, 2017
    • Wenchen Fan's avatar
      [SPARK-19292][SQL] filter with partition columns should be case-insensitive on Hive tables · 0bf605c2
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      When we query a table with a filter on partitioned columns, we will push the partition filter to the metastore to get matched partitions directly.
      
      In `HiveExternalCatalog.listPartitionsByFilter`, we assume the column names in partition filter are already normalized and we don't need to consider case sensitivity. However, `HiveTableScanExec` doesn't follow this assumption. This PR fixes it.
      
      ## How was this patch tested?
      
      new regression test
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #16647 from cloud-fan/bug.
      0bf605c2
    • Kazuaki Ishizaki's avatar
      [SPARK-17912] [SQL] Refactor code generation to get data for ColumnVector/ColumnarBatch · 148a84b3
      Kazuaki Ishizaki authored
      ## What changes were proposed in this pull request?
      
      This PR refactors the code generation part to get data from `ColumnarVector` and `ColumnarBatch` by using a trait `ColumnarBatchScan` for ease of reuse. This is because this part will be reused by several components (e.g. parquet reader, Dataset.cache, and others) since `ColumnarBatch` will be first citizen.
      
      This PR is a part of https://github.com/apache/spark/pull/15219. In advance, this PR makes the code generation for  `ColumnarVector` and `ColumnarBatch` reuseable as a trait. In general, this is very useful for other components from the reuseability view, too.
      ## How was this patch tested?
      
      tested existing test suites
      
      Author: Kazuaki Ishizaki <ishizaki@jp.ibm.com>
      
      Closes #15467 from kiszk/columnarrefactor.
      148a84b3
    • Yin Huai's avatar
      [SPARK-19295][SQL] IsolatedClientLoader's downloadVersion should log the... · 63d83902
      Yin Huai authored
      [SPARK-19295][SQL] IsolatedClientLoader's downloadVersion should log the location of downloaded metastore client jars
      
      ## What changes were proposed in this pull request?
      This will help the users to know the location of those downloaded jars when `spark.sql.hive.metastore.jars` is set to `maven`.
      
      ## How was this patch tested?
      jenkins
      
      Author: Yin Huai <yhuai@databricks.com>
      
      Closes #16649 from yhuai/SPARK-19295.
      63d83902
    • José Hiram Soltren's avatar
      [SPARK-16654][CORE] Add UI coverage for Application Level Blacklisting · 640f9423
      José Hiram Soltren authored
      Builds on top of work in SPARK-8425 to update Application Level Blacklisting in the scheduler.
      
      ## What changes were proposed in this pull request?
      
      Adds a UI to these patches by:
      - defining new listener events for blacklisting and unblacklisting, nodes and executors;
      - sending said events at the relevant points in BlacklistTracker;
      - adding JSON (de)serialization code for these events;
      - augmenting the Executors UI page to show which, and how many, executors are blacklisted;
      - adding a unit test to make sure events are being fired;
      - adding HistoryServerSuite coverage to verify that the SHS reads these events correctly.
      - updates the Executor UI to show Blacklisted/Active/Dead as a tri-state in Executors Status
      
      Updates .rat-excludes to pass tests.
      
      username squito
      
      ## How was this patch tested?
      
      ./dev/run-tests
      testOnly org.apache.spark.util.JsonProtocolSuite
      testOnly org.apache.spark.scheduler.BlacklistTrackerSuite
      testOnly org.apache.spark.deploy.history.HistoryServerSuite
      https://github.com/jsoltren/jose-utils/blob/master/blacklist/test-blacklist.sh
      ![blacklist-20161219](https://cloud.githubusercontent.com/assets/1208477/21335321/9eda320a-c623-11e6-8b8c-9c912a73c276.jpg)
      
      Author: José Hiram Soltren <jose@cloudera.com>
      
      Closes #16346 from jsoltren/SPARK-16654-submit.
      640f9423
    • jayadevanmurali's avatar
      [SPARK-19059][SQL] Unable to retrieve data from parquet table whose name startswith underscore · 064fadd2
      jayadevanmurali authored
      ## What changes were proposed in this pull request?
      The initial shouldFilterOut() method invocation filter the root path name(table name in the intial call) and remove if it contains _. I moved the check one level below, so it first list files/directories in the given root path and then apply filter.
      (Please fill in changes proposed in this fix)
      
      ## How was this patch tested?
      Added new test case for this scenario
      (Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
      (If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
      
      Please review http://spark.apache.org/contributing.html before opening a pull request.
      
      Author: jayadevanmurali <jayadevan.m@tcs.com>
      Author: jayadevan <jayadevan.m@tcs.com>
      
      Closes #16635 from jayadevanmurali/branch-0.1-SPARK-19059.
      064fadd2
    • Zheng RuiFeng's avatar
      [SPARK-14272][ML] Add Loglikelihood in GaussianMixtureSummary · 8ccca917
      Zheng RuiFeng authored
      ## What changes were proposed in this pull request?
      
      add loglikelihood in GMM.summary
      
      ## How was this patch tested?
      
      added tests
      
      Author: Zheng RuiFeng <ruifengz@foxmail.com>
      Author: Ruifeng Zheng <ruifengz@foxmail.com>
      
      Closes #12064 from zhengruifeng/gmm_metric.
      8ccca917
    • Wenchen Fan's avatar
      [SPARK-19265][SQL] make table relation cache general and does not depend on hive · 2e625600
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      We have a table relation plan cache in `HiveMetastoreCatalog`, which caches a lot of things: file status, resolved data source, inferred schema, etc.
      
      However, it doesn't make sense to limit this cache with hive support, we should move it to SQL core module so that users can use this cache without hive support.
      
      It can also reduce the size of `HiveMetastoreCatalog`, so that it's easier to remove it eventually.
      
      main changes:
      1. move the table relation cache to `SessionCatalog`
      2. `SessionCatalog.lookupRelation` will return `SimpleCatalogRelation` and the analyzer will convert it to `LogicalRelation` or `MetastoreRelation` later, then `HiveSessionCatalog` doesn't need to override `lookupRelation` anymore
      3. `FindDataSourceTable` will read/write the table relation cache.
      
      ## How was this patch tested?
      
      existing tests.
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #16621 from cloud-fan/plan-cache.
      2e625600
  6. Jan 18, 2017
    • Yin Huai's avatar
      Update known_translations for contributor names · 0c923185
      Yin Huai authored
      ## What changes were proposed in this pull request?
      Update known_translations per https://github.com/apache/spark/pull/16423#issuecomment-269739634
      
      Author: Yin Huai <yhuai@databricks.com>
      
      Closes #16628 from yhuai/known_translations.
      0c923185
    • Ilya Matiach's avatar
      [SPARK-14975][ML] Fixed GBTClassifier to predict probability per training... · fe409f31
      Ilya Matiach authored
      [SPARK-14975][ML] Fixed GBTClassifier to predict probability per training instance and fixed interfaces
      
      ## What changes were proposed in this pull request?
      
      For all of the classifiers in MLLib we can predict probabilities except for GBTClassifier.
      Also, all classifiers inherit from ProbabilisticClassifier but GBTClassifier strangely inherits from Predictor, which is a bug.
      This change corrects the interface and adds the ability for the classifier to give a probabilities vector.
      
      ## How was this patch tested?
      
      The basic ML tests were run after making the changes.  I've marked this as WIP as I need to add more tests.
      
      Author: Ilya Matiach <ilmat@microsoft.com>
      
      Closes #16441 from imatiach-msft/ilmat/fix-GBT.
      fe409f31
    • uncleGen's avatar
      [SPARK-19182][DSTREAM] Optimize the lock in StreamingJobProgressListener to... · a81e336f
      uncleGen authored
      [SPARK-19182][DSTREAM] Optimize the lock in StreamingJobProgressListener to not block UI when generating Streaming jobs
      
      ## What changes were proposed in this pull request?
      
      When DStreamGraph is generating a job, it will hold a lock and block other APIs. Because StreamingJobProgressListener (numInactiveReceivers, streamName(streamId: Int), streamIds) needs to call DStreamGraph's methods to access some information, the UI may hang if generating a job is very slow (e.g., talking to the slow Kafka cluster to fetch metadata).
      It's better to optimize the locks in DStreamGraph and StreamingJobProgressListener to make the UI not block by job generation.
      
      ## How was this patch tested?
      existing ut
      
      cc zsxwing
      
      Author: uncleGen <hustyugm@gmail.com>
      
      Closes #16601 from uncleGen/SPARK-19182.
      a81e336f
    • Liwei Lin's avatar
      [SPARK-19168][STRUCTURED STREAMING] StateStore should be aborted upon error · 569e5068
      Liwei Lin authored
      ## What changes were proposed in this pull request?
      
      We should call `StateStore.abort()` when there should be any error before the store is committed.
      
      ## How was this patch tested?
      
      Manually.
      
      Author: Liwei Lin <lwlin7@gmail.com>
      
      Closes #16547 from lw-lin/append-filter.
      569e5068
    • Shixiong Zhu's avatar
      [SPARK-19113][SS][TESTS] Ignore StreamingQueryException thrown from... · c050c122
      Shixiong Zhu authored
      [SPARK-19113][SS][TESTS] Ignore StreamingQueryException thrown from awaitInitialization to avoid breaking tests
      
      ## What changes were proposed in this pull request?
      
      #16492 missed one race condition: `StreamExecution.awaitInitialization` may throw fatal errors and fail the test. This PR just ignores `StreamingQueryException` thrown from `awaitInitialization` so that we can verify the exception in the `ExpectFailure` action later. It's fine since `StopStream` or `ExpectFailure` will catch `StreamingQueryException` as well.
      
      ## How was this patch tested?
      
      Jenkins
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #16567 from zsxwing/SPARK-19113-2.
      c050c122
    • jinxing's avatar
      [SPARK-18113] Use ask to replace askWithRetry in canCommit and make receiver idempotent. · 33791a8c
      jinxing authored
      ## What changes were proposed in this pull request?
      
      Method canCommit sends AskPermissionToCommitOutput using askWithRetry. If timeout, it will send again. Thus AskPermissionToCommitOutput can be received multi times. Method canCommit should return the same value when called by the same attempt multi times.
      
      In implementation before this fix, method handleAskPermissionToCommit just check if there is committer already registered, which is not enough. When worker retries AskPermissionToCommitOutput it will get CommitDeniedException, then the task will fail with reason TaskCommitDenied, which is not regarded as a task failure(SPARK-11178), so TaskScheduler will schedule this task infinitely.
      
      In this fix, use `ask` to replace `askWithRetry` in `canCommit` and make receiver idempotent.
      
      ## How was this patch tested?
      
      Added a new unit test to OutputCommitCoordinatorSuite.
      
      Author: jinxing <jinxing@meituan.com>
      
      Closes #16503 from jinxing64/SPARK-18113.
      33791a8c
    • Felix Cheung's avatar
      [SPARK-19231][SPARKR] add error handling for download and untar for Spark release · 278fa1eb
      Felix Cheung authored
      ## What changes were proposed in this pull request?
      
      When R is starting as a package and it needs to download the Spark release distribution we need to handle error for download and untar, and clean up, otherwise it will get stuck.
      
      ## How was this patch tested?
      
      manually
      
      Author: Felix Cheung <felixcheung_m@hotmail.com>
      
      Closes #16589 from felixcheung/rtarreturncode.
      278fa1eb
    • Liang-Chi Hsieh's avatar
      [SPARK-19223][SQL][PYSPARK] Fix InputFileBlockHolder for datasources which are... · d06172b8
      Liang-Chi Hsieh authored
      [SPARK-19223][SQL][PYSPARK] Fix InputFileBlockHolder for datasources which are based on HadoopRDD or NewHadoopRDD
      
      ## What changes were proposed in this pull request?
      
      For some datasources which are based on HadoopRDD or NewHadoopRDD, such as spark-xml, InputFileBlockHolder doesn't work with Python UDF.
      
      The method to reproduce it is, running the following codes with `bin/pyspark --packages com.databricks:spark-xml_2.11:0.4.1`:
      
          from pyspark.sql.functions import udf,input_file_name
          from pyspark.sql.types import StringType
          from pyspark.sql import SparkSession
      
          def filename(path):
              return path
      
          session = SparkSession.builder.appName('APP').getOrCreate()
      
          session.udf.register('sameText', filename)
          sameText = udf(filename, StringType())
      
          df = session.read.format('xml').load('a.xml', rowTag='root').select('*', input_file_name().alias('file'))
          df.select('file').show() # works
          df.select(sameText(df['file'])).show()   # returns empty content
      
      The issue is because in `HadoopRDD` and `NewHadoopRDD` we set the file block's info in `InputFileBlockHolder` before the returned iterator begins consuming. `InputFileBlockHolder` will record this info into thread local variable. When running Python UDF in batch, we set up another thread to consume the iterator from child plan's output rdd, so we can't read the info back in another thread.
      
      To fix this, we have to set the info in `InputFileBlockHolder` after the iterator begins consuming. So the info can be read in correct thread.
      
      ## How was this patch tested?
      
      Manual test with above example codes for spark-xml package on pyspark: `bin/pyspark --packages com.databricks:spark-xml_2.11:0.4.1`.
      
      Added pyspark test.
      
      Please review http://spark.apache.org/contributing.html before opening a pull request.
      
      Author: Liang-Chi Hsieh <viirya@gmail.com>
      
      Closes #16585 from viirya/fix-inputfileblock-hadooprdd.
      d06172b8
    • jiangxingbo's avatar
      [SPARK-19024][SQL] Implement new approach to write a permanent view · f85f2960
      jiangxingbo authored
      ## What changes were proposed in this pull request?
      
      On CREATE/ALTER a view, it's no longer needed to generate a SQL text string from the LogicalPlan, instead we store the SQL query text、the output column names of the query plan, and current database to CatalogTable. Permanent views created by this approach can be resolved by current view resolution approach.
      
      The main advantage includes:
      1. If you update an underlying view, the current view also gets updated;
      2. That gives us a change to get ride of SQL generation for operators.
      
      Major changes of this PR:
      1. Generate the view-specific properties(e.g. view default database, view query output column names) during permanent view creation and store them as properties in the CatalogTable;
      2. Update the commands `CreateViewCommand` and `AlterViewAsCommand`, get rid of SQL generation from them.
      
      ## How was this patch tested?
      Existing tests.
      
      Author: jiangxingbo <jiangxb1987@gmail.com>
      
      Closes #16613 from jiangxb1987/view-write-path.
      f85f2960
    • Adam Roberts's avatar
      [SPARK-18782][BUILD] Bump Hadoop 2.6 version to use Hadoop 2.6.5 · 17ce0b5b
      Adam Roberts authored
      **What changes were proposed in this pull request?**
      
      Use Hadoop 2.6.5 for the Hadoop 2.6 profile, I see a bunch of fixes including security ones in the release notes that we should pick up
      
      **How was this patch tested?**
      
      Running the unit tests now with IBM's SDK for Java and let's see what happens with OpenJDK in the community builder - expecting no trouble as it is only a minor release.
      
      Author: Adam Roberts <aroberts@uk.ibm.com>
      
      Closes #16616 from a-roberts/Hadoop265Bumper.
      Unverified
      17ce0b5b
    • uncleGen's avatar
      [SPARK-19227][SPARK-19251] remove unused imports and outdated comments · eefdf9f9
      uncleGen authored
      ## What changes were proposed in this pull request?
      remove ununsed imports and outdated comments, and fix some minor code style issue.
      
      ## How was this patch tested?
      existing ut
      
      Author: uncleGen <hustyugm@gmail.com>
      
      Closes #16591 from uncleGen/SPARK-19227.
      Unverified
      eefdf9f9
    • Wenchen Fan's avatar
      [SPARK-18243][SQL] Port Hive writing to use FileFormat interface · 4494cd97
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      Inserting data into Hive tables has its own implementation that is distinct from data sources: `InsertIntoHiveTable`, `SparkHiveWriterContainer` and `SparkHiveDynamicPartitionWriterContainer`.
      
      Note that one other major difference is that data source tables write directly to the final destination without using some staging directory, and then Spark itself adds the partitions/tables to the catalog. Hive tables actually write to some staging directory, and then call Hive metastore's loadPartition/loadTable function to load those data in. So we still need to keep `InsertIntoHiveTable` to put this special logic. In the future, we should think of writing to the hive table location directly, so that we don't need to call `loadTable`/`loadPartition` at the end and remove `InsertIntoHiveTable`.
      
      This PR removes `SparkHiveWriterContainer` and `SparkHiveDynamicPartitionWriterContainer`, and create a `HiveFileFormat` to implement the write logic. In the future, we should also implement the read logic in `HiveFileFormat`.
      
      ## How was this patch tested?
      
      existing tests
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #16517 from cloud-fan/insert-hive.
      4494cd97
  7. Jan 17, 2017
    • Zheng RuiFeng's avatar
      [SPARK-18206][ML] Add instrumentation for MLP,NB,LDA,AFT,GLM,Isotonic,LiR · e7f982b2
      Zheng RuiFeng authored
      ## What changes were proposed in this pull request?
      
      add instrumentation for MLP,NB,LDA,AFT,GLM,Isotonic,LiR
      ## How was this patch tested?
      
      local test in spark-shell
      
      Author: Zheng RuiFeng <ruifengz@foxmail.com>
      Author: Ruifeng Zheng <ruifengz@foxmail.com>
      
      Closes #15671 from zhengruifeng/lir_instr.
      e7f982b2
    • Bogdan Raducanu's avatar
      [SPARK-13721][SQL] Support outer generators in DataFrame API · 2992a0e7
      Bogdan Raducanu authored
      ## What changes were proposed in this pull request?
      
      Added outer_explode, outer_posexplode, outer_inline functions and expressions.
      Some bug fixing in GenerateExec.scala for CollectionGenerator. Previously it was not correctly handling the case of outer with empty collections, only with nulls.
      
      ## How was this patch tested?
      
      New tests added to GeneratorFunctionSuite
      
      Author: Bogdan Raducanu <bogdan.rdc@gmail.com>
      
      Closes #16608 from bogdanrdc/SPARK-13721.
      2992a0e7
Loading