Skip to content
Snippets Groups Projects
  1. Jul 07, 2017
    • CodingCat's avatar
      [SPARK-19358][CORE] LiveListenerBus shall log the event name when dropping... · fbbe37ed
      CodingCat authored
      [SPARK-19358][CORE] LiveListenerBus shall log the event name when dropping them due to a fully filled queue
      
      ## What changes were proposed in this pull request?
      
      Some dropped event will make the whole application behaves unexpectedly, e.g. some UI problem...we shall log the dropped event name to facilitate the debugging
      
      ## How was this patch tested?
      
      Existing tests
      
      Author: CodingCat <zhunansjtu@gmail.com>
      
      Closes #16697 from CodingCat/SPARK-19358.
      fbbe37ed
    • Wenchen Fan's avatar
      [SPARK-21335][SQL] support un-aliased subquery · fef08130
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      un-aliased subquery is supported by Spark SQL for a long time. Its semantic was not well defined and had confusing behaviors, and it's not a standard SQL syntax, so we disallowed it in https://issues.apache.org/jira/browse/SPARK-20690 .
      
      However, this is a breaking change, and we do have existing queries using un-aliased subquery. We should add the support back and fix its semantic.
      
      This PR fixes the un-aliased subquery by assigning a default alias name.
      
      After this PR, there is no syntax change from branch 2.2 to master, but we invalid a weird use case:
      `SELECT v.i from (SELECT i FROM v)`. Now this query will throw analysis exception because users should not be able to use the qualifier inside a subquery.
      
      ## How was this patch tested?
      
      new regression test
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #18559 from cloud-fan/sub-query.
      fef08130
    • Yan Facai (颜发才)'s avatar
      [SPARK-21285][ML] VectorAssembler reports the column name of unsupported data type · 56536e99
      Yan Facai (颜发才) authored
      ## What changes were proposed in this pull request?
      add the column name in the exception which is raised by unsupported data type.
      
      ## How was this patch tested?
      + [x] pass all tests.
      
      Author: Yan Facai (颜发才) <facai.yan@gmail.com>
      
      Closes #18523 from facaiy/ENH/vectorassembler_add_col.
      56536e99
    • Jacek Laskowski's avatar
      [SPARK-21313][SS] ConsoleSink's string representation · 7fcbb9b5
      Jacek Laskowski authored
      ## What changes were proposed in this pull request?
      
      Add `toString` with options for `ConsoleSink` so it shows nicely in query progress.
      
      **BEFORE**
      
      ```
        "sink" : {
          "description" : "org.apache.spark.sql.execution.streaming.ConsoleSink4b340441"
        }
      ```
      
      **AFTER**
      
      ```
        "sink" : {
          "description" : "ConsoleSink[numRows=10, truncate=false]"
        }
      ```
      
      /cc zsxwing tdas
      
      ## How was this patch tested?
      
      Local build
      
      Author: Jacek Laskowski <jacek@japila.pl>
      
      Closes #18539 from jaceklaskowski/SPARK-21313-ConsoleSink-toString.
      7fcbb9b5
    • Liang-Chi Hsieh's avatar
      [SPARK-20703][SQL][FOLLOW-UP] Associate metrics with data writes onto DataFrameWriter operations · 5df99bd3
      Liang-Chi Hsieh authored
      ## What changes were proposed in this pull request?
      
      Remove time metrics since it seems no way to measure it in non per-row tracking.
      
      ## How was this patch tested?
      
      Existing tests.
      
      Please review http://spark.apache.org/contributing.html before opening a pull request.
      
      Author: Liang-Chi Hsieh <viirya@gmail.com>
      
      Closes #18558 from viirya/SPARK-20703-followup.
      5df99bd3
    • Kazuaki Ishizaki's avatar
      [SPARK-21217][SQL] Support ColumnVector.Array.to<type>Array() · c09b31eb
      Kazuaki Ishizaki authored
      ## What changes were proposed in this pull request?
      
      This PR implements bulk-copy for `ColumnVector.Array.to<type>Array()` methods (e.g. `toIntArray()`) in `ColumnVector.Array` by using `System.arrayCopy()` or `Platform.copyMemory()`.
      
      Before this PR, when one of these method is called, the generic method in `ArrayData` is called. It is not fast since element-wise copy is performed.
      
      This PR can improve performance of a benchmark program by 1.9x and 3.2x.
      
      Without this PR
      ```
      OpenJDK 64-Bit Server VM 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11 on Linux 4.4.0-66-generic
      Intel(R) Xeon(R) CPU E5-2667 v3  3.20GHz
      
      Int Array                                Best/Avg Time(ms)    Rate(M/s)   Per Row(ns)
      ------------------------------------------------------------------------------------------------
      ON_HEAP                                        586 /  628         14.3          69.9
      OFF_HEAP                                       893 /  902          9.4         106.5
      ```
      
      With this PR
      ```
      OpenJDK 64-Bit Server VM 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11 on Linux 4.4.0-66-generic
      Intel(R) Xeon(R) CPU E5-2667 v3  3.20GHz
      
      Int Array                                Best/Avg Time(ms)    Rate(M/s)   Per Row(ns)
      ------------------------------------------------------------------------------------------------
      ON_HEAP                                        306 /  331         27.4          36.4
      OFF_HEAP                                       282 /  287         29.8          33.6
      ```
      
      Source program
      ```
          (MemoryMode.ON_HEAP :: MemoryMode.OFF_HEAP :: Nil).foreach { memMode => {
            val len = 8 * 1024 * 1024
            val column = ColumnVector.allocate(len * 2, new ArrayType(IntegerType, false), memMode)
      
            val data = column.arrayData
            var i = 0
            while (i < len) {
              data.putInt(i, i)
              i += 1
            }
            column.putArray(0, 0, len)
      
            val benchmark = new Benchmark("Int Array", len, minNumIters = 20)
            benchmark.addCase(s"$memMode") { iter =>
              var i = 0
              while (i < 50) {
                column.getArray(0).toIntArray
                i += 1
              }
            }
            benchmark.run
          }}
      ```
      
      ## How was this patch tested?
      
      Added test suite
      
      Author: Kazuaki Ishizaki <ishizaki@jp.ibm.com>
      
      Closes #18425 from kiszk/SPARK-21217.
      c09b31eb
    • Takuya UESHIN's avatar
      [SPARK-21327][SQL][PYSPARK] ArrayConstructor should handle an array of... · 53c2eb59
      Takuya UESHIN authored
      [SPARK-21327][SQL][PYSPARK] ArrayConstructor should handle an array of typecode 'l' as long rather than int in Python 2.
      
      ## What changes were proposed in this pull request?
      
      Currently `ArrayConstructor` handles an array of typecode `'l'` as `int` when converting Python object in Python 2 into Java object, so if the value is larger than `Integer.MAX_VALUE` or smaller than `Integer.MIN_VALUE` then the overflow occurs.
      
      ```python
      import array
      data = [Row(longarray=array.array('l', [-9223372036854775808, 0, 9223372036854775807]))]
      df = spark.createDataFrame(data)
      df.show(truncate=False)
      ```
      
      ```
      +----------+
      |longarray |
      +----------+
      |[0, 0, -1]|
      +----------+
      ```
      
      This should be:
      
      ```
      +----------------------------------------------+
      |longarray                                     |
      +----------------------------------------------+
      |[-9223372036854775808, 0, 9223372036854775807]|
      +----------------------------------------------+
      ```
      
      ## How was this patch tested?
      
      Added a test and existing tests.
      
      Author: Takuya UESHIN <ueshin@databricks.com>
      
      Closes #18553 from ueshin/issues/SPARK-21327.
      53c2eb59
  2. Jul 06, 2017
    • hyukjinkwon's avatar
      [SPARK-21326][SPARK-21066][ML] Use TextFileFormat in LibSVMFileFormat and... · d451b7f4
      hyukjinkwon authored
      [SPARK-21326][SPARK-21066][ML] Use TextFileFormat in LibSVMFileFormat and allow multiple input paths for determining numFeatures
      
      ## What changes were proposed in this pull request?
      
      This is related with [SPARK-19918](https://issues.apache.org/jira/browse/SPARK-19918) and [SPARK-18362](https://issues.apache.org/jira/browse/SPARK-18362).
      
      This PR proposes to use `TextFileFormat` and allow multiple input paths (but with a warning) when determining the number of features in LibSVM data source via an extra scan.
      
      There are three points here:
      
      - The main advantage of this change should be to remove file-listing bottlenecks in driver side.
      
      - Another advantage is ones from using `FileScanRDD`. For example, I guess we can use `spark.sql.files.ignoreCorruptFiles` option when determining the number of features.
      
      - We can unify the schema inference code path in text based data sources. This is also a preparation for [SPARK-21289](https://issues.apache.org/jira/browse/SPARK-21289).
      
      ## How was this patch tested?
      
      Unit tests in `LibSVMRelationSuite`.
      
      Closes #18288
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #18556 from HyukjinKwon/libsvm-schema.
      d451b7f4
    • Jacek Laskowski's avatar
      [SPARK-21329][SS] Make EventTimeWatermarkExec explicitly UnaryExecNode · e5bb2617
      Jacek Laskowski authored
      ## What changes were proposed in this pull request?
      
      Making EventTimeWatermarkExec explicitly UnaryExecNode
      
      /cc tdas zsxwing
      
      ## How was this patch tested?
      
      Local build.
      
      Author: Jacek Laskowski <jacek@japila.pl>
      
      Closes #18509 from jaceklaskowski/EventTimeWatermarkExec-UnaryExecNode.
      e5bb2617
    • Wenchen Fan's avatar
      [SPARK-20946][SQL] Do not update conf for existing SparkContext in SparkSession.getOrCreate · 40c7add3
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      SparkContext is shared by all sessions, we should not update its conf for only one session.
      
      ## How was this patch tested?
      
      existing tests
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #18536 from cloud-fan/config.
      40c7add3
    • Tathagata Das's avatar
      [SPARK-21267][SS][DOCS] Update Structured Streaming Documentation · 0217dfd2
      Tathagata Das authored
      ## What changes were proposed in this pull request?
      
      Few changes to the Structured Streaming documentation
      - Clarify that the entire stream input table is not materialized
      - Add information for Ganglia
      - Add Kafka Sink to the main docs
      - Removed a couple of leftover experimental tags
      - Added more associated reading material and talk videos.
      
      In addition, https://github.com/apache/spark/pull/16856 broke the link to the RDD programming guide in several places while renaming the page. This PR fixes those sameeragarwal cloud-fan.
      - Added a redirection to avoid breaking internal and possible external links.
      - Removed unnecessary redirection pages that were there since the separate scala, java, and python programming guides were merged together in 2013 or 2014.
      
      ## How was this patch tested?
      
      (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: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #18485 from tdas/SPARK-21267.
      0217dfd2
    • Wang Gengliang's avatar
      [SPARK-21323][SQL] Rename plans.logical.statsEstimation.Range to ValueInterval · bf66335a
      Wang Gengliang authored
      ## What changes were proposed in this pull request?
      
      Rename org.apache.spark.sql.catalyst.plans.logical.statsEstimation.Range to ValueInterval.
      The current naming is identical to logical operator "range".
      Refactoring it to ValueInterval is more accurate.
      
      ## How was this patch tested?
      
      unit test
      
      Please review http://spark.apache.org/contributing.html before opening a pull request.
      
      Author: Wang Gengliang <ltnwgl@gmail.com>
      
      Closes #18549 from gengliangwang/ValueInterval.
      bf66335a
    • Liang-Chi Hsieh's avatar
      [SPARK-21204][SQL] Add support for Scala Set collection types in serialization · 48e44b24
      Liang-Chi Hsieh authored
      ## What changes were proposed in this pull request?
      
      Currently we can't produce a `Dataset` containing `Set` in SparkSQL. This PR tries to support serialization/deserialization of `Set`.
      
      Because there's no corresponding internal data type in SparkSQL for a `Set`, the most proper choice for serializing a set should be an array.
      
      ## How was this patch tested?
      
      Added unit tests.
      
      Author: Liang-Chi Hsieh <viirya@gmail.com>
      
      Closes #18416 from viirya/SPARK-21204.
      48e44b24
    • Bogdan Raducanu's avatar
      [SPARK-21228][SQL] InSet incorrect handling of structs · 26ac085d
      Bogdan Raducanu authored
      ## What changes were proposed in this pull request?
      When data type is struct, InSet now uses TypeUtils.getInterpretedOrdering (similar to EqualTo) to build a TreeSet. In other cases it will use a HashSet as before (which should be faster). Similarly, In.eval uses Ordering.equiv instead of equals.
      
      ## How was this patch tested?
      New test in SQLQuerySuite.
      
      Author: Bogdan Raducanu <bogdan@databricks.com>
      
      Closes #18455 from bogdanrdc/SPARK-21228.
      26ac085d
    • caoxuewen's avatar
      [SPARK-20950][CORE] add a new config to diskWriteBufferSize which is hard coded before · 565e7a8d
      caoxuewen authored
      ## What changes were proposed in this pull request?
      
      This PR Improvement in two:
      1.With spark.shuffle.spill.diskWriteBufferSize configure diskWriteBufferSize of ShuffleExternalSorter.
          when change the size of the diskWriteBufferSize to test `forceSorterToSpill`
          The average performance of running 10 times is as follows:(their unit is MS).
      ```
      diskWriteBufferSize:       1M    512K    256K    128K    64K    32K    16K    8K    4K
      ---------------------------------------------------------------------------------------
      RecordSize = 2.5M          742   722     694     686     667    668    671    669   683
      RecordSize = 1M            294   293     292     287     283    285    281    279   285
      ```
      
      2.Remove outputBufferSizeInBytes and inputBufferSizeInBytes to initialize in mergeSpillsWithFileStream function.
      
      ## How was this patch tested?
      The unit test.
      
      Author: caoxuewen <cao.xuewen@zte.com.cn>
      
      Closes #18174 from heary-cao/buffersize.
      565e7a8d
    • Wang Gengliang's avatar
      [SPARK-21273][SQL][FOLLOW-UP] Add missing test cases back and revise code style · d540dfbf
      Wang Gengliang authored
      ## What changes were proposed in this pull request?
      
      Add missing test cases back and revise code style
      
      Follow up the previous PR: https://github.com/apache/spark/pull/18479
      
      ## How was this patch tested?
      
      Unit test
      
      Please review http://spark.apache.org/contributing.html before opening a pull request.
      
      Author: Wang Gengliang <ltnwgl@gmail.com>
      
      Closes #18548 from gengliangwang/stat_propagation_revise.
      d540dfbf
    • wangzhenhua's avatar
      [SPARK-21324][TEST] Improve statistics test suites · b8e4d567
      wangzhenhua authored
      ## What changes were proposed in this pull request?
      
      1. move `StatisticsCollectionTestBase` to a separate file.
      2. move some test cases to `StatisticsCollectionSuite` so that `hive/StatisticsSuite` only keeps tests that need hive support.
      3. clear up some test cases.
      
      ## How was this patch tested?
      
      Existing tests.
      
      Author: wangzhenhua <wangzhenhua@huawei.com>
      Author: Zhenhua Wang <wzh_zju@163.com>
      
      Closes #18545 from wzhfy/cleanStatSuites.
      b8e4d567
    • Liang-Chi Hsieh's avatar
      [SPARK-20703][SQL] Associate metrics with data writes onto DataFrameWriter operations · 6ff05a66
      Liang-Chi Hsieh authored
      ## What changes were proposed in this pull request?
      
      Right now in the UI, after SPARK-20213, we can show the operations to write data out. However, there is no way to associate metrics with data writes. We should show relative metrics on the operations.
      
      #### Supported commands
      
      This change supports updating metrics for file-based data writing operations, including `InsertIntoHadoopFsRelationCommand`, `InsertIntoHiveTable`.
      
      Supported metrics:
      
      * number of written files
      * number of dynamic partitions
      * total bytes of written data
      * total number of output rows
      * average writing data out time (ms)
      * (TODO) min/med/max number of output rows per file/partition
      * (TODO) min/med/max bytes of written data per file/partition
      
      ####  Commands not supported
      
      `InsertIntoDataSourceCommand`, `SaveIntoDataSourceCommand`:
      
      The two commands uses DataSource APIs to write data out, i.e., the logic of writing data out is delegated to the DataSource implementations, such as  `InsertableRelation.insert` and `CreatableRelationProvider.createRelation`. So we can't obtain metrics from delegated methods for now.
      
      `CreateHiveTableAsSelectCommand`, `CreateDataSourceTableAsSelectCommand` :
      
      The two commands invokes other commands to write data out. The invoked commands can even write to non file-based data source. We leave them as future TODO.
      
      #### How to update metrics of writing files out
      
      A `RunnableCommand` which wants to update metrics, needs to override its `metrics` and provide the metrics data structure to `ExecutedCommandExec`.
      
      The metrics are prepared during the execution of `FileFormatWriter`. The callback function passed to `FileFormatWriter` will accept the metrics and update accordingly.
      
      There is a metrics updating function in `RunnableCommand`. In runtime, the function will be bound to the spark context and `metrics` of `ExecutedCommandExec` and pass to `FileFormatWriter`.
      
      ## How was this patch tested?
      
      Updated unit tests.
      
      Author: Liang-Chi Hsieh <viirya@gmail.com>
      
      Closes #18159 from viirya/SPARK-20703-2.
      6ff05a66
    • jerryshao's avatar
      [SPARK-21012][SUBMIT] Add glob support for resources adding to Spark · 5800144a
      jerryshao authored
      Current "--jars (spark.jars)", "--files (spark.files)", "--py-files (spark.submit.pyFiles)" and "--archives (spark.yarn.dist.archives)" only support non-glob path. This is OK for most of the cases, but when user requires to add more jars, files into Spark, it is too verbose to list one by one. So here propose to add glob path support for resources.
      
      Also improving the code of downloading resources.
      
      ## How was this patch tested?
      
      UT added, also verified manually in local cluster.
      
      Author: jerryshao <sshao@hortonworks.com>
      
      Closes #18235 from jerryshao/SPARK-21012.
      5800144a
    • Tathagata Das's avatar
      [SS][MINOR] Fix flaky test in DatastreamReaderWriterSuite. temp checkpoint dir should be deleted · 60043f22
      Tathagata Das authored
      ## What changes were proposed in this pull request?
      
      Stopping query while it is being initialized can throw interrupt exception, in which case temporary checkpoint directories will not be deleted, and the test will fail.
      
      Author: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #18442 from tdas/DatastreamReaderWriterSuite-fix.
      60043f22
    • Sumedh Wale's avatar
      [SPARK-21312][SQL] correct offsetInBytes in UnsafeRow.writeToStream · 14a3bb3a
      Sumedh Wale authored
      ## What changes were proposed in this pull request?
      
      Corrects offsetInBytes calculation in UnsafeRow.writeToStream. Known failures include writes to some DataSources that have own SparkPlan implementations and cause EXCHANGE in writes.
      
      ## How was this patch tested?
      
      Extended UnsafeRowSuite.writeToStream to include an UnsafeRow over byte array having non-zero offset.
      
      Author: Sumedh Wale <swale@snappydata.io>
      
      Closes #18535 from sumwale/SPARK-21312.
      14a3bb3a
    • gatorsmile's avatar
      [SPARK-21308][SQL] Remove SQLConf parameters from the optimizer · 75b168fd
      gatorsmile authored
      ### What changes were proposed in this pull request?
      This PR removes SQLConf parameters from the optimizer rules
      
      ### How was this patch tested?
      The existing test cases
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #18533 from gatorsmile/rmSQLConfOptimizer.
      75b168fd
  3. Jul 05, 2017
    • Shixiong Zhu's avatar
      [SPARK-21248][SS] The clean up codes in StreamExecution should not be interrupted · ab866f11
      Shixiong Zhu authored
      ## What changes were proposed in this pull request?
      
      This PR uses `runUninterruptibly` to avoid that the clean up codes in StreamExecution is interrupted. It also removes an optimization in `runUninterruptibly` to make sure this method never throw `InterruptedException`.
      
      ## How was this patch tested?
      
      Jenkins
      
      Author: Shixiong Zhu <shixiong@databricks.com>
      
      Closes #18461 from zsxwing/SPARK-21248.
      ab866f11
    • Dongjoon Hyun's avatar
      [SPARK-21278][PYSPARK] Upgrade to Py4J 0.10.6 · c8d0aba1
      Dongjoon Hyun authored
      ## What changes were proposed in this pull request?
      
      This PR aims to bump Py4J in order to fix the following float/double bug.
      Py4J 0.10.5 fixes this (https://github.com/bartdag/py4j/issues/272) and the latest Py4J is 0.10.6.
      
      **BEFORE**
      ```
      >>> df = spark.range(1)
      >>> df.select(df['id'] + 17.133574204226083).show()
      +--------------------+
      |(id + 17.1335742042)|
      +--------------------+
      |       17.1335742042|
      +--------------------+
      ```
      
      **AFTER**
      ```
      >>> df = spark.range(1)
      >>> df.select(df['id'] + 17.133574204226083).show()
      +-------------------------+
      |(id + 17.133574204226083)|
      +-------------------------+
      |       17.133574204226083|
      +-------------------------+
      ```
      
      ## How was this patch tested?
      
      Manual.
      
      Author: Dongjoon Hyun <dongjoon@apache.org>
      
      Closes #18546 from dongjoon-hyun/SPARK-21278.
      c8d0aba1
    • gatorsmile's avatar
      [SPARK-21307][SQL] Remove SQLConf parameters from the parser-related classes. · c8e7f445
      gatorsmile authored
      ### What changes were proposed in this pull request?
      This PR is to remove SQLConf parameters from the parser-related classes.
      
      ### How was this patch tested?
      The existing test cases.
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #18531 from gatorsmile/rmSQLConfParser.
      c8e7f445
    • Jeff Zhang's avatar
      [SPARK-19439][PYSPARK][SQL] PySpark's registerJavaFunction Should Support UDAFs · 742da086
      Jeff Zhang authored
      ## What changes were proposed in this pull request?
      
      Support register Java UDAFs in PySpark so that user can use Java UDAF in PySpark. Besides that I also add api in `UDFRegistration`
      
      ## How was this patch tested?
      
      Unit test is added
      
      Author: Jeff Zhang <zjffdu@apache.org>
      
      Closes #17222 from zjffdu/SPARK-19439.
      742da086
    • sadikovi's avatar
      [SPARK-20858][DOC][MINOR] Document ListenerBus event queue size · 960298ee
      sadikovi authored
      ## What changes were proposed in this pull request?
      
      This change adds a new configuration option `spark.scheduler.listenerbus.eventqueue.size` to the configuration docs to specify the capacity of the spark listener bus event queue. Default value is 10000.
      
      This is doc PR for [SPARK-15703](https://issues.apache.org/jira/browse/SPARK-15703).
      
      I added option to the `Scheduling` section, however it might be more related to `Spark UI` section.
      
      ## How was this patch tested?
      
      Manually verified correct rendering of configuration option.
      
      Author: sadikovi <ivan.sadikov@lincolnuni.ac.nz>
      Author: Ivan Sadikov <ivan.sadikov@team.telstra.com>
      
      Closes #18476 from sadikovi/SPARK-20858.
      960298ee
    • he.qiao's avatar
      [SPARK-21286][TEST] Modified StorageTabSuite unit test · e3e2b5da
      he.qiao authored
      ## What changes were proposed in this pull request?
      The old unit test not effect
      
      ## How was this patch tested?
      unit test
      
      Author: he.qiao <he.qiao17@zte.com.cn>
      
      Closes #18511 from Geek-He/dev_0703.
      e3e2b5da
    • ouyangxiaochen's avatar
      [SPARK-20383][SQL] Supporting Create [temporary] Function with the keyword 'OR... · 5787ace4
      ouyangxiaochen authored
      [SPARK-20383][SQL] Supporting Create [temporary] Function with the keyword 'OR REPLACE' and 'IF NOT EXISTS'
      
      ## What changes were proposed in this pull request?
      
      support to create [temporary] function with the keyword 'OR REPLACE' and 'IF NOT EXISTS'
      
      ## How was this patch tested?
      manual test and added test cases
      
      Please review http://spark.apache.org/contributing.html before opening a pull request.
      
      Author: ouyangxiaochen <ou.yangxiaochen@zte.com.cn>
      
      Closes #17681 from ouyangxiaochen/spark-419.
      5787ace4
    • Takuya UESHIN's avatar
      [SPARK-16167][SQL] RowEncoder should preserve array/map type nullability. · 873f3ad2
      Takuya UESHIN authored
      ## What changes were proposed in this pull request?
      
      Currently `RowEncoder` doesn't preserve nullability of `ArrayType` or `MapType`.
      It returns always `containsNull = true` for `ArrayType`, `valueContainsNull = true` for `MapType` and also the nullability of itself is always `true`.
      
      This pr fixes the nullability of them.
      ## How was this patch tested?
      
      Add tests to check if `RowEncoder` preserves array/map nullability.
      
      Author: Takuya UESHIN <ueshin@happy-camper.st>
      Author: Takuya UESHIN <ueshin@databricks.com>
      
      Closes #13873 from ueshin/issues/SPARK-16167.
      873f3ad2
    • actuaryzhang's avatar
      [SPARK-21310][ML][PYSPARK] Expose offset in PySpark · 4852b7d4
      actuaryzhang authored
      ## What changes were proposed in this pull request?
      Add offset to PySpark in GLM as in #16699.
      
      ## How was this patch tested?
      Python test
      
      Author: actuaryzhang <actuaryzhang10@gmail.com>
      
      Closes #18534 from actuaryzhang/pythonOffset.
      4852b7d4
    • Takuya UESHIN's avatar
      [SPARK-18623][SQL] Add `returnNullable` to `StaticInvoke` and modify it to handle properly. · a3864325
      Takuya UESHIN authored
      ## What changes were proposed in this pull request?
      
      Add `returnNullable` to `StaticInvoke` the same as #15780 is trying to add to `Invoke` and modify to handle properly.
      
      ## How was this patch tested?
      
      Existing tests.
      
      Author: Takuya UESHIN <ueshin@happy-camper.st>
      Author: Takuya UESHIN <ueshin@databricks.com>
      
      Closes #16056 from ueshin/issues/SPARK-18623.
      a3864325
    • Wenchen Fan's avatar
      [SPARK-21304][SQL] remove unnecessary isNull variable for collection related encoder expressions · f2c3b1dd
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      For these collection-related encoder expressions, we don't need to create `isNull` variable if the loop element is not nullable.
      
      ## How was this patch tested?
      
      existing tests.
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #18529 from cloud-fan/minor.
      f2c3b1dd
  4. Jul 04, 2017
    • actuaryzhang's avatar
      [SPARK-20889][SPARKR][FOLLOWUP] Clean up grouped doc for column methods · e9a93f81
      actuaryzhang authored
      ## What changes were proposed in this pull request?
      Add doc for methods that were left out, and fix various style and consistency issues.
      
      Author: actuaryzhang <actuaryzhang10@gmail.com>
      
      Closes #18493 from actuaryzhang/sparkRDocCleanup.
      e9a93f81
    • Takuya UESHIN's avatar
      [SPARK-21300][SQL] ExternalMapToCatalyst should null-check map key prior to... · ce10545d
      Takuya UESHIN authored
      [SPARK-21300][SQL] ExternalMapToCatalyst should null-check map key prior to converting to internal value.
      
      ## What changes were proposed in this pull request?
      
      `ExternalMapToCatalyst` should null-check map key prior to converting to internal value to throw an appropriate Exception instead of something like NPE.
      
      ## How was this patch tested?
      
      Added a test and existing tests.
      
      Author: Takuya UESHIN <ueshin@databricks.com>
      
      Closes #18524 from ueshin/issues/SPARK-21300.
      ce10545d
    • gatorsmile's avatar
      [SPARK-21295][SQL] Use qualified names in error message for missing references · de14086e
      gatorsmile authored
      ### What changes were proposed in this pull request?
      It is strange to see the following error message. Actually, the column is from another table.
      ```
      cannot resolve '`right.a`' given input columns: [a, c, d];
      ```
      
      After the PR, the error message looks like
      ```
      cannot resolve '`right.a`' given input columns: [left.a, right.c, right.d];
      ```
      
      ### How was this patch tested?
      Added a test case
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #18520 from gatorsmile/removeSQLConf.
      de14086e
    • wangmiao1981's avatar
      [MINOR][SPARKR] ignore Rplots.pdf test output after running R tests · daabf425
      wangmiao1981 authored
      ## What changes were proposed in this pull request?
      
      After running R tests in local build, it outputs Rplots.pdf. This one should be ignored in the git repository.
      
      Author: wangmiao1981 <wm624@hotmail.com>
      
      Closes #18518 from wangmiao1981/ignore.
      daabf425
    • actuaryzhang's avatar
      [SPARK-20889][SPARKR] Grouped documentation for WINDOW column methods · cec39215
      actuaryzhang authored
      ## What changes were proposed in this pull request?
      
      Grouped documentation for column window methods.
      
      Author: actuaryzhang <actuaryzhang10@gmail.com>
      
      Closes #18481 from actuaryzhang/sparkRDocWindow.
      cec39215
    • dardelet's avatar
      [SPARK-21268][MLLIB] Move center calculations to a distributed map in KMeans · 4d6d8192
      dardelet authored
      ## What changes were proposed in this pull request?
      
      The scal() and creation of newCenter vector is done in the driver, after a collectAsMap operation while it could be done in the distributed RDD.
      This PR moves this code before the collectAsMap for more efficiency
      
      ## How was this patch tested?
      
      This was tested manually by running the KMeansExample and verifying that the new code ran without error and gave same output as before.
      
      Author: dardelet <guillaumegorp@gmail.com>
      Author: Guillaume Dardelet <dardelet@users.noreply.github.com>
      
      Closes #18491 from dardelet/move-center-calculation-to-distributed-map-kmean.
      4d6d8192
    • Dongjoon Hyun's avatar
      [SPARK-20256][SQL] SessionState should be created more lazily · 1b50e0e0
      Dongjoon Hyun authored
      ## What changes were proposed in this pull request?
      
      `SessionState` is designed to be created lazily. However, in reality, it created immediately in `SparkSession.Builder.getOrCreate` ([here](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala#L943)).
      
      This PR aims to recover the lazy behavior by keeping the options into `initialSessionOptions`. The benefit is like the following. Users can start `spark-shell` and use RDD operations without any problems.
      
      **BEFORE**
      ```scala
      $ bin/spark-shell
      java.lang.IllegalArgumentException: Error while instantiating 'org.apache.spark.sql.hive.HiveSessionStateBuilder'
      ...
      Caused by: org.apache.spark.sql.AnalysisException:
          org.apache.hadoop.hive.ql.metadata.HiveException:
             MetaException(message:java.security.AccessControlException:
                Permission denied: user=spark, access=READ,
                   inode="/apps/hive/warehouse":hive:hdfs:drwx------
      ```
      As reported in SPARK-20256, this happens when the warehouse directory is not allowed for this user.
      
      **AFTER**
      ```scala
      $ bin/spark-shell
      ...
      Welcome to
            ____              __
           / __/__  ___ _____/ /__
          _\ \/ _ \/ _ `/ __/  '_/
         /___/ .__/\_,_/_/ /_/\_\   version 2.3.0-SNAPSHOT
            /_/
      
      Using Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_112)
      Type in expressions to have them evaluated.
      Type :help for more information.
      
      scala> sc.range(0, 10, 1).count()
      res0: Long = 10
      ```
      
      ## How was this patch tested?
      
      Manual.
      
      This closes #18512 .
      
      Author: Dongjoon Hyun <dongjoon@apache.org>
      
      Closes #18501 from dongjoon-hyun/SPARK-20256.
      1b50e0e0
Loading