You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Amit Sharma <re...@gmail.com> on 2020/07/01 14:47:41 UTC

Truncate table

Hi, i have scenario where i have to read certain raw from a table and
truncate the table and store the certain raws back to the table. I am doing
below steps

1. reading certain raws in DF1 from cassandra table A.
2. saving into cassandra as override in table A


the problem is when I truncate the table at step 2 I will lose the data  in
DF1 as it shows empty.
I have two solutions
1. Store the DF1 in another temp table before truncating table A
2. Cache DF1 before truncating.

Do we have any better solution ?


Thanks
Amit

Re: Truncate table

Posted by Russell Spitzer <ru...@gmail.com>.
I'm not sure what you're really trying to do here but it sounds like saving
the data to a park a file or other temporary store before truncating would
protect you in case of failure.

On Wed, Jul 1, 2020, 9:48 AM Amit Sharma <re...@gmail.com> wrote:

> Hi, i have scenario where i have to read certain raw from a table and
> truncate the table and store the certain raws back to the table. I am doing
> below steps
>
> 1. reading certain raws in DF1 from cassandra table A.
> 2. saving into cassandra as override in table A
>
>
> the problem is when I truncate the table at step 2 I will lose the data
> in DF1 as it shows empty.
> I have two solutions
> 1. Store the DF1 in another temp table before truncating table A
> 2. Cache DF1 before truncating.
>
> Do we have any better solution ?
>
>
> Thanks
> Amit
>