Skip to content
Snippets Groups Projects
  1. Dec 10, 2015
  2. Dec 09, 2015
    • Tathagata Das's avatar
      [SPARK-12244][SPARK-12245][STREAMING] Rename trackStateByKey to mapWithState... · bd2cd4f5
      Tathagata Das authored
      [SPARK-12244][SPARK-12245][STREAMING] Rename trackStateByKey to mapWithState and change tracking function signature
      
      SPARK-12244:
      
      Based on feedback from early users and personal experience attempting to explain it, the name trackStateByKey had two problem.
      "trackState" is a completely new term which really does not give any intuition on what the operation is
      the resultant data stream of objects returned by the function is called in docs as the "emitted" data for the lack of a better.
      "mapWithState" makes sense because the API is like a mapping function like (Key, Value) => T with State as an additional parameter. The resultant data stream is "mapped data". So both problems are solved.
      
      SPARK-12245:
      
      From initial experiences, not having the key in the function makes it hard to return mapped stuff, as the whole information of the records is not there. Basically the user is restricted to doing something like mapValue() instead of map(). So adding the key as a parameter.
      
      Author: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #10224 from tdas/rename.
      bd2cd4f5
    • Mark Grover's avatar
      [SPARK-11796] Fix httpclient and httpcore depedency issues related to docker-client · 2166c2a7
      Mark Grover authored
      This commit fixes dependency issues which prevented the Docker-based JDBC integration tests from running in the Maven build.
      
      Author: Mark Grover <mgrover@cloudera.com>
      
      Closes #9876 from markgrover/master_docker.
      2166c2a7
    • Yin Huai's avatar
      [SPARK-11678][SQL][DOCS] Document basePath in the programming guide. · ac8cdf1c
      Yin Huai authored
      This PR adds document for `basePath`, which is a new parameter used by `HadoopFsRelation`.
      
      The compiled doc is shown below.
      ![image](https://cloud.githubusercontent.com/assets/2072857/11673132/1ba01192-9dcb-11e5-98d9-ac0b4e92e98c.png)
      
      JIRA: https://issues.apache.org/jira/browse/SPARK-11678
      
      Author: Yin Huai <yhuai@databricks.com>
      
      Closes #10211 from yhuai/basePathDoc.
      ac8cdf1c
    • Andrew Or's avatar
      [SPARK-12165][ADDENDUM] Fix outdated comments on unroll test · 8770bd12
      Andrew Or authored
      JoshRosen
      
      Author: Andrew Or <andrew@databricks.com>
      
      Closes #10229 from andrewor14/unroll-test-comments.
      8770bd12
    • Andrew Ray's avatar
      [SPARK-12211][DOC][GRAPHX] Fix version number in graphx doc for migration from 1.1 · 7a8e587d
      Andrew Ray authored
      Migration from 1.1 section added to the GraphX doc in 1.2.0 (see https://spark.apache.org/docs/1.2.0/graphx-programming-guide.html#migrating-from-spark-11) uses \{{site.SPARK_VERSION}} as the version where changes were introduced, it should be just 1.2.
      
      Author: Andrew Ray <ray.andrew@gmail.com>
      
      Closes #10206 from aray/graphx-doc-1.1-migration.
      7a8e587d
    • Xusen Yin's avatar
      [SPARK-11551][DOC] Replace example code in ml-features.md using include_example · 051c6a06
      Xusen Yin authored
      PR on behalf of somideshmukh, thanks!
      
      Author: Xusen Yin <yinxusen@gmail.com>
      Author: somideshmukh <somilde@us.ibm.com>
      
      Closes #10219 from yinxusen/SPARK-11551.
      051c6a06
    • Sean Owen's avatar
      [SPARK-11824][WEBUI] WebUI does not render descriptions with 'bad' HTML, throws console error · 1eb7c22c
      Sean Owen authored
      Don't warn when description isn't valid HTML since it may properly be like "SELECT ... where foo <= 1"
      
      The tests for this code indicate that it's normal to handle strings like this that don't contain HTML as a string rather than markup. Hence logging every such instance as a warning is too noisy since it's not a problem. this is an issue for stages whose name contain SQL like the above
      
      CC tdas as author of this bit of code
      
      Author: Sean Owen <sowen@cloudera.com>
      
      Closes #10159 from srowen/SPARK-11824.
      1eb7c22c
    • Josh Rosen's avatar
      [SPARK-12165][SPARK-12189] Fix bugs in eviction of storage memory by execution · aec5ea00
      Josh Rosen authored
      This patch fixes a bug in the eviction of storage memory by execution.
      
      ## The bug:
      
      In general, execution should be able to evict storage memory when the total storage memory usage is greater than `maxMemory * spark.memory.storageFraction`. Due to a bug, however, Spark might wind up evicting no storage memory in certain cases where the storage memory usage was between `maxMemory * spark.memory.storageFraction` and `maxMemory`. For example, here is a regression test which illustrates the bug:
      
      ```scala
          val maxMemory = 1000L
          val taskAttemptId = 0L
          val (mm, ms) = makeThings(maxMemory)
          // Since we used the default storage fraction (0.5), we should be able to allocate 500 bytes
          // of storage memory which are immune to eviction by execution memory pressure.
      
          // Acquire enough storage memory to exceed the storage region size
          assert(mm.acquireStorageMemory(dummyBlock, 750L, evictedBlocks))
          assertEvictBlocksToFreeSpaceNotCalled(ms)
          assert(mm.executionMemoryUsed === 0L)
          assert(mm.storageMemoryUsed === 750L)
      
          // At this point, storage is using 250 more bytes of memory than it is guaranteed, so execution
          // should be able to reclaim up to 250 bytes of storage memory.
          // Therefore, execution should now be able to require up to 500 bytes of memory:
          assert(mm.acquireExecutionMemory(500L, taskAttemptId, MemoryMode.ON_HEAP) === 500L) // <--- fails by only returning 250L
          assert(mm.storageMemoryUsed === 500L)
          assert(mm.executionMemoryUsed === 500L)
          assertEvictBlocksToFreeSpaceCalled(ms, 250L)
      ```
      
      The problem relates to the control flow / interaction between `StorageMemoryPool.shrinkPoolToReclaimSpace()` and `MemoryStore.ensureFreeSpace()`. While trying to allocate the 500 bytes of execution memory, the `UnifiedMemoryManager` discovers that it will need to reclaim 250 bytes of memory from storage, so it calls `StorageMemoryPool.shrinkPoolToReclaimSpace(250L)`. This method, in turn, calls `MemoryStore.ensureFreeSpace(250L)`. However, `ensureFreeSpace()` first checks whether the requested space is less than `maxStorageMemory - storageMemoryUsed`, which will be true if there is any free execution memory because it turns out that `MemoryStore.maxStorageMemory = (maxMemory - onHeapExecutionMemoryPool.memoryUsed)` when the `UnifiedMemoryManager` is used.
      
      The control flow here is somewhat confusing (it grew to be messy / confusing over time / as a result of the merging / refactoring of several components). In the pre-Spark 1.6 code, `ensureFreeSpace` was called directly by the `MemoryStore` itself, whereas in 1.6 it's involved in a confusing control flow where `MemoryStore` calls `MemoryManager.acquireStorageMemory`, which then calls back into `MemoryStore.ensureFreeSpace`, which, in turn, calls `MemoryManager.freeStorageMemory`.
      
      ## The solution:
      
      The solution implemented in this patch is to remove the confusing circular control flow between `MemoryManager` and `MemoryStore`, making the storage memory acquisition process much more linear / straightforward. The key changes:
      
      - Remove a layer of inheritance which made the memory manager code harder to understand (53841174760a24a0df3eb1562af1f33dbe340eb9).
      - Move some bounds checks earlier in the call chain (13ba7ada77f87ef1ec362aec35c89a924e6987cb).
      - Refactor `ensureFreeSpace()` so that the part which evicts blocks can be called independently from the part which checks whether there is enough free space to avoid eviction (7c68ca09cb1b12f157400866983f753ac863380e).
      - Realize that this lets us remove a layer of overloads from `ensureFreeSpace` (eec4f6c87423d5e482b710e098486b3bbc4daf06).
      - Realize that `ensureFreeSpace()` can simply be replaced with an `evictBlocksToFreeSpace()` method which is called [after we've already figured out](https://github.com/apache/spark/blob/2dc842aea82c8895125d46a00aa43dfb0d121de9/core/src/main/scala/org/apache/spark/memory/StorageMemoryPool.scala#L88) how much memory needs to be reclaimed via eviction; (2dc842aea82c8895125d46a00aa43dfb0d121de9).
      
      Along the way, I fixed some problems with the mocks in `MemoryManagerSuite`: the old mocks would [unconditionally](https://github.com/apache/spark/blob/80a824d36eec9d9a9f092ee1741453851218ec73/core/src/test/scala/org/apache/spark/memory/MemoryManagerSuite.scala#L84) report that a block had been evicted even if there was enough space in the storage pool such that eviction would be avoided.
      
      I also fixed a problem where `StorageMemoryPool._memoryUsed` might become negative due to freed memory being double-counted when excution evicts storage. The problem was that `StorageMemoryPoolshrinkPoolToFreeSpace` would [decrement `_memoryUsed`](https://github.com/apache/spark/commit/7c68ca09cb1b12f157400866983f753ac863380e#diff-935c68a9803be144ed7bafdd2f756a0fL133) even though `StorageMemoryPool.freeMemory` had already decremented it as each evicted block was freed. See SPARK-12189 for details.
      
      Author: Josh Rosen <joshrosen@databricks.com>
      Author: Andrew Or <andrew@databricks.com>
      
      Closes #10170 from JoshRosen/SPARK-12165.
      aec5ea00
    • Steve Loughran's avatar
      [SPARK-12241][YARN] Improve failure reporting in Yarn client obtainTokenForHBase() · 442a7715
      Steve Loughran authored
      This lines up the HBase token logic with that done for Hive in SPARK-11265: reflection with only CFNE being swallowed.
      
      There is a test, one which doesn't try to put HBase on the yarn/test class and really do the reflection (the way the hive introspection does). If people do want that then it could be added with careful POM work
      
      +also: cut an incorrect comment from the Hive test case before copying it, and a couple of imports that may have been related to the hive test in the past.
      
      Author: Steve Loughran <stevel@hortonworks.com>
      
      Closes #10227 from steveloughran/stevel/patches/SPARK-12241-obtainTokenForHBase.
      442a7715
    • jerryshao's avatar
      [SPARK-10582][YARN][CORE] Fix AM failure situation for dynamic allocation · 6900f017
      jerryshao authored
      Because of AM failure, the target executor number between driver and AM will be different, which will lead to unexpected behavior in dynamic allocation. So when AM is re-registered with driver, state in `ExecutorAllocationManager` and `CoarseGrainedSchedulerBacked` should be reset.
      
      This issue is originally addressed in #8737 , here re-opened again. Thanks a lot KaiXinXiaoLei for finding this issue.
      
      andrewor14 and vanzin would you please help to review this, thanks a lot.
      
      Author: jerryshao <sshao@hortonworks.com>
      
      Closes #9963 from jerryshao/SPARK-10582.
      6900f017
    • Holden Karau's avatar
      [SPARK-10299][ML] word2vec should allow users to specify the window size · 22b9a874
      Holden Karau authored
      Currently word2vec has the window hard coded at 5, some users may want different sizes (for example if using on n-gram input or similar). User request comes from http://stackoverflow.com/questions/32231975/spark-word2vec-window-size .
      
      Author: Holden Karau <holden@us.ibm.com>
      Author: Holden Karau <holden@pigscanfly.ca>
      
      Closes #8513 from holdenk/SPARK-10299-word2vec-should-allow-users-to-specify-the-window-size.
      22b9a874
    • Cheng Lian's avatar
      [SPARK-12012][SQL] Show more comprehensive PhysicalRDD metadata when visualizing SQL query plan · 6e1c55ea
      Cheng Lian authored
      This PR adds a `private[sql]` method `metadata` to `SparkPlan`, which can be used to describe detail information about a physical plan during visualization. Specifically, this PR uses this method to provide details of `PhysicalRDD`s translated from a data source relation. For example, a `ParquetRelation` converted from Hive metastore table `default.psrc` is now shown as the following screenshot:
      
      ![image](https://cloud.githubusercontent.com/assets/230655/11526657/e10cb7e6-9916-11e5-9afa-f108932ec890.png)
      
      And here is the screenshot for a regular `ParquetRelation` (not converted from Hive metastore table) loaded from a really long path:
      
      ![output](https://cloud.githubusercontent.com/assets/230655/11680582/37c66460-9e94-11e5-8f50-842db5309d5a.png)
      
      Author: Cheng Lian <lian@databricks.com>
      
      Closes #10004 from liancheng/spark-12012.physical-rdd-metadata.
      6e1c55ea
    • uncleGen's avatar
      [SPARK-12031][CORE][BUG] Integer overflow when do sampling · a1132168
      uncleGen authored
      Author: uncleGen <hustyugm@gmail.com>
      
      Closes #10023 from uncleGen/1.6-bugfix.
      a1132168
    • hyukjinkwon's avatar
      [SPARK-11676][SQL] Parquet filter tests all pass if filters are not really pushed down · f6883bb7
      hyukjinkwon authored
      Currently Parquet predicate tests all pass even if filters are not pushed down or this is disabled.
      
      In this PR, For checking evaluating filters, Simply it makes the expression from `expression.Filter` and then try to create filters just like Spark does.
      
      For checking the results, this manually accesses to the child rdd (of `expression.Filter`) and produces the results which should be filtered properly, and then compares it to expected values.
      
      Now, if filters are not pushed down or this is disabled, this throws exceptions.
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #9659 from HyukjinKwon/SPARK-11676.
      f6883bb7
  3. Dec 08, 2015
    • Fei Wang's avatar
      [SPARK-12222] [CORE] Deserialize RoaringBitmap using Kryo serializer throw... · 3934562d
      Fei Wang authored
      [SPARK-12222] [CORE] Deserialize RoaringBitmap using Kryo serializer throw Buffer underflow exception
      
      Jira: https://issues.apache.org/jira/browse/SPARK-12222
      
      Deserialize RoaringBitmap using Kryo serializer throw Buffer underflow exception:
      ```
      com.esotericsoftware.kryo.KryoException: Buffer underflow.
      	at com.esotericsoftware.kryo.io.Input.require(Input.java:156)
      	at com.esotericsoftware.kryo.io.Input.skip(Input.java:131)
      	at com.esotericsoftware.kryo.io.Input.skip(Input.java:264)
      ```
      
      This is caused by a bug of kryo's `Input.skip(long count)`(https://github.com/EsotericSoftware/kryo/issues/119) and we call this method in `KryoInputDataInputBridge`.
      
      Instead of upgrade kryo's version, this pr bypass the  kryo's `Input.skip(long count)` by directly call another `skip` method in kryo's Input.java(https://github.com/EsotericSoftware/kryo/blob/kryo-2.21/src/com/esotericsoftware/kryo/io/Input.java#L124), i.e. write the bug-fixed version of `Input.skip(long count)` in KryoInputDataInputBridge's `skipBytes` method.
      
      more detail link to https://github.com/apache/spark/pull/9748#issuecomment-162860246
      
      Author: Fei Wang <wangfei1@huawei.com>
      
      Closes #10213 from scwf/patch-1.
      3934562d
    • Dominik Dahlem's avatar
      [SPARK-11343][ML] Documentation of float and double prediction/label columns in RegressionEvaluator · a0046e37
      Dominik Dahlem authored
      felixcheung , mengxr
      
      Just added a message to require()
      
      Author: Dominik Dahlem <dominik.dahlem@gmail.combination>
      
      Closes #9598 from dahlem/ddahlem_regression_evaluator_double_predictions_message_04112015.
      a0046e37
    • Timothy Hunter's avatar
      [SPARK-8517][ML][DOC] Reorganizes the spark.ml user guide · 765c67f5
      Timothy Hunter authored
      This PR moves pieces of the spark.ml user guide to reflect suggestions in SPARK-8517. It does not introduce new content, as requested.
      
      <img width="192" alt="screen shot 2015-12-08 at 11 36 00 am" src="https://cloud.githubusercontent.com/assets/7594753/11666166/e82b84f2-9d9f-11e5-8904-e215424d8444.png">
      
      Author: Timothy Hunter <timhunter@databricks.com>
      
      Closes #10207 from thunterdb/spark-8517.
      765c67f5
    • Michael Armbrust's avatar
      [SPARK-12069][SQL] Update documentation with Datasets · 39594894
      Michael Armbrust authored
      Author: Michael Armbrust <michael@databricks.com>
      
      Closes #10060 from marmbrus/docs.
      39594894
    • Andrew Or's avatar
      [SPARK-12187] *MemoryPool classes should not be fully public · 94945216
      Andrew Or authored
      This patch tightens them to `private[memory]`.
      
      Author: Andrew Or <andrew@databricks.com>
      
      Closes #10182 from andrewor14/memory-visibility.
      94945216
    • Marcelo Vanzin's avatar
      [SPARK-3873][BUILD] Add style checker to enforce import ordering. · 2ff17bcf
      Marcelo Vanzin authored
      The checker tries to follow as closely as possible the guidelines of
      the code style document, and makes some decisions where the guide is
      not clear. In particular:
      
      - wildcard imports come first when there are other imports in the
        same package
      - multi-import blocks come before single imports
      - lower-case names inside multi-import blocks come before others
      
      In some projects, such as graphx, there seems to be a convention to
      separate o.a.s imports from the project's own; to simplify the
      checker, I chose not to allow that, which is a strict interpretation
      of the code style guide, even though I think it makes sense.
      
      Since the checks are based on syntax only, some edge cases may
      generate spurious warnings; for example, when class names start
      with a lower case letter (and are thus treated as a package name
      by the checker).
      
      The checker is currently only generating warnings, and since there
      are many of those, the build output does get a little noisy. The
      idea is to fix the code (and the checker, as needed) little by little
      instead of having a huge change that touches everywhere.
      
      Author: Marcelo Vanzin <vanzin@cloudera.com>
      
      Closes #6502 from vanzin/SPARK-3873.
      2ff17bcf
    • BenFradet's avatar
      [SPARK-12159][ML] Add user guide section for IndexToString transformer · 06746b30
      BenFradet authored
      Documentation regarding the `IndexToString` label transformer with code snippets in Scala/Java/Python.
      
      Author: BenFradet <benjamin.fradet@gmail.com>
      
      Closes #10166 from BenFradet/SPARK-12159.
      06746b30
    • Yuhao Yang's avatar
      [SPARK-11605][MLLIB] ML 1.6 QA: API: Java compatibility, docs · 5cb46950
      Yuhao Yang authored
      jira: https://issues.apache.org/jira/browse/SPARK-11605
      Check Java compatibility for MLlib for this release.
      
      fix:
      
      1. `StreamingTest.registerStream` needs java friendly interface.
      
      2. `GradientBoostedTreesModel.computeInitialPredictionAndError` and `GradientBoostedTreesModel.updatePredictionError` has java compatibility issue. Mark them as `developerAPI`.
      
      TBD:
      [updated] no fix for now per discussion.
      `org.apache.spark.mllib.classification.LogisticRegressionModel`
      `public scala.Option<java.lang.Object> getThreshold();` has wrong return type for Java invocation.
      `SVMModel` has the similar issue.
      
      Yet adding a `scala.Option<java.util.Double> getThreshold()` would result in an overloading error due to the same function signature. And adding a new function with different name seems to be not necessary.
      
      cc jkbradley feynmanliang
      
      Author: Yuhao Yang <hhbyyh@gmail.com>
      
      Closes #10102 from hhbyyh/javaAPI.
      5cb46950
    • Andrew Ray's avatar
      [SPARK-12205][SQL] Pivot fails Analysis when aggregate is UnresolvedFunction · 4bcb8949
      Andrew Ray authored
      Delays application of ResolvePivot until all aggregates are resolved to prevent problems with UnresolvedFunction and adds unit test
      
      Author: Andrew Ray <ray.andrew@gmail.com>
      
      Closes #10202 from aray/sql-pivot-unresolved-function.
      4bcb8949
    • Yuhao Yang's avatar
      [SPARK-10393] use ML pipeline in LDA example · 872a2ee2
      Yuhao Yang authored
      jira: https://issues.apache.org/jira/browse/SPARK-10393
      
      Since the logic of the text processing part has been moved to ML estimators/transformers, replace the related code in LDA Example with the ML pipeline.
      
      Author: Yuhao Yang <hhbyyh@gmail.com>
      Author: yuhaoyang <yuhao@zhanglipings-iMac.local>
      
      Closes #8551 from hhbyyh/ldaExUpdate.
      872a2ee2
    • gatorsmile's avatar
      [SPARK-12188][SQL] Code refactoring and comment correction in Dataset APIs · 5d96a710
      gatorsmile authored
      This PR contains the following updates:
      
      - Created a new private variable `boundTEncoder` that can be shared by multiple functions, `RDD`, `select` and `collect`.
      - Replaced all the `queryExecution.analyzed` by the function call `logicalPlan`
      - A few API comments are using wrong class names (e.g., `DataFrame`) or parameter names (e.g., `n`)
      - A few API descriptions are wrong. (e.g., `mapPartitions`)
      
      marmbrus rxin cloud-fan Could you take a look and check if they are appropriate? Thank you!
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #10184 from gatorsmile/datasetClean.
      5d96a710
    • gatorsmile's avatar
      [SPARK-12195][SQL] Adding BigDecimal, Date and Timestamp into Encoder · c0b13d55
      gatorsmile authored
      This PR is to add three more data types into Encoder, including `BigDecimal`, `Date` and `Timestamp`.
      
      marmbrus cloud-fan rxin Could you take a quick look at these three types? Not sure if it can be merged to 1.6. Thank you very much!
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #10188 from gatorsmile/dataTypesinEncoder.
      c0b13d55
    • Wenchen Fan's avatar
      [SPARK-12201][SQL] add type coercion rule for greatest/least · 381f17b5
      Wenchen Fan authored
      checked with hive, greatest/least should cast their children to a tightest common type,
      i.e. `(int, long) => long`, `(int, string) => error`, `(decimal(10,5), decimal(5, 10)) => error`
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #10196 from cloud-fan/type-coercion.
      381f17b5
    • tedyu's avatar
      [SPARK-12074] Avoid memory copy involving ByteBuffer.wrap(ByteArrayOutputStream.toByteArray) · 75c60bf4
      tedyu authored
      SPARK-12060 fixed JavaSerializerInstance.serialize
      This PR applies the same technique on two other classes.
      
      zsxwing
      
      Author: tedyu <yuzhihong@gmail.com>
      
      Closes #10177 from tedyu/master.
      75c60bf4
    • Xin Ren's avatar
      [SPARK-11155][WEB UI] Stage summary json should include stage duration · 6cb06e87
      Xin Ren authored
      The json endpoint for stages doesn't include information on the stage duration that is present in the UI. This looks like a simple oversight, they should be included. eg., the metrics should be included at api/v1/applications/<appId>/stages.
      
      Metrics I've added are: submissionTime, firstTaskLaunchedTime and completionTime
      
      Author: Xin Ren <iamshrek@126.com>
      
      Closes #10107 from keypointt/SPARK-11155.
      6cb06e87
Loading