{"action":"closed","number":10380,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/10380","id":54107506,"html_url":"https://github.com/apache/spark/pull/10380","diff_url":"https://github.com/apache/spark/pull/10380.diff","patch_url":"https://github.com/apache/spark/pull/10380.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/10380","number":10380,"state":"closed","locked":false,"title":"[SPARK-12010][SQL] Spark JDBC requires support for column-name-free INSERT syntax","user":{"login":"CK50","id":15995721,"avatar_url":"https://avatars.githubusercontent.com/u/15995721?v=3","gravatar_id":"","url":"https://api.github.com/users/CK50","html_url":"https://github.com/CK50","followers_url":"https://api.github.com/users/CK50/followers","following_url":"https://api.github.com/users/CK50/following{/other_user}","gists_url":"https://api.github.com/users/CK50/gists{/gist_id}","starred_url":"https://api.github.com/users/CK50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CK50/subscriptions","organizations_url":"https://api.github.com/users/CK50/orgs","repos_url":"https://api.github.com/users/CK50/repos","events_url":"https://api.github.com/users/CK50/events{/privacy}","received_events_url":"https://api.github.com/users/CK50/received_events","type":"User","site_admin":false},"body":"In the past Spark JDBC write only worked with technologies which support the following INSERT statement syntax (JdbcUtils.scala: insertStatement()):\r\n\r\nINSERT INTO $table VALUES ( ?, ?, ..., ? )\r\n\r\nBut some technologies require a list of column names:\r\n\r\nINSERT INTO $table ( $colNameList ) VALUES ( ?, ?, ..., ? )\r\n\r\nThis was blocking the use of e.g. the Progress JDBC Driver for Cassandra.\r\n\r\nAnother limitation is that syntax 1 relies no the dataframe field ordering match that of the target table. This works fine, as long as the target table has been created by writer.jdbc().\r\n\r\nIf the target table contains more columns (not created by writer.jdbc()), then the insert fails due mismatch of number of columns or their data types.\r\n\r\nThis PR switches to the recommended second INSERT syntax. Column names are taken from datafram field names.","created_at":"2015-12-18T14:24:15Z","updated_at":"2015-12-24T13:40:28Z","closed_at":"2015-12-24T13:40:28Z","merged_at":null,"merge_commit_sha":"7358b1a974b40911ff69ea3d8b9a3c2b1d8d60b9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/10380/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/10380/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/10380/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/5a7f262cabff13316b1306a20dcc4d8d169458aa","head":{"label":"CK50:master-SPARK-12010-2","ref":"master-SPARK-12010-2","sha":"5a7f262cabff13316b1306a20dcc4d8d169458aa","user":{"login":"CK50","id":15995721,"avatar_url":"https://avatars.githubusercontent.com/u/15995721?v=3","gravatar_id":"","url":"https://api.github.com/users/CK50","html_url":"https://github.com/CK50","followers_url":"https://api.github.com/users/CK50/followers","following_url":"https://api.github.com/users/CK50/following{/other_user}","gists_url":"https://api.github.com/users/CK50/gists{/gist_id}","starred_url":"https://api.github.com/users/CK50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CK50/subscriptions","organizations_url":"https://api.github.com/users/CK50/orgs","repos_url":"https://api.github.com/users/CK50/repos","events_url":"https://api.github.com/users/CK50/events{/privacy}","received_events_url":"https://api.github.com/users/CK50/received_events","type":"User","site_admin":false},"repo":{"id":48227470,"name":"spark","full_name":"CK50/spark","owner":{"login":"CK50","id":15995721,"avatar_url":"https://avatars.githubusercontent.com/u/15995721?v=3","gravatar_id":"","url":"https://api.github.com/users/CK50","html_url":"https://github.com/CK50","followers_url":"https://api.github.com/users/CK50/followers","following_url":"https://api.github.com/users/CK50/following{/other_user}","gists_url":"https://api.github.com/users/CK50/gists{/gist_id}","starred_url":"https://api.github.com/users/CK50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CK50/subscriptions","organizations_url":"https://api.github.com/users/CK50/orgs","repos_url":"https://api.github.com/users/CK50/repos","events_url":"https://api.github.com/users/CK50/events{/privacy}","received_events_url":"https://api.github.com/users/CK50/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CK50/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/CK50/spark","forks_url":"https://api.github.com/repos/CK50/spark/forks","keys_url":"https://api.github.com/repos/CK50/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CK50/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CK50/spark/teams","hooks_url":"https://api.github.com/repos/CK50/spark/hooks","issue_events_url":"https://api.github.com/repos/CK50/spark/issues/events{/number}","events_url":"https://api.github.com/repos/CK50/spark/events","assignees_url":"https://api.github.com/repos/CK50/spark/assignees{/user}","branches_url":"https://api.github.com/repos/CK50/spark/branches{/branch}","tags_url":"https://api.github.com/repos/CK50/spark/tags","blobs_url":"https://api.github.com/repos/CK50/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CK50/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CK50/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/CK50/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CK50/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/CK50/spark/languages","stargazers_url":"https://api.github.com/repos/CK50/spark/stargazers","contributors_url":"https://api.github.com/repos/CK50/spark/contributors","subscribers_url":"https://api.github.com/repos/CK50/spark/subscribers","subscription_url":"https://api.github.com/repos/CK50/spark/subscription","commits_url":"https://api.github.com/repos/CK50/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/CK50/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/CK50/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/CK50/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/CK50/spark/contents/{+path}","compare_url":"https://api.github.com/repos/CK50/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CK50/spark/merges","archive_url":"https://api.github.com/repos/CK50/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CK50/spark/downloads","issues_url":"https://api.github.com/repos/CK50/spark/issues{/number}","pulls_url":"https://api.github.com/repos/CK50/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/CK50/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/CK50/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CK50/spark/labels{/name}","releases_url":"https://api.github.com/repos/CK50/spark/releases{/id}","created_at":"2015-12-18T09:50:35Z","updated_at":"2015-12-18T09:50:59Z","pushed_at":"2015-12-22T14:42:09Z","git_url":"git://github.com/CK50/spark.git","ssh_url":"git@github.com:CK50/spark.git","clone_url":"https://github.com/CK50/spark.git","svn_url":"https://github.com/CK50/spark","homepage":null,"size":137840,"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":"2bebaa39d9da33bc93ef682959cd42c1968a6a3e","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-12-24T09:49:31Z","pushed_at":"2015-12-24T13:39:06Z","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":395073,"stargazers_count":6690,"watchers_count":6690,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6195,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":406,"forks":6195,"open_issues":406,"watchers":6690,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/10380"},"html":{"href":"https://github.com/apache/spark/pull/10380"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/10380"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/10380/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/10380/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/10380/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/5a7f262cabff13316b1306a20dcc4d8d169458aa"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":11,"review_comments":10,"commits":7,"additions":4,"deletions":8,"changed_files":1}}