{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/5498","labels_url":"https://api.github.com/repos/apache/spark/issues/5498/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/5498/comments","events_url":"https://api.github.com/repos/apache/spark/issues/5498/events","html_url":"https://github.com/apache/spark/pull/5498","id":68202711,"number":5498,"title":"[SPARK-6888][SQL] Export driver quirks","user":{"login":"rtreffer","id":61306,"avatar_url":"https://avatars.githubusercontent.com/u/61306?v=3","gravatar_id":"","url":"https://api.github.com/users/rtreffer","html_url":"https://github.com/rtreffer","followers_url":"https://api.github.com/users/rtreffer/followers","following_url":"https://api.github.com/users/rtreffer/following{/other_user}","gists_url":"https://api.github.com/users/rtreffer/gists{/gist_id}","starred_url":"https://api.github.com/users/rtreffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtreffer/subscriptions","organizations_url":"https://api.github.com/users/rtreffer/orgs","repos_url":"https://api.github.com/users/rtreffer/repos","events_url":"https://api.github.com/users/rtreffer/events{/privacy}","received_events_url":"https://api.github.com/users/rtreffer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-13T21:50:10Z","updated_at":"2015-04-15T09:31:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/5498","html_url":"https://github.com/apache/spark/pull/5498","diff_url":"https://github.com/apache/spark/pull/5498.diff","patch_url":"https://github.com/apache/spark/pull/5498.patch"},"body":"Make it possible to (temporary) overwrite the driver quirks. This\r\ncan be used to overcome problems with specific schemas or to\r\nadd new jdbc driver support on the fly.\r\n\r\nA very simple implementation to dump the loading can be done like this (spark-shell)\r\n```\r\nclass DumpQuirk extends org.apache.spark.sql.jdbc.DriverQuirks {\r\n  def canHandle(url : String): Boolean = true\r\n  def getCatalystType(sqlType: Int, typeName: String, size: Int, md: org.apache.spark.sql.types.MetadataBuilder): org.apache.spark.sql.types.DataType = {\r\n    println(\"\" + (sqlType, typeName, size, md))\r\n    null\r\n  }\r\n  def getJDBCType(dt: org.apache.spark.sql.types.DataType): (String, Option[Int]) = (null, None)\r\n}\r\norg.apache.spark.sql.jdbc.DriverQuirks.registerQuirks(new DumpQuirk())\r\n```\r\n\r\nNot that this pull request is against 1.3 - I could not create a distribution with the current master."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/93282009","html_url":"https://github.com/apache/spark/pull/5498#issuecomment-93282009","issue_url":"https://api.github.com/repos/apache/spark/issues/5498","id":93282009,"user":{"login":"liancheng","id":230655,"avatar_url":"https://avatars.githubusercontent.com/u/230655?v=3","gravatar_id":"","url":"https://api.github.com/users/liancheng","html_url":"https://github.com/liancheng","followers_url":"https://api.github.com/users/liancheng/followers","following_url":"https://api.github.com/users/liancheng/following{/other_user}","gists_url":"https://api.github.com/users/liancheng/gists{/gist_id}","starred_url":"https://api.github.com/users/liancheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liancheng/subscriptions","organizations_url":"https://api.github.com/users/liancheng/orgs","repos_url":"https://api.github.com/users/liancheng/repos","events_url":"https://api.github.com/users/liancheng/events{/privacy}","received_events_url":"https://api.github.com/users/liancheng/received_events","type":"User","site_admin":false},"created_at":"2015-04-15T09:31:51Z","updated_at":"2015-04-15T09:31:51Z","body":"You may just add new commits to this PR. Also, would you please add tests for this feature?"}}