Skip to content
Snippets Groups Projects
  1. Oct 05, 2017
    • Liang-Chi Hsieh's avatar
      [SPARK-22206][SQL][SPARKR] gapply in R can't work on empty grouping columns · ae61f187
      Liang-Chi Hsieh authored
      ## What changes were proposed in this pull request?
      
      Looks like `FlatMapGroupsInRExec.requiredChildDistribution` didn't consider empty grouping attributes. It should be a problem when running `EnsureRequirements` and `gapply` in R can't work on empty grouping columns.
      
      ## How was this patch tested?
      
      Added test.
      
      Author: Liang-Chi Hsieh <viirya@gmail.com>
      
      Closes #19436 from viirya/fix-flatmapinr-distribution.
      ae61f187
  2. Oct 01, 2017
  3. Sep 25, 2017
    • Zhenhua Wang's avatar
      [SPARK-22100][SQL] Make percentile_approx support date/timestamp type and... · 365a29bd
      Zhenhua Wang authored
      [SPARK-22100][SQL] Make percentile_approx support date/timestamp type and change the output type to be the same as input type
      
      ## What changes were proposed in this pull request?
      
      The `percentile_approx` function previously accepted numeric type input and output double type results.
      
      But since all numeric types, date and timestamp types are represented as numerics internally, `percentile_approx` can support them easily.
      
      After this PR, it supports date type, timestamp type and numeric types as input types. The result type is also changed to be the same as the input type, which is more reasonable for percentiles.
      
      This change is also required when we generate equi-height histograms for these types.
      
      ## How was this patch tested?
      
      Added a new test and modified some existing tests.
      
      Author: Zhenhua Wang <wangzhenhua@huawei.com>
      
      Closes #19321 from wzhfy/approx_percentile_support_types.
      365a29bd
  4. Sep 21, 2017
    • hyukjinkwon's avatar
      [SPARK-21780][R] Simpler Dataset.sample API in R · a8d9ec8a
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      This PR make `sample(...)` able to omit `withReplacement` defaulting to `FALSE`.
      
      In short, the following examples are allowed:
      
      ```r
      > df <- createDataFrame(as.list(seq(10)))
      > count(sample(df, fraction=0.5, seed=3))
      [1] 4
      > count(sample(df, fraction=1.0))
      [1] 10
      ```
      
      In addition, this PR also adds some type checking logics as below:
      
      ```r
      > sample(df, fraction = "a")
      Error in sample(df, fraction = "a") :
        fraction must be numeric; however, got character
      > sample(df, fraction = 1, seed = NULL)
      Error in sample(df, fraction = 1, seed = NULL) :
        seed must not be NULL or NA; however, got NULL
      > sample(df, list(1), 1.0)
      Error in sample(df, list(1), 1) :
        withReplacement must be logical; however, got list
      > sample(df, fraction = -1.0)
      ...
      Error in sample : illegal argument - requirement failed: Sampling fraction (-1.0) must be on interval [0, 1] without replacement
      ```
      
      ## How was this patch tested?
      
      Manually tested, unit tests added in `R/pkg/tests/fulltests/test_sparkSQL.R`.
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #19243 from HyukjinKwon/SPARK-21780.
      a8d9ec8a
  5. Sep 14, 2017
    • goldmedal's avatar
      [SPARK-21513][SQL][FOLLOWUP] Allow UDF to_json support converting MapType to... · a28728a9
      goldmedal authored
      [SPARK-21513][SQL][FOLLOWUP] Allow UDF to_json support converting MapType to json for PySpark and SparkR
      
      ## What changes were proposed in this pull request?
      In previous work SPARK-21513, we has allowed `MapType` and `ArrayType` of `MapType`s convert to a json string but only for Scala API. In this follow-up PR, we will make SparkSQL support it for PySpark and SparkR, too. We also fix some little bugs and comments of the previous work in this follow-up PR.
      
      ### For PySpark
      ```
      >>> data = [(1, {"name": "Alice"})]
      >>> df = spark.createDataFrame(data, ("key", "value"))
      >>> df.select(to_json(df.value).alias("json")).collect()
      [Row(json=u'{"name":"Alice")']
      >>> data = [(1, [{"name": "Alice"}, {"name": "Bob"}])]
      >>> df = spark.createDataFrame(data, ("key", "value"))
      >>> df.select(to_json(df.value).alias("json")).collect()
      [Row(json=u'[{"name":"Alice"},{"name":"Bob"}]')]
      ```
      ### For SparkR
      ```
      # Converts a map into a JSON object
      df2 <- sql("SELECT map('name', 'Bob')) as people")
      df2 <- mutate(df2, people_json = to_json(df2$people))
      # Converts an array of maps into a JSON array
      df2 <- sql("SELECT array(map('name', 'Bob'), map('name', 'Alice')) as people")
      df2 <- mutate(df2, people_json = to_json(df2$people))
      ```
      ## How was this patch tested?
      Add unit test cases.
      
      cc viirya HyukjinKwon
      
      Author: goldmedal <liugs963@gmail.com>
      
      Closes #19223 from goldmedal/SPARK-21513-fp-PySaprkAndSparkR.
      a28728a9
  6. Sep 03, 2017
    • hyukjinkwon's avatar
      [SPARK-21897][PYTHON][R] Add unionByName API to DataFrame in Python and R · 07fd68a2
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      This PR proposes to add a wrapper for `unionByName` API to R and Python as well.
      
      **Python**
      
      ```python
      df1 = spark.createDataFrame([[1, 2, 3]], ["col0", "col1", "col2"])
      df2 = spark.createDataFrame([[4, 5, 6]], ["col1", "col2", "col0"])
      df1.unionByName(df2).show()
      ```
      
      ```
      +----+----+----+
      |col0|col1|col3|
      +----+----+----+
      |   1|   2|   3|
      |   6|   4|   5|
      +----+----+----+
      ```
      
      **R**
      
      ```R
      df1 <- select(createDataFrame(mtcars), "carb", "am", "gear")
      df2 <- select(createDataFrame(mtcars), "am", "gear", "carb")
      head(unionByName(limit(df1, 2), limit(df2, 2)))
      ```
      
      ```
        carb am gear
      1    4  1    4
      2    4  1    4
      3    4  1    4
      4    4  1    4
      ```
      
      ## How was this patch tested?
      
      Doctests for Python and unit test added in `test_sparkSQL.R` for R.
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #19105 from HyukjinKwon/unionByName-r-python.
      07fd68a2
  7. Aug 22, 2017
    • Andrew Ray's avatar
      [SPARK-21584][SQL][SPARKR] Update R method for summary to call new implementation · 5c9b3017
      Andrew Ray authored
      ## What changes were proposed in this pull request?
      
      SPARK-21100 introduced a new `summary` method to the Scala/Java Dataset API that included  expanded statistics (vs `describe`) and control over which statistics to compute. Currently in the R API `summary` acts as an alias for `describe`. This patch updates the R API to call the new `summary` method in the JVM that includes additional statistics and ability to select which to compute.
      
      This does not break the current interface as the present `summary` method does not take additional arguments like `describe` and the output was never meant to be used programmatically.
      
      ## How was this patch tested?
      
      Modified and additional unit tests.
      
      Author: Andrew Ray <ray.andrew@gmail.com>
      
      Closes #18786 from aray/summary-r.
      5c9b3017
  8. Aug 03, 2017
    • hyukjinkwon's avatar
      [SPARK-21602][R] Add map_keys and map_values functions to R · 97ba4918
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      This PR adds `map_values` and `map_keys` to R API.
      
      ```r
      > df <- createDataFrame(cbind(model = rownames(mtcars), mtcars))
      > tmp <- mutate(df, v = create_map(df$model, df$cyl))
      > head(select(tmp, map_keys(tmp$v)))
      ```
      ```
              map_keys(v)
      1         Mazda RX4
      2     Mazda RX4 Wag
      3        Datsun 710
      4    Hornet 4 Drive
      5 Hornet Sportabout
      6           Valiant
      ```
      ```r
      > head(select(tmp, map_values(tmp$v)))
      ```
      ```
        map_values(v)
      1             6
      2             6
      3             4
      4             6
      5             8
      6             6
      ```
      
      ## How was this patch tested?
      
      Manual tests and unit tests in `R/pkg/tests/fulltests/test_sparkSQL.R`
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #18809 from HyukjinKwon/map-keys-values-r.
      97ba4918
  9. Jul 10, 2017
    • hyukjinkwon's avatar
      [SPARK-21266][R][PYTHON] Support schema a DDL-formatted string in dapply/gapply/from_json · 2bfd5acc
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      This PR supports schema in a DDL formatted string for `from_json` in R/Python and `dapply` and `gapply` in R, which are commonly used and/or consistent with Scala APIs.
      
      Additionally, this PR exposes `structType` in R to allow working around in other possible corner cases.
      
      **Python**
      
      `from_json`
      
      ```python
      from pyspark.sql.functions import from_json
      
      data = [(1, '''{"a": 1}''')]
      df = spark.createDataFrame(data, ("key", "value"))
      df.select(from_json(df.value, "a INT").alias("json")).show()
      ```
      
      **R**
      
      `from_json`
      
      ```R
      df <- sql("SELECT named_struct('name', 'Bob') as people")
      df <- mutate(df, people_json = to_json(df$people))
      head(select(df, from_json(df$people_json, "name STRING")))
      ```
      
      `structType.character`
      
      ```R
      structType("a STRING, b INT")
      ```
      
      `dapply`
      
      ```R
      dapply(createDataFrame(list(list(1.0)), "a"), function(x) {x}, "a DOUBLE")
      ```
      
      `gapply`
      
      ```R
      gapply(createDataFrame(list(list(1.0)), "a"), "a", function(key, x) { x }, "a DOUBLE")
      ```
      
      ## How was this patch tested?
      
      Doc tests for `from_json` in Python and unit tests `test_sparkSQL.R` in R.
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #18498 from HyukjinKwon/SPARK-21266.
      2bfd5acc
  10. Jun 28, 2017
    • hyukjinkwon's avatar
      [SPARK-21224][R] Specify a schema by using a DDL-formatted string when reading in R · db44f5f3
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      This PR proposes to support a DDL-formetted string as schema as below:
      
      ```r
      mockLines <- c("{\"name\":\"Michael\"}",
                     "{\"name\":\"Andy\", \"age\":30}",
                     "{\"name\":\"Justin\", \"age\":19}")
      jsonPath <- tempfile(pattern = "sparkr-test", fileext = ".tmp")
      writeLines(mockLines, jsonPath)
      df <- read.df(jsonPath, "json", "name STRING, age DOUBLE")
      collect(df)
      ```
      
      ## How was this patch tested?
      
      Tests added in `test_streaming.R` and `test_sparkSQL.R` and manual tests.
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #18431 from HyukjinKwon/r-ddl-schema.
      db44f5f3
  11. Jun 18, 2017
  12. Jun 11, 2017
    • Felix Cheung's avatar
      [SPARK-20877][SPARKR][FOLLOWUP] clean up after test move · 9f4ff955
      Felix Cheung authored
      ## What changes were proposed in this pull request?
      
      clean up after big test move
      
      ## How was this patch tested?
      
      unit tests, jenkins
      
      Author: Felix Cheung <felixcheung_m@hotmail.com>
      
      Closes #18267 from felixcheung/rtestset2.
      9f4ff955
    • Felix Cheung's avatar
      [SPARK-20877][SPARKR] refactor tests to basic tests only for CRAN · dc4c3518
      Felix Cheung authored
      ## What changes were proposed in this pull request?
      
      Move all existing tests to non-installed directory so that it will never run by installing SparkR package
      
      For a follow-up PR:
      - remove all skip_on_cran() calls in tests
      - clean up test timer
      - improve or change basic tests that do run on CRAN (if anyone has suggestion)
      
      It looks like `R CMD build pkg` will still put pkg\tests (ie. the full tests) into the source package but `R CMD INSTALL` on such source package does not install these tests (and so `R CMD check` does not run them)
      
      ## How was this patch tested?
      
      - [x] unit tests, Jenkins
      - [x] AppVeyor
      - [x] make a source package, install it, `R CMD check` it - verify the full tests are not installed or run
      
      Author: Felix Cheung <felixcheung_m@hotmail.com>
      
      Closes #18264 from felixcheung/rtestset.
      dc4c3518
  13. May 31, 2017
    • Felix Cheung's avatar
      [SPARK-20877][SPARKR][WIP] add timestamps to test runs · 382fefd1
      Felix Cheung authored
      ## What changes were proposed in this pull request?
      
      to investigate how long they run
      
      ## How was this patch tested?
      
      Jenkins, AppVeyor
      
      Author: Felix Cheung <felixcheung_m@hotmail.com>
      
      Closes #18104 from felixcheung/rtimetest.
      382fefd1
  14. May 23, 2017
    • Shivaram Venkataraman's avatar
      [SPARK-20727] Skip tests that use Hadoop utils on CRAN Windows · d06610f9
      Shivaram Venkataraman authored
      ## What changes were proposed in this pull request?
      
      This change skips tests that use the Hadoop libraries while running
      on CRAN check with Windows as the operating system. This is to handle
      cases where the Hadoop winutils binaries are missing on the target
      system. The skipped tests consist of
      1. Tests that save, load a model in MLlib
      2. Tests that save, load CSV, JSON and Parquet files in SQL
      3. Hive tests
      
      ## How was this patch tested?
      
      Tested by running on a local windows VM with HADOOP_HOME unset. Also testing with https://win-builder.r-project.org
      
      Author: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
      
      Closes #17966 from shivaram/sparkr-windows-cran.
      d06610f9
  15. May 14, 2017
    • zero323's avatar
      [SPARK-20726][SPARKR] wrapper for SQL broadcast · 5a799fd8
      zero323 authored
      ## What changes were proposed in this pull request?
      
      - Adds R wrapper for `o.a.s.sql.functions.broadcast`.
      - Renames `broadcast` to `broadcast_`.
      
      ## How was this patch tested?
      
      Unit tests, check `check-cran.sh`.
      
      Author: zero323 <zero323@users.noreply.github.com>
      
      Closes #17965 from zero323/SPARK-20726.
      5a799fd8
  16. May 12, 2017
    • Felix Cheung's avatar
      [SPARK-20704][SPARKR] change CRAN test to run single thread · 888b84ab
      Felix Cheung authored
      ## What changes were proposed in this pull request?
      
      - [x] need to test by running R CMD check --as-cran
      - [x] sanity check vignettes
      
      ## How was this patch tested?
      
      Jenkins
      
      Author: Felix Cheung <felixcheung_m@hotmail.com>
      
      Closes #17945 from felixcheung/rchangesforpackage.
      888b84ab
  17. May 09, 2017
  18. May 08, 2017
  19. May 07, 2017
    • zero323's avatar
      [SPARK-20550][SPARKR] R wrapper for Dataset.alias · 1f73d358
      zero323 authored
      ## What changes were proposed in this pull request?
      
      - Add SparkR wrapper for `Dataset.alias`.
      - Adjust roxygen annotations for `functions.alias` (including example usage).
      
      ## How was this patch tested?
      
      Unit tests, `check_cran.sh`.
      
      Author: zero323 <zero323@users.noreply.github.com>
      
      Closes #17825 from zero323/SPARK-20550.
      1f73d358
    • Felix Cheung's avatar
      [SPARK-20543][SPARKR][FOLLOWUP] Don't skip tests on AppVeyor · 7087e011
      Felix Cheung authored
      ## What changes were proposed in this pull request?
      
      add environment
      
      ## How was this patch tested?
      
      wait for appveyor run
      
      Author: Felix Cheung <felixcheung_m@hotmail.com>
      
      Closes #17878 from felixcheung/appveyorrcran.
      7087e011
  20. May 04, 2017
    • zero323's avatar
      [SPARK-20544][SPARKR] R wrapper for input_file_name · f21897fc
      zero323 authored
      ## What changes were proposed in this pull request?
      
      Adds wrapper for `o.a.s.sql.functions.input_file_name`
      
      ## How was this patch tested?
      
      Existing unit tests, additional unit tests, `check-cran.sh`.
      
      Author: zero323 <zero323@users.noreply.github.com>
      
      Closes #17818 from zero323/SPARK-20544.
      f21897fc
    • zero323's avatar
      [SPARK-20585][SPARKR] R generic hint support · 9c36aa27
      zero323 authored
      ## What changes were proposed in this pull request?
      
      Adds support for generic hints on `SparkDataFrame`
      
      ## How was this patch tested?
      
      Unit tests, `check-cran.sh`
      
      Author: zero323 <zero323@users.noreply.github.com>
      
      Closes #17851 from zero323/SPARK-20585.
      9c36aa27
  21. May 03, 2017
    • Felix Cheung's avatar
      [SPARK-20543][SPARKR] skip tests when running on CRAN · fc472bdd
      Felix Cheung authored
      ## What changes were proposed in this pull request?
      
      General rule on skip or not:
      skip if
      - RDD tests
      - tests could run long or complicated (streaming, hivecontext)
      - tests on error conditions
      - tests won't likely change/break
      
      ## How was this patch tested?
      
      unit tests, `R CMD check --as-cran`, `R CMD check`
      
      Author: Felix Cheung <felixcheung_m@hotmail.com>
      
      Closes #17817 from felixcheung/rskiptest.
      fc472bdd
  22. May 01, 2017
    • zero323's avatar
      [SPARK-20532][SPARKR] Implement grouping and grouping_id · 90d77e97
      zero323 authored
      ## What changes were proposed in this pull request?
      
      Adds R wrappers for:
      
      - `o.a.s.sql.functions.grouping` as `o.a.s.sql.functions.is_grouping` (to avoid shading `base::grouping`
      - `o.a.s.sql.functions.grouping_id`
      
      ## How was this patch tested?
      
      Existing unit tests, additional unit tests. `check-cran.sh`.
      
      Author: zero323 <zero323@users.noreply.github.com>
      
      Closes #17807 from zero323/SPARK-20532.
      90d77e97
    • zero323's avatar
      [SPARK-20490][SPARKR] Add R wrappers for eqNullSafe and ! / not · 80e9cf1b
      zero323 authored
      ## What changes were proposed in this pull request?
      
      - Add null-safe equality operator `%<=>%` (sames as `o.a.s.sql.Column.eqNullSafe`, `o.a.s.sql.Column.<=>`)
      - Add boolean negation operator `!` and function `not `.
      
      ## How was this patch tested?
      
      Existing unit tests, additional unit tests, `check-cran.sh`.
      
      Author: zero323 <zero323@users.noreply.github.com>
      
      Closes #17783 from zero323/SPARK-20490.
      80e9cf1b
  23. Apr 30, 2017
    • zero323's avatar
      [SPARK-20535][SPARKR] R wrappers for explode_outer and posexplode_outer · ae3df4e9
      zero323 authored
      ## What changes were proposed in this pull request?
      
      Ad R wrappers for
      
      - `o.a.s.sql.functions.explode_outer`
      - `o.a.s.sql.functions.posexplode_outer`
      
      ## How was this patch tested?
      
      Additional unit tests, manual testing.
      
      Author: zero323 <zero323@users.noreply.github.com>
      
      Closes #17809 from zero323/SPARK-20535.
      ae3df4e9
  24. Apr 29, 2017
    • hyukjinkwon's avatar
      [SPARK-20493][R] De-duplicate parse logics for DDL-like type strings in R · 70f1bcd7
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      It seems we are using `SQLUtils.getSQLDataType` for type string in structField. It looks we can replace this with `CatalystSqlParser.parseDataType`.
      
      They look similar DDL-like type definitions as below:
      
      ```scala
      scala> Seq(Tuple1(Tuple1("a"))).toDF.show()
      ```
      ```
      +---+
      | _1|
      +---+
      |[a]|
      +---+
      ```
      
      ```scala
      scala> Seq(Tuple1(Tuple1("a"))).toDF.select($"_1".cast("struct<_1:string>")).show()
      ```
      ```
      +---+
      | _1|
      +---+
      |[a]|
      +---+
      ```
      
      Such type strings looks identical when R’s one as below:
      
      ```R
      > write.df(sql("SELECT named_struct('_1', 'a') as struct"), "/tmp/aa", "parquet")
      > collect(read.df("/tmp/aa", "parquet", structType(structField("struct", "struct<_1:string>"))))
        struct
      1      a
      ```
      
      R’s one is stricter because we are checking the types via regular expressions in R side ahead.
      
      Actual logics there look a bit different but as we check it ahead in R side, it looks replacing it would not introduce (I think) no behaviour changes. To make this sure, the tests dedicated for it were added in SPARK-20105. (It looks `structField` is the only place that calls this method).
      
      ## How was this patch tested?
      
      Existing tests - https://github.com/apache/spark/blob/master/R/pkg/inst/tests/testthat/test_sparkSQL.R#L143-L194 should cover this.
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #17785 from HyukjinKwon/SPARK-20493.
      70f1bcd7
  25. Apr 26, 2017
    • zero323's avatar
      [SPARK-20437][R] R wrappers for rollup and cube · df58a95a
      zero323 authored
      ## What changes were proposed in this pull request?
      
      - Add `rollup` and `cube` methods and corresponding generics.
      - Add short description to the vignette.
      
      ## How was this patch tested?
      
      - Existing unit tests.
      - Additional unit tests covering new features.
      - `check-cran.sh`.
      
      Author: zero323 <zero323@users.noreply.github.com>
      
      Closes #17728 from zero323/SPARK-20437.
      df58a95a
  26. Apr 24, 2017
    • zero323's avatar
      [SPARK-20438][R] SparkR wrappers for split and repeat · 8a272ddc
      zero323 authored
      ## What changes were proposed in this pull request?
      
      Add wrappers for `o.a.s.sql.functions`:
      
      - `split` as `split_string`
      - `repeat` as `repeat_string`
      
      ## How was this patch tested?
      
      Existing tests, additional unit tests, `check-cran.sh`
      
      Author: zero323 <zero323@users.noreply.github.com>
      
      Closes #17729 from zero323/SPARK-20438.
      8a272ddc
  27. Apr 21, 2017
    • zero323's avatar
      [SPARK-20371][R] Add wrappers for collect_list and collect_set · fd648bff
      zero323 authored
      ## What changes were proposed in this pull request?
      
      Adds wrappers for `collect_list` and `collect_set`.
      
      ## How was this patch tested?
      
      Unit tests, `check-cran.sh`
      
      Author: zero323 <zero323@users.noreply.github.com>
      
      Closes #17672 from zero323/SPARK-20371.
      fd648bff
  28. Apr 19, 2017
    • zero323's avatar
      [SPARK-20375][R] R wrappers for array and map · 46c57497
      zero323 authored
      ## What changes were proposed in this pull request?
      
      Adds wrappers for `o.a.s.sql.functions.array` and `o.a.s.sql.functions.map`
      
      ## How was this patch tested?
      
      Unit tests, `check-cran.sh`
      
      Author: zero323 <zero323@users.noreply.github.com>
      
      Closes #17674 from zero323/SPARK-20375.
      46c57497
  29. Apr 17, 2017
    • hyukjinkwon's avatar
      [SPARK-19828][R][FOLLOWUP] Rename asJsonArray to as.json.array in from_json function in R · 24f09b39
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      This was suggested to be `as.json.array` at the first place in the PR to SPARK-19828 but we could not do this as the lint check emits an error for multiple dots in the variable names.
      
      After SPARK-20278, now we are able to use `multiple.dots.in.names`. `asJsonArray` in `from_json` function is still able to be changed as 2.2 is not released yet.
      
      So, this PR proposes to rename `asJsonArray` to `as.json.array`.
      
      ## How was this patch tested?
      
      Jenkins tests, local tests with `./R/run-tests.sh` and manual `./dev/lint-r`. Existing tests should cover this.
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #17653 from HyukjinKwon/SPARK-19828-followup.
      24f09b39
  30. Apr 12, 2017
  31. Apr 06, 2017
  32. Apr 02, 2017
  33. Mar 27, 2017
  34. Mar 20, 2017
    • Wenchen Fan's avatar
      [SPARK-19949][SQL] unify bad record handling in CSV and JSON · 68d65fae
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      Currently JSON and CSV have exactly the same logic about handling bad records, this PR tries to abstract it and put it in a upper level to reduce code duplication.
      
      The overall idea is, we make the JSON and CSV parser to throw a BadRecordException, then the upper level, FailureSafeParser, handles bad records according to the parse mode.
      
      Behavior changes:
      1. with PERMISSIVE mode, if the number of tokens doesn't match the schema, previously CSV parser will treat it as a legal record and parse as many tokens as possible. After this PR, we treat it as an illegal record, and put the raw record string in a special column, but we still parse as many tokens as possible.
      2. all logging is removed as they are not very useful in practice.
      
      ## How was this patch tested?
      
      existing tests
      
      Author: Wenchen Fan <wenchen@databricks.com>
      Author: hyukjinkwon <gurwls223@gmail.com>
      Author: Wenchen Fan <cloud0fan@gmail.com>
      
      Closes #17315 from cloud-fan/bad-record2.
      68d65fae
    • Felix Cheung's avatar
      [SPARK-20020][SPARKR] DataFrame checkpoint API · c4059772
      Felix Cheung authored
      ## What changes were proposed in this pull request?
      
      Add checkpoint, setCheckpointDir API to R
      
      ## How was this patch tested?
      
      unit tests, manual tests
      
      Author: Felix Cheung <felixcheung_m@hotmail.com>
      
      Closes #17351 from felixcheung/rdfcheckpoint.
      c4059772
Loading