{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-carbondata/pulls/comments/83350489","pull_request_review_id":4200706,"id":83350489,"diff_hunk":"@@ -55,18 +55,11 @@ class CarbonSource extends RelationProvider\n   override def createRelation(\n       sqlContext: SQLContext,\n       parameters: Map[String, String]): BaseRelation = {\n-    // if path is provided we can directly create Hadoop relation. \\\n-    // Otherwise create datasource relation\n-    parameters.get(\"path\") match {\n-      case Some(path) => CarbonDatasourceHadoopRelation(sqlContext, Array(path), parameters, None)\n-      case _ =>\n-        val options = new CarbonOption(parameters)\n-        val tableIdentifier = options.tableIdentifier.split(\"\"\"\\.\"\"\").toSeq\n-        val identifier = tableIdentifier match {\n-          case Seq(name) => TableIdentifier(name, None)\n-          case Seq(db, name) => TableIdentifier(name, Some(db))\n-        }\n-        CarbonDatasourceRelation(identifier, None)(sqlContext)\n+    val options = new CarbonOption(parameters)\n+    if (sqlContext.isInstanceOf[CarbonContext]) {","path":"integration/spark/src/main/scala/org/apache/spark/sql/CarbonDatasourceRelation.scala","position":26,"original_position":26,"commit_id":"03aed7dbf7ad097ec13588a4ce350ff95a10a401","original_commit_id":"03aed7dbf7ad097ec13588a4ce350ff95a10a401","user":{"login":"ravipesala","id":8134086,"avatar_url":"https://avatars.githubusercontent.com/u/8134086?v=3","gravatar_id":"","url":"https://api.github.com/users/ravipesala","html_url":"https://github.com/ravipesala","followers_url":"https://api.github.com/users/ravipesala/followers","following_url":"https://api.github.com/users/ravipesala/following{/other_user}","gists_url":"https://api.github.com/users/ravipesala/gists{/gist_id}","starred_url":"https://api.github.com/users/ravipesala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravipesala/subscriptions","organizations_url":"https://api.github.com/users/ravipesala/orgs","repos_url":"https://api.github.com/users/ravipesala/repos","events_url":"https://api.github.com/users/ravipesala/events{/privacy}","received_events_url":"https://api.github.com/users/ravipesala/received_events","type":"User","site_admin":false},"body":"Ok, got it. You have added `path` in `options` while creating datasource table to make it work. ","created_at":"2016-10-14T02:48:25Z","updated_at":"2016-10-14T02:48:25Z","html_url":"https://github.com/apache/incubator-carbondata/pull/212#discussion_r83350489","pull_request_url":"https://api.github.com/repos/apache/incubator-carbondata/pulls/212","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-carbondata/pulls/comments/83350489"},"html":{"href":"https://github.com/apache/incubator-carbondata/pull/212#discussion_r83350489"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-carbondata/pulls/212"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-carbondata/pulls/212","id":87961501,"html_url":"https://github.com/apache/incubator-carbondata/pull/212","diff_url":"https://github.com/apache/incubator-carbondata/pull/212.diff","patch_url":"https://github.com/apache/incubator-carbondata/pull/212.patch","issue_url":"https://api.github.com/repos/apache/incubator-carbondata/issues/212","number":212,"state":"open","locked":false,"title":"[CARBONDATA-285] Use path parameter in Spark datasource API","user":{"login":"jackylk","id":6500698,"avatar_url":"https://avatars.githubusercontent.com/u/6500698?v=3","gravatar_id":"","url":"https://api.github.com/users/jackylk","html_url":"https://github.com/jackylk","followers_url":"https://api.github.com/users/jackylk/followers","following_url":"https://api.github.com/users/jackylk/following{/other_user}","gists_url":"https://api.github.com/users/jackylk/gists{/gist_id}","starred_url":"https://api.github.com/users/jackylk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackylk/subscriptions","organizations_url":"https://api.github.com/users/jackylk/orgs","repos_url":"https://api.github.com/users/jackylk/repos","events_url":"https://api.github.com/users/jackylk/events{/privacy}","received_events_url":"https://api.github.com/users/jackylk/received_events","type":"User","site_admin":false},"body":"Currently, when using carbon with spark datasource API, it need to give database name and table name as parameter, it is not the normal way of datasource API usage. In this PR, database name and table name is not required to give, user need to specify the `path` parameter (indicating the path to table folder) only when using datasource API\r\n\r\nbefore:\r\n```\r\ndf.write\r\n   .format(\"carbondata\")\r\n   .option(\"tableName\", tableName)\r\n   .mode(SaveMode.Overwrite)\r\n   .save()\r\n```\r\n\r\nafter:\r\n```\r\ndf.write\r\n   .format(\"carbondata\")\r\n   .mode(SaveMode.Overwrite)\r\n   .save(\"store_path/default/table_name\")\r\n```\r\n\r\nThe same for read interface.","created_at":"2016-10-04T19:48:59Z","updated_at":"2016-10-14T02:48:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"509b1ea4c9cc1fd62d39ff06c14f94986667b96b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-carbondata/pulls/212/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-carbondata/pulls/212/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-carbondata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-carbondata/issues/212/comments","statuses_url":"https://api.github.com/repos/apache/incubator-carbondata/statuses/03aed7dbf7ad097ec13588a4ce350ff95a10a401","head":{"label":"jackylk:use-path-only","ref":"use-path-only","sha":"03aed7dbf7ad097ec13588a4ce350ff95a10a401","user":{"login":"jackylk","id":6500698,"avatar_url":"https://avatars.githubusercontent.com/u/6500698?v=3","gravatar_id":"","url":"https://api.github.com/users/jackylk","html_url":"https://github.com/jackylk","followers_url":"https://api.github.com/users/jackylk/followers","following_url":"https://api.github.com/users/jackylk/following{/other_user}","gists_url":"https://api.github.com/users/jackylk/gists{/gist_id}","starred_url":"https://api.github.com/users/jackylk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackylk/subscriptions","organizations_url":"https://api.github.com/users/jackylk/orgs","repos_url":"https://api.github.com/users/jackylk/repos","events_url":"https://api.github.com/users/jackylk/events{/privacy}","received_events_url":"https://api.github.com/users/jackylk/received_events","type":"User","site_admin":false},"repo":{"id":62279476,"name":"incubator-carbondata","full_name":"jackylk/incubator-carbondata","owner":{"login":"jackylk","id":6500698,"avatar_url":"https://avatars.githubusercontent.com/u/6500698?v=3","gravatar_id":"","url":"https://api.github.com/users/jackylk","html_url":"https://github.com/jackylk","followers_url":"https://api.github.com/users/jackylk/followers","following_url":"https://api.github.com/users/jackylk/following{/other_user}","gists_url":"https://api.github.com/users/jackylk/gists{/gist_id}","starred_url":"https://api.github.com/users/jackylk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackylk/subscriptions","organizations_url":"https://api.github.com/users/jackylk/orgs","repos_url":"https://api.github.com/users/jackylk/repos","events_url":"https://api.github.com/users/jackylk/events{/privacy}","received_events_url":"https://api.github.com/users/jackylk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jackylk/incubator-carbondata","description":"Mirror of Apache CarbonData (Incubating)","fork":true,"url":"https://api.github.com/repos/jackylk/incubator-carbondata","forks_url":"https://api.github.com/repos/jackylk/incubator-carbondata/forks","keys_url":"https://api.github.com/repos/jackylk/incubator-carbondata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jackylk/incubator-carbondata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jackylk/incubator-carbondata/teams","hooks_url":"https://api.github.com/repos/jackylk/incubator-carbondata/hooks","issue_events_url":"https://api.github.com/repos/jackylk/incubator-carbondata/issues/events{/number}","events_url":"https://api.github.com/repos/jackylk/incubator-carbondata/events","assignees_url":"https://api.github.com/repos/jackylk/incubator-carbondata/assignees{/user}","branches_url":"https://api.github.com/repos/jackylk/incubator-carbondata/branches{/branch}","tags_url":"https://api.github.com/repos/jackylk/incubator-carbondata/tags","blobs_url":"https://api.github.com/repos/jackylk/incubator-carbondata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jackylk/incubator-carbondata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jackylk/incubator-carbondata/git/refs{/sha}","trees_url":"https://api.github.com/repos/jackylk/incubator-carbondata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jackylk/incubator-carbondata/statuses/{sha}","languages_url":"https://api.github.com/repos/jackylk/incubator-carbondata/languages","stargazers_url":"https://api.github.com/repos/jackylk/incubator-carbondata/stargazers","contributors_url":"https://api.github.com/repos/jackylk/incubator-carbondata/contributors","subscribers_url":"https://api.github.com/repos/jackylk/incubator-carbondata/subscribers","subscription_url":"https://api.github.com/repos/jackylk/incubator-carbondata/subscription","commits_url":"https://api.github.com/repos/jackylk/incubator-carbondata/commits{/sha}","git_commits_url":"https://api.github.com/repos/jackylk/incubator-carbondata/git/commits{/sha}","comments_url":"https://api.github.com/repos/jackylk/incubator-carbondata/comments{/number}","issue_comment_url":"https://api.github.com/repos/jackylk/incubator-carbondata/issues/comments{/number}","contents_url":"https://api.github.com/repos/jackylk/incubator-carbondata/contents/{+path}","compare_url":"https://api.github.com/repos/jackylk/incubator-carbondata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jackylk/incubator-carbondata/merges","archive_url":"https://api.github.com/repos/jackylk/incubator-carbondata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jackylk/incubator-carbondata/downloads","issues_url":"https://api.github.com/repos/jackylk/incubator-carbondata/issues{/number}","pulls_url":"https://api.github.com/repos/jackylk/incubator-carbondata/pulls{/number}","milestones_url":"https://api.github.com/repos/jackylk/incubator-carbondata/milestones{/number}","notifications_url":"https://api.github.com/repos/jackylk/incubator-carbondata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jackylk/incubator-carbondata/labels{/name}","releases_url":"https://api.github.com/repos/jackylk/incubator-carbondata/releases{/id}","deployments_url":"https://api.github.com/repos/jackylk/incubator-carbondata/deployments","created_at":"2016-06-30T04:32:26Z","updated_at":"2016-06-30T04:32:30Z","pushed_at":"2016-10-13T17:39:10Z","git_url":"git://github.com/jackylk/incubator-carbondata.git","ssh_url":"git@github.com:jackylk/incubator-carbondata.git","clone_url":"https://github.com/jackylk/incubator-carbondata.git","svn_url":"https://github.com/jackylk/incubator-carbondata","homepage":null,"size":38231,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"1cf43a1560b0f236ba48c399ee082997d7c3a715","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":62117818,"name":"incubator-carbondata","full_name":"apache/incubator-carbondata","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/incubator-carbondata","description":"Mirror of Apache CarbonData (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-carbondata","forks_url":"https://api.github.com/repos/apache/incubator-carbondata/forks","keys_url":"https://api.github.com/repos/apache/incubator-carbondata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-carbondata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-carbondata/teams","hooks_url":"https://api.github.com/repos/apache/incubator-carbondata/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-carbondata/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-carbondata/events","assignees_url":"https://api.github.com/repos/apache/incubator-carbondata/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-carbondata/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-carbondata/tags","blobs_url":"https://api.github.com/repos/apache/incubator-carbondata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-carbondata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-carbondata/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-carbondata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-carbondata/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-carbondata/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-carbondata/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-carbondata/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-carbondata/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-carbondata/subscription","commits_url":"https://api.github.com/repos/apache/incubator-carbondata/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-carbondata/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-carbondata/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-carbondata/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-carbondata/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-carbondata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-carbondata/merges","archive_url":"https://api.github.com/repos/apache/incubator-carbondata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-carbondata/downloads","issues_url":"https://api.github.com/repos/apache/incubator-carbondata/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-carbondata/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-carbondata/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-carbondata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-carbondata/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-carbondata/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-carbondata/deployments","created_at":"2016-06-28T07:00:06Z","updated_at":"2016-10-12T01:48:15Z","pushed_at":"2016-10-13T18:44:09Z","git_url":"git://github.com/apache/incubator-carbondata.git","ssh_url":"git@github.com:apache/incubator-carbondata.git","clone_url":"https://github.com/apache/incubator-carbondata.git","svn_url":"https://github.com/apache/incubator-carbondata","homepage":null,"size":39819,"stargazers_count":124,"watchers_count":124,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":120,"mirror_url":"git://git.apache.org/incubator-carbondata.git","open_issues_count":36,"forks":120,"open_issues":36,"watchers":124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-carbondata/pulls/212"},"html":{"href":"https://github.com/apache/incubator-carbondata/pull/212"},"issue":{"href":"https://api.github.com/repos/apache/incubator-carbondata/issues/212"},"comments":{"href":"https://api.github.com/repos/apache/incubator-carbondata/issues/212/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-carbondata/pulls/212/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-carbondata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-carbondata/pulls/212/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-carbondata/statuses/03aed7dbf7ad097ec13588a4ce350ff95a10a401"}}}}
{"actor":{"display_login":"ravipesala"}}