{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/11108","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/11108/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/11108/comments","events_url":"https://api.github.com/repos/apache/spark/issues/11108/events","html_url":"https://github.com/apache/spark/pull/11108","id":131946190,"number":11108,"title":"[SPARK-13019][Docs] Replace example code in mllib-statistics.md using include_example","user":{"login":"keypointt","id":3925641,"avatar_url":"https://avatars.githubusercontent.com/u/3925641?v=3","gravatar_id":"","url":"https://api.github.com/users/keypointt","html_url":"https://github.com/keypointt","followers_url":"https://api.github.com/users/keypointt/followers","following_url":"https://api.github.com/users/keypointt/following{/other_user}","gists_url":"https://api.github.com/users/keypointt/gists{/gist_id}","starred_url":"https://api.github.com/users/keypointt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keypointt/subscriptions","organizations_url":"https://api.github.com/users/keypointt/orgs","repos_url":"https://api.github.com/users/keypointt/repos","events_url":"https://api.github.com/users/keypointt/events{/privacy}","received_events_url":"https://api.github.com/users/keypointt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":28,"created_at":"2016-02-07T07:25:30Z","updated_at":"2016-03-22T00:45:54Z","closed_at":"2016-03-21T23:11:19Z","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/11108","html_url":"https://github.com/apache/spark/pull/11108","diff_url":"https://github.com/apache/spark/pull/11108.diff","patch_url":"https://github.com/apache/spark/pull/11108.patch"},"body":"https://issues.apache.org/jira/browse/SPARK-13019\r\n\r\nThe example code in the user guide is embedded in the markdown and hence it is not easy to test. It would be nice to automatically test them. This JIRA is to discuss options to automate example code testing and see what we can do in Spark 1.6.\r\n\r\nGoal is to move actual example code to spark/examples and test compilation in Jenkins builds. Then in the markdown, we can reference part of the code to show in the user guide. This requires adding a Jekyll tag that is similar to https://github.com/jekyll/jekyll/blob/master/lib/jekyll/tags/include.rb, e.g., called include_example.\r\n`{% include_example scala/org/apache/spark/examples/mllib/SummaryStatisticsExample.scala %}`\r\nJekyll will find `examples/src/main/scala/org/apache/spark/examples/mllib/SummaryStatisticsExample.scala` and pick code blocks marked \"example\" and replace code block in \r\n`{% highlight %}`\r\n in the markdown. \r\n\r\nSee more sub-tasks in parent ticket: https://issues.apache.org/jira/browse/SPARK-11337"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/199563705","html_url":"https://github.com/apache/spark/pull/11108#issuecomment-199563705","issue_url":"https://api.github.com/repos/apache/spark/issues/11108","id":199563705,"user":{"login":"mengxr","id":829644,"avatar_url":"https://avatars.githubusercontent.com/u/829644?v=3","gravatar_id":"","url":"https://api.github.com/users/mengxr","html_url":"https://github.com/mengxr","followers_url":"https://api.github.com/users/mengxr/followers","following_url":"https://api.github.com/users/mengxr/following{/other_user}","gists_url":"https://api.github.com/users/mengxr/gists{/gist_id}","starred_url":"https://api.github.com/users/mengxr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mengxr/subscriptions","organizations_url":"https://api.github.com/users/mengxr/orgs","repos_url":"https://api.github.com/users/mengxr/repos","events_url":"https://api.github.com/users/mengxr/events{/privacy}","received_events_url":"https://api.github.com/users/mengxr/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T00:45:54Z","updated_at":"2016-03-22T00:45:54Z","body":"I reverted the change in master to unblock other builds. @keypointt Could you test it on Scala 2.10? It seems that Scala 2.10 doesn't resolve keyword arguments nicely:\r\n\r\n~~~scala\r\ndef f(a: String, b: String, c: String = \"xxx\") = {\r\n  println(a, b, c)\r\n}\r\n\r\nf(a = \"abc\", \"def\")\r\n<console>:34: error: not enough arguments for method f: (a: String, b: String, c: String)Unit.\r\nUnspecified value parameter b.\r\n              f(a = \"abc\", \"def\")\r\n~~~\r\n\r\nWe should either fix the seed or use keyword argument for `fractions`."}}