Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-12327

lint-r checks fail with commented code

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.1, 2.0.0
    • Component/s: SparkR
    • Labels:
      None

      Description

      We get this after our R version downgrade

      R/RDD.R:183:68: style: Commented code should be removed.
                  rdd@env$jrdd_val <- callJMethod(rddRef, "asJavaRDD") # rddRef$asJavaRDD()
                                                                         ^~~~~~~~~~~~~~~~~~
      R/RDD.R:228:63: style: Commented code should be removed.
      #' http://spark.apache.org/docs/latest/programming-guide.html#rdd-persistence.
                                                                    ^~~~~~~~~~~~~~~~
      R/RDD.R:388:24: style: Commented code should be removed.
      #' collectAsMap(rdd) # list(`1` = 2, `3` = 4)
                             ^~~~~~~~~~~~~~~~~~~~~~
      R/RDD.R:603:61: style: Commented code should be removed.
      #' unlist(collect(filterRDD(rdd, function (x) { x < 3 }))) # c(1, 2)
                                                                  ^~~~~~~~
      R/RDD.R:762:20: style: Commented code should be removed.
      #' take(rdd, 2L) # list(1, 2)
                         ^~~~~~~~~~
      R/RDD.R:830:42: style: Commented code should be removed.
      #' sort(unlist(collect(distinct(rdd)))) # c(1, 2, 3)
                                               ^~~~~~~~~~~
      R/RDD.R:980:47: style: Commented code should be removed.
      #' collect(keyBy(rdd, function(x) { x*x })) # list(list(1, 1), list(4, 2), list(9, 3))
                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/RDD.R:1194:27: style: Commented code should be removed.
      #' takeOrdered(rdd, 6L) # list(1, 2, 3, 4, 5, 6)
                                ^~~~~~~~~~~~~~~~~~~~~~
      R/RDD.R:1215:19: style: Commented code should be removed.
      #' top(rdd, 6L) # list(10, 9, 7, 6, 5, 4)
                        ^~~~~~~~~~~~~~~~~~~~~~~
      R/RDD.R:1270:50: style: Commented code should be removed.
      #' aggregateRDD(rdd, zeroValue, seqOp, combOp) # list(10, 4)
                                                       ^~~~~~~~~~~
      R/RDD.R:1374:6: style: Commented code should be removed.
      #' # list(list("a", 0), list("b", 3), list("c", 1), list("d", 4), list("e", 2))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/RDD.R:1415:6: style: Commented code should be removed.
      #' # list(list("a", 0), list("b", 1), list("c", 2), list("d", 3), list("e", 4))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/RDD.R:1461:6: style: Commented code should be removed.
      #' # list(list(1, 2), list(3, 4))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/RDD.R:1527:6: style: Commented code should be removed.
      #' # list(list(0, 1000), list(1, 1001), list(2, 1002), list(3, 1003), list(4, 1004))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/RDD.R:1564:6: style: Commented code should be removed.
      #' # list(list(1, 1), list(1, 2), list(2, 1), list(2, 2))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/RDD.R:1595:6: style: Commented code should be removed.
      #' # list(1, 1, 3)
           ^~~~~~~~~~~~~
      R/RDD.R:1627:6: style: Commented code should be removed.
      #' # list(1, 2, 3)
           ^~~~~~~~~~~~~
      R/RDD.R:1663:6: style: Commented code should be removed.
      #' # list(list(1, c(1,2), c(1,2,3)), list(2, c(3,4), c(4,5,6)))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/deserialize.R:22:3: style: Commented code should be removed.
      # void -> NULL
        ^~~~~~~~~~~~
      R/deserialize.R:23:3: style: Commented code should be removed.
      # Int -> integer
        ^~~~~~~~~~~~~~
      R/deserialize.R:24:3: style: Commented code should be removed.
      # String -> character
        ^~~~~~~~~~~~~~~~~~~
      R/deserialize.R:25:3: style: Commented code should be removed.
      # Boolean -> logical
        ^~~~~~~~~~~~~~~~~~
      R/deserialize.R:26:3: style: Commented code should be removed.
      # Float -> double
        ^~~~~~~~~~~~~~~
      R/deserialize.R:27:3: style: Commented code should be removed.
      # Double -> double
        ^~~~~~~~~~~~~~~~
      R/deserialize.R:28:3: style: Commented code should be removed.
      # Long -> double
        ^~~~~~~~~~~~~~
      R/deserialize.R:29:3: style: Commented code should be removed.
      # Array[Byte] -> raw
        ^~~~~~~~~~~~~~~~~~
      R/deserialize.R:30:3: style: Commented code should be removed.
      # Date -> Date
        ^~~~~~~~~~~~
      R/deserialize.R:31:3: style: Commented code should be removed.
      # Time -> POSIXct
        ^~~~~~~~~~~~~~~
      R/deserialize.R:33:3: style: Commented code should be removed.
      # Array[T] -> list()
        ^~~~~~~~~~~~~~~~~~
      R/deserialize.R:34:3: style: Commented code should be removed.
      # Object -> jobj
        ^~~~~~~~~~~~~~
      R/pairRDD.R:37:21: style: Commented code should be removed.
      #' lookup(rdd, 1) # list(1, 3)
                          ^~~~~~~~~~
      R/pairRDD.R:83:25: style: Commented code should be removed.
      #' collect(keys(rdd)) # list(1, 3)
                              ^~~~~~~~~~
      R/pairRDD.R:104:27: style: Commented code should be removed.
      #' collect(values(rdd)) # list(2, 4)
                                ^~~~~~~~~~
      R/pairRDD.R:356:14: style: Commented code should be removed.
      #' reduced # list(list(1, 6), list(1.1, 3))
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/pairRDD.R:483:8: style: Commented code should be removed.
      #'   # list(list(1, list(3, 2)), list(2, list(7, 2)))
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/pairRDD.R:515:33: style: Commented code should be removed.
      #' foldByKey(rdd, 0, "+", 2L) # list(list(1, 3), list(2, 7))
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/pairRDD.R:586:6: style: Commented code should be removed.
      #' # list(list(1, list(1, 2)), list(1, list(1, 3)), list(2, list(4, NULL)))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/pairRDD.R:624:6: style: Commented code should be removed.
      #' # list(list(1, list(2, 1)), list(1, list(3, 1)), list(2, list(NULL, 4)))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/pairRDD.R:746:30: style: Commented code should be removed.
      #' collect(sortByKey(rdd)) # list (list(1, 3), list(2, 2), list(3, 1))
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/pairRDD.R:814:6: style: Commented code should be removed.
      #' # list(list("b", 4), list("b", 5))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      R/serialize.R:22:3: style: Commented code should be removed.
      # NULL -> Void
        ^~~~~~~~~~~~
      R/serialize.R:23:3: style: Commented code should be removed.
      # integer -> Int
        ^~~~~~~~~~~~~~
      R/serialize.R:24:3: style: Commented code should be removed.
      # character -> String
        ^~~~~~~~~~~~~~~~~~~
      R/serialize.R:25:3: style: Commented code should be removed.
      # logical -> Boolean
        ^~~~~~~~~~~~~~~~~~
      R/serialize.R:27:3: style: Commented code should be removed.
      # raw -> Array[Byte]
        ^~~~~~~~~~~~~~~~~~
      R/serialize.R:28:3: style: Commented code should be removed.
      # Date -> Date
        ^~~~~~~~~~~~
      inst/tests/testthat/test_rdd.R:226:7: style: Commented code should be removed.
          # got < 100
            ^~~~~~~~~
      inst/tests/testthat/test_rdd.R:233:7: style: Commented code should be removed.
          # got < 100
            ^~~~~~~~~
      inst/tests/testthat/test_shuffle.R:179:56: style: Commented code should be removed.
        expected_first <- list(list(1, 100), list(2, 200)) # key < 3
                                                             ^~~~~~~
      inst/tests/testthat/test_shuffle.R:180:66: style: Commented code should be removed.
        expected_second <- list(list(4, -1), list(3, 1), list(3, 0)) # key >= 3
                                                                       ^~~~~~~~
      inst/tests/testthat/test_sparkSQL.R:468:4: style: Commented code should be removed.
        #a <- letters[1:3]
         ^~~~~~~~~~~~~~~~~
      inst/tests/testthat/test_sparkSQL.R:469:4: style: Commented code should be removed.
        #expect_equal(class(table(a, sample(a))), "table")
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      inst/tests/testthat/test_sparkSQL.R:736:4: style: Commented code should be removed.
        #expect_equal(length(sample(1:12)), 12)
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      inst/tests/testthat/test_sparkSQL.R:1046:53: style: Commented code should be removed.
        expect_equal(collect(select(df2, lpad(df2$a, 8, "#")))[1, 1], "###aaads")
                                                          ^~~~~~~~~~~~~~~~~~~~~~~
      inst/tests/testthat/test_sparkSQL.R:1245:4: style: Commented code should be removed.
        #expect_true(is.ts(filter(1:100, rep(1, 3))))
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      inst/tests/testthat/test_sparkSQL.R:1636:4: style: Commented code should be removed.
        #expect_true(abs(max(cov(swiss)) - 1739.295) < 1e-3)
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      inst/tests/testthat/test_utils.R:98:5: style: Commented code should be removed.
        # expect_equal(length(ls(env)), 3)  # Only "g", "l" and "f". No "base", "field" or "defUse".
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Warning message:
      In "\t" %>% one_or_more() : bytecode version mismatch; using eval
      

        Attachments

          Activity

            People

            • Assignee:
              felixcheung Felix Cheung
              Reporter:
              shivaram Shivaram Venkataraman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: