You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by vinodkc <gi...@git.apache.org> on 2017/04/01 17:05:30 UTC

[GitHub] incubator-carbondata pull request #720: [CARBONDATA-642] Delete Subquery is ...

GitHub user vinodkc opened a pull request:

    https://github.com/apache/incubator-carbondata/pull/720

    [CARBONDATA-642] Delete Subquery is not working while creating and loading 2 tables

    
    
    This PR handles following problem
    **Problem**: In carbon delete statement, JOIN is not  supported to delete using 2 or more tables.
    **Analysis**: Carbon delete query parsing is failing, when JOIN existing in delete query. For example \u2018DELETE FROM Table1 t1 INNER JOIN Table2 t2 ON t1.ID = t2.ID;\u2019
    **Solution**: Change the parser logic of delete statement to support all valid delete statements [including joins]
    
    
            - new unit test case added 
            - Manual testing done
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/vinodkc/incubator-carbondata Br_CARBONDATA-642

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-carbondata/pull/720.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #720
    
----
commit 178b24df6ecf8da5ce8c6a963449ff6fb53139fb
Author: Vinod K C <vk...@hortonworks.com>
Date:   2017-04-01T16:59:15Z

    Problem: In carbon delete statement, JOIN is not  supported to delete using 2 or more tables.
    Analysis: Carbon delete query parsing is failing, when JOIN existing in delete query. For example \u2018DELETE FROM Table1 t1 INNER JOIN Table2 t2 ON t1.ID = t2.ID;\u2019
    Solution: Change the parser logic of delete statement to support all valid delete statements [including joins]

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata issue #720: [CARBONDATA-642] Delete Subquery is not wor...

Posted by vinodkc <gi...@git.apache.org>.
Github user vinodkc commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/720
  
    @gvramana Please review this code


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata issue #720: [CARBONDATA-642] Delete Subquery is not wor...

Posted by vinodkc <gi...@git.apache.org>.
Github user vinodkc commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/720
  
    Can someone handle this PR?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata issue #720: [CARBONDATA-642] Delete Subquery is not wor...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/720
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #720: [CARBONDATA-642] Delete Subquery is ...

Posted by vinodkc <gi...@git.apache.org>.
Github user vinodkc commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/720#discussion_r110815691
  
    --- Diff: integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/iud/DeleteCarbonTableTestCase.scala ---
    @@ -81,6 +81,18 @@ class DeleteCarbonTableTestCase extends QueryTest with BeforeAndAfterAll {
           Seq()
         )
       }
    +
    +  test("delete data from  carbon table[ JOIN with another table ]") {
    +    sql("""drop table if exists iud_db.dest""")
    +    sql("""create table iud_db.dest (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""").show()
    +    sql(s"""LOAD DATA LOCAL INPATH '$resourcesPath/IUD/dest.csv' INTO table iud_db.dest""")
    +    sql(""" DELETE FROM dest t1 INNER JOIN source2 t2 ON t1.c1 = t2.c11""").show(truncate = false)
    +    checkAnswer(
    +      sql("""select c1 from iud_db.dest"""),
    +      Seq(Row("c"), Row("d"), Row("e"))
    +    )
    +  }
    +
     //  test("delete data from  carbon table[where IN (sub query) ]") {
    --- End diff --
    
    @jackylk , I've not commented any testcases. Just added a new test case line # 84 to 95


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #720: [CARBONDATA-642] Delete Subquery is ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-carbondata/pull/720


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata pull request #720: [CARBONDATA-642] Delete Subquery is ...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/720#discussion_r110800149
  
    --- Diff: integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/iud/DeleteCarbonTableTestCase.scala ---
    @@ -81,6 +81,18 @@ class DeleteCarbonTableTestCase extends QueryTest with BeforeAndAfterAll {
           Seq()
         )
       }
    +
    +  test("delete data from  carbon table[ JOIN with another table ]") {
    +    sql("""drop table if exists iud_db.dest""")
    +    sql("""create table iud_db.dest (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""").show()
    +    sql(s"""LOAD DATA LOCAL INPATH '$resourcesPath/IUD/dest.csv' INTO table iud_db.dest""")
    +    sql(""" DELETE FROM dest t1 INNER JOIN source2 t2 ON t1.c1 = t2.c11""").show(truncate = false)
    +    checkAnswer(
    +      sql("""select c1 from iud_db.dest"""),
    +      Seq(Row("c"), Row("d"), Row("e"))
    +    )
    +  }
    +
     //  test("delete data from  carbon table[where IN (sub query) ]") {
    --- End diff --
    
    why these testcases are commented?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-carbondata issue #720: [CARBONDATA-642] Delete Subquery is not wor...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/720
  
    Can one of the admins verify this patch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---