You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by 杰 <25...@qq.com> on 2016/09/26 12:00:51 UTC

回复: Change for DELETE SEGMENT FROM TABLE syntax

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";<ra...@gmail.com>;
发送时间: 2016年9月24日(星期六) 凌晨1:25
收件人: "dev"<de...@carbondata.incubator.apache.org>; 

主题: 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, 杰 <25...@qq.com> 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