{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/41650794","id":41650794,"diff_hunk":"@@ -287,3 +288,30 @@ case object MsSqlServerDialect extends JdbcDialect {\n     case _ => None\n   }\n }\n+\n+/**\n+ * :: DeveloperApi ::\n+ * Default Apache Derby dialect, mapping real on read\n+ * and string/byte/short/boolean/decimal on write.\n+ */\n+@DeveloperApi\n+case object DerbyDialect extends JdbcDialect {\n+  override def canHandle(url: String): Boolean = url.startsWith(\"jdbc:derby\")\n+  override def getCatalystType(\n+      sqlType: Int, typeName: String, size: Int, md: MetadataBuilder): Option[DataType] = {\n+    if (sqlType == Types.REAL) Some(FloatType) else None","path":"sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala","position":23,"original_position":23,"commit_id":"e6022ed8825f92751b3df4ab1efab9b60c6d8d3c","original_commit_id":"e6022ed8825f92751b3df4ab1efab9b60c6d8d3c","user":{"login":"rick-ibm","id":14132002,"avatar_url":"https://avatars.githubusercontent.com/u/14132002?v=3","gravatar_id":"","url":"https://api.github.com/users/rick-ibm","html_url":"https://github.com/rick-ibm","followers_url":"https://api.github.com/users/rick-ibm/followers","following_url":"https://api.github.com/users/rick-ibm/following{/other_user}","gists_url":"https://api.github.com/users/rick-ibm/gists{/gist_id}","starred_url":"https://api.github.com/users/rick-ibm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rick-ibm/subscriptions","organizations_url":"https://api.github.com/users/rick-ibm/orgs","repos_url":"https://api.github.com/users/rick-ibm/repos","events_url":"https://api.github.com/users/rick-ibm/events{/privacy}","received_events_url":"https://api.github.com/users/rick-ibm/received_events","type":"User","site_admin":false},"body":"Thanks for the quick response, Michael. Should I adjust the other getCatalystType() overloads to follow the Option(...) pattern? I could do that as part of this pull-request or I could open another JIRA if you think that is worth doing. Thanks.","created_at":"2015-10-09T16:39:13Z","updated_at":"2015-10-09T16:39:13Z","html_url":"https://github.com/apache/spark/pull/8982#discussion_r41650794","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/8982","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/41650794"},"html":{"href":"https://github.com/apache/spark/pull/8982#discussion_r41650794"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/8982"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/8982","id":46806131,"html_url":"https://github.com/apache/spark/pull/8982","diff_url":"https://github.com/apache/spark/pull/8982.diff","patch_url":"https://github.com/apache/spark/pull/8982.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/8982","number":8982,"state":"open","locked":false,"title":"[SPARK-10855] [SQL] Add a JDBC dialect for Apache Derby","user":{"login":"rick-ibm","id":14132002,"avatar_url":"https://avatars.githubusercontent.com/u/14132002?v=3","gravatar_id":"","url":"https://api.github.com/users/rick-ibm","html_url":"https://github.com/rick-ibm","followers_url":"https://api.github.com/users/rick-ibm/followers","following_url":"https://api.github.com/users/rick-ibm/following{/other_user}","gists_url":"https://api.github.com/users/rick-ibm/gists{/gist_id}","starred_url":"https://api.github.com/users/rick-ibm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rick-ibm/subscriptions","organizations_url":"https://api.github.com/users/rick-ibm/orgs","repos_url":"https://api.github.com/users/rick-ibm/repos","events_url":"https://api.github.com/users/rick-ibm/events{/privacy}","received_events_url":"https://api.github.com/users/rick-ibm/received_events","type":"User","site_admin":false},"body":"@marmbrus\r\n@rxin\r\n\r\nThis patch adds a JdbcDialect class, which customizes the datatype mappings for Derby backends. The patch also adds unit tests for the new dialect, corresponding to the existing tests for other JDBC dialects.\r\n\r\nJDBCSuite runs cleanly for me with this patch. So does JDBCWriteSuite, although it produces noise as described here: https://issues.apache.org/jira/browse/SPARK-10890\r\n\r\nThis patch is my original work, which I license to the ASF. I am a Derby contributor, so my ICLA is on file under SVN id \"rhillegas\": http://people.apache.org/committer-index.html\r\n\r\nTouches the following files:\r\n\r\n---------------------------------\r\n\r\norg.apache.spark.sql.jdbc.JdbcDialects\r\n\r\nAdds a DerbyDialect.\r\n\r\n\r\n---------------------------------\r\n\r\norg.apache.spark.sql.jdbc.JDBCSuite\r\n\r\nAdds unit tests for the new DerbyDialect.\r\n","created_at":"2015-10-05T16:58:38Z","updated_at":"2015-10-09T16:39:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c576b72f04198959d34384270e5ff3930a154c76","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/8982/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/8982/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/8982/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/e6022ed8825f92751b3df4ab1efab9b60c6d8d3c","head":{"label":"rick-ibm:b_10855","ref":"b_10855","sha":"e6022ed8825f92751b3df4ab1efab9b60c6d8d3c","user":{"login":"rick-ibm","id":14132002,"avatar_url":"https://avatars.githubusercontent.com/u/14132002?v=3","gravatar_id":"","url":"https://api.github.com/users/rick-ibm","html_url":"https://github.com/rick-ibm","followers_url":"https://api.github.com/users/rick-ibm/followers","following_url":"https://api.github.com/users/rick-ibm/following{/other_user}","gists_url":"https://api.github.com/users/rick-ibm/gists{/gist_id}","starred_url":"https://api.github.com/users/rick-ibm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rick-ibm/subscriptions","organizations_url":"https://api.github.com/users/rick-ibm/orgs","repos_url":"https://api.github.com/users/rick-ibm/repos","events_url":"https://api.github.com/users/rick-ibm/events{/privacy}","received_events_url":"https://api.github.com/users/rick-ibm/received_events","type":"User","site_admin":false},"repo":{"id":41940983,"name":"spark","full_name":"rick-ibm/spark","owner":{"login":"rick-ibm","id":14132002,"avatar_url":"https://avatars.githubusercontent.com/u/14132002?v=3","gravatar_id":"","url":"https://api.github.com/users/rick-ibm","html_url":"https://github.com/rick-ibm","followers_url":"https://api.github.com/users/rick-ibm/followers","following_url":"https://api.github.com/users/rick-ibm/following{/other_user}","gists_url":"https://api.github.com/users/rick-ibm/gists{/gist_id}","starred_url":"https://api.github.com/users/rick-ibm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rick-ibm/subscriptions","organizations_url":"https://api.github.com/users/rick-ibm/orgs","repos_url":"https://api.github.com/users/rick-ibm/repos","events_url":"https://api.github.com/users/rick-ibm/events{/privacy}","received_events_url":"https://api.github.com/users/rick-ibm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rick-ibm/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/rick-ibm/spark","forks_url":"https://api.github.com/repos/rick-ibm/spark/forks","keys_url":"https://api.github.com/repos/rick-ibm/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rick-ibm/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rick-ibm/spark/teams","hooks_url":"https://api.github.com/repos/rick-ibm/spark/hooks","issue_events_url":"https://api.github.com/repos/rick-ibm/spark/issues/events{/number}","events_url":"https://api.github.com/repos/rick-ibm/spark/events","assignees_url":"https://api.github.com/repos/rick-ibm/spark/assignees{/user}","branches_url":"https://api.github.com/repos/rick-ibm/spark/branches{/branch}","tags_url":"https://api.github.com/repos/rick-ibm/spark/tags","blobs_url":"https://api.github.com/repos/rick-ibm/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rick-ibm/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rick-ibm/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/rick-ibm/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rick-ibm/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/rick-ibm/spark/languages","stargazers_url":"https://api.github.com/repos/rick-ibm/spark/stargazers","contributors_url":"https://api.github.com/repos/rick-ibm/spark/contributors","subscribers_url":"https://api.github.com/repos/rick-ibm/spark/subscribers","subscription_url":"https://api.github.com/repos/rick-ibm/spark/subscription","commits_url":"https://api.github.com/repos/rick-ibm/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/rick-ibm/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/rick-ibm/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/rick-ibm/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/rick-ibm/spark/contents/{+path}","compare_url":"https://api.github.com/repos/rick-ibm/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rick-ibm/spark/merges","archive_url":"https://api.github.com/repos/rick-ibm/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rick-ibm/spark/downloads","issues_url":"https://api.github.com/repos/rick-ibm/spark/issues{/number}","pulls_url":"https://api.github.com/repos/rick-ibm/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/rick-ibm/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/rick-ibm/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rick-ibm/spark/labels{/name}","releases_url":"https://api.github.com/repos/rick-ibm/spark/releases{/id}","created_at":"2015-09-04T22:49:34Z","updated_at":"2015-09-04T22:49:56Z","pushed_at":"2015-10-09T16:07:48Z","git_url":"git://github.com/rick-ibm/spark.git","ssh_url":"git@github.com:rick-ibm/spark.git","clone_url":"https://github.com/rick-ibm/spark.git","svn_url":"https://github.com/rick-ibm/spark","homepage":null,"size":126399,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"5994cfe81271a39294aa29fd47aa94c99aa56743","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2015-10-09T15:41:47Z","pushed_at":"2015-10-09T16:36:56Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":1630332,"stargazers_count":5709,"watchers_count":5709,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5296,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":343,"forks":5296,"open_issues":343,"watchers":5709,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/8982"},"html":{"href":"https://github.com/apache/spark/pull/8982"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/8982"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/8982/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/8982/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/8982/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/e6022ed8825f92751b3df4ab1efab9b60c6d8d3c"}}}}