Hi,all
as we know, carbon have below DELETE syntax, DELETE SEGMENT id FROM TABLE DELETE SEGMENTS FROM TABLE WHERE STARTTIME BEFORE date while in hive, there is similar syntax as below, DELETE FILE | JAR | ARCHIVE <filepath> then, when we run DELETE SEGMENT in spark-sql that integrating hive parser and carbon parser, it may give below error message cause the parse in hive ERROR DeleteResourceProcessor: Usage: delete [FILE|JAR|ARCHIVE] <value> [<value>]* which does not impact the usage of carbon, but looks not good. So after a small discussion, we think that it may be better to make change on our syntax and change to DELETE FROM TABLE WHERE SEGMENT EQUAL id DELETE FROM TABLE WHERE SEGMENTS STARTTIME BEFORE date i have raised JIRA[CARBONDATA-269] and PR#192 for this issue, please give your suggestion about this change. Thanks Jay |
Hi Jay,
Here if you use carbonsqlparser first then it won't be any issue. But if you use hive parser first then this issue arises. But I think there is a same case even with the 'Load' command, how that is handled here. And also the delete commands you mentioned does not look proper. DELETE FROM TABLE WHERE SEGMENT EQUAL id DELETE FROM TABLE WHERE SEGMENTS STARTTIME BEFORE date Here it seems like SEGMENT and SEGMENTS are like columns in table. I prefer the old DELETE commands over new commands. Thanks & Regards, Ravindra. On 23 September 2016 at 12:19, 杰 <[hidden email]> wrote: > Hi,all > as we know, carbon have below DELETE syntax, > > DELETE SEGMENT id FROM TABLE > DELETE SEGMENTS FROM TABLE WHERE STARTTIME BEFORE date > > while in hive, there is similar syntax as below, > > > DELETE FILE | JAR | ARCHIVE <filepath> > > > then, when we run DELETE SEGMENT in spark-sql that integrating hive > parser and carbon parser, it may give below > error message cause the parse in hive > > > ERROR DeleteResourceProcessor: Usage: delete [FILE|JAR|ARCHIVE] <value> > [<value>]* > > which does not impact the usage of carbon, but looks not good. > So after a small discussion, we think that it may be better to make > change on our syntax and change to > > DELETE FROM TABLE WHERE SEGMENT EQUAL id > DELETE FROM TABLE WHERE SEGMENTS STARTTIME BEFORE date > > > i have raised JIRA[CARBONDATA-269] and PR#192 for this issue, please > give your suggestion about this change. > > > > Thanks > Jay -- Thanks & Regards, Ravi |
I am definitely not fan of introducing new syntax, but considering this is a unique feature of Carbon, I would like to suggest to use ALTER TABLE statement: ALTER TABLE DROP SEGMENTS [segment-spec] Segment-spec can be id or range. Regards. Jenny -----Original Message----- From: Ravindra Pesala [mailto:[hidden email]] Sent: Friday, September 23, 2016 9:56 AM To: dev Subject: Re: Change for DELETE SEGMENT FROM TABLE syntax Hi Jay, Here if you use carbonsqlparser first then it won't be any issue. But if you use hive parser first then this issue arises. But I think there is a same case even with the 'Load' command, how that is handled here. And also the delete commands you mentioned does not look proper. DELETE FROM TABLE WHERE SEGMENT EQUAL id DELETE FROM TABLE WHERE SEGMENTS STARTTIME BEFORE date Here it seems like SEGMENT and SEGMENTS are like columns in table. I prefer the old DELETE commands over new commands. Thanks & Regards, Ravindra. On 23 September 2016 at 12:19, 杰 <[hidden email]> wrote: > Hi,all > as we know, carbon have below DELETE syntax, > > DELETE SEGMENT id FROM TABLE > DELETE SEGMENTS FROM TABLE WHERE STARTTIME BEFORE date > > while in hive, there is similar syntax as below, > > > DELETE FILE | JAR | ARCHIVE <filepath> > > > then, when we run DELETE SEGMENT in spark-sql that integrating hive > parser and carbon parser, it may give below > error message cause the parse in hive > > > ERROR DeleteResourceProcessor: Usage: delete [FILE|JAR|ARCHIVE] <value> > [<value>]* > > which does not impact the usage of carbon, but looks not good. > So after a small discussion, we think that it may be better to make > change on our syntax and change to > > DELETE FROM TABLE WHERE SEGMENT EQUAL id > DELETE FROM TABLE WHERE SEGMENTS STARTTIME BEFORE date > > > i have raised JIRA[CARBONDATA-269] and PR#192 for this issue, please > give your suggestion about this change. > > > > Thanks > Jay -- Thanks & Regards, Ravi |
In reply to this post by ravipesala
Hi, all
i have close that pr#192 and DELETE SEGMENT Syntax will not be changed temporarily. @Ravindra, yes, this problem has similarity with 'Load' command, while there is some difference. that 'load without option' can be parsed by hive parser, and we add carbon strategy in planner to intercept the logical plan and can use carbon sqlparser to parse it again. For that 'load with option', hive parser parse it failed, then carbon sqlparser can do it. but the point is , both of 'load' has no error log print. so for this DELETE SEGMENT error message, may be need spark side to handle, or some other better resolution. and Thanks for ur response @Jihong Ma @Ravindra ------------------ 原始邮件 ------------------ 发件人: "Ravindra Pesala";<[hidden email]>; 发送时间: 2016年9月24日(星期六) 凌晨1:25 收件人: "dev"<[hidden email]>; 主题: Re: Change for DELETE SEGMENT FROM TABLE syntax Hi Jay, Here if you use carbonsqlparser first then it won't be any issue. But if you use hive parser first then this issue arises. But I think there is a same case even with the 'Load' command, how that is handled here. And also the delete commands you mentioned does not look proper. DELETE FROM TABLE WHERE SEGMENT EQUAL id DELETE FROM TABLE WHERE SEGMENTS STARTTIME BEFORE date Here it seems like SEGMENT and SEGMENTS are like columns in table. I prefer the old DELETE commands over new commands. Thanks & Regards, Ravindra. On 23 September 2016 at 12:19, 杰 <[hidden email]> wrote: > Hi,all > as we know, carbon have below DELETE syntax, > > DELETE SEGMENT id FROM TABLE > DELETE SEGMENTS FROM TABLE WHERE STARTTIME BEFORE date > > while in hive, there is similar syntax as below, > > > DELETE FILE | JAR | ARCHIVE <filepath> > > > then, when we run DELETE SEGMENT in spark-sql that integrating hive > parser and carbon parser, it may give below > error message cause the parse in hive > > > ERROR DeleteResourceProcessor: Usage: delete [FILE|JAR|ARCHIVE] <value> > [<value>]* > > which does not impact the usage of carbon, but looks not good. > So after a small discussion, we think that it may be better to make > change on our syntax and change to > > DELETE FROM TABLE WHERE SEGMENT EQUAL id > DELETE FROM TABLE WHERE SEGMENTS STARTTIME BEFORE date > > > i have raised JIRA[CARBONDATA-269] and PR#192 for this issue, please > give your suggestion about this change. > > > > Thanks > Jay -- Thanks & Regards, Ravi |
Free forum by Nabble | Edit this page |