Cassandra: insert in loop

464 views
Skip to first unread message

Boris Poliakovsky

unread,
Oct 18, 2016, 3:52:36 AM10/18/16
to DataStax Spark Connector for Apache Cassandra
How to insert in a loop, either in CQL, or UDF?
Please give an example

Russell Spitzer

unread,
Oct 18, 2016, 11:29:07 AM10/18/16
to DataStax Spark Connector for Apache Cassandra
To my knowledge there is not internal looping mechanism in CQL. You have to loop in your client language. 

IE:

for key in keys:
   session.execute_async(statement.bind(key))

On Tue, Oct 18, 2016 at 12:52 AM Boris Poliakovsky <bpol...@gmail.com> wrote:
How to insert in a loop, either in CQL, or UDF?
Please give an example

--
You received this message because you are subscribed to the Google Groups "DataStax Spark Connector for Apache Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spark-connector-...@lists.datastax.com.
--

Boris Poliakovsky

unread,
Oct 18, 2016, 1:18:09 PM10/18/16
to DataStax Spark Connector for Apache Cassandra
вторник, 18 октября 2016 г., 18:29:07 UTC+3 пользователь Russell Spitzer написал:
> To my knowledge there is not internal looping mechanism in CQL. You have to loop in your client language. 
>
> IE:
>
> for key in keys:
>    session.execute_async(statement.bind(key))
>
>
> On Tue, Oct 18, 2016 at 12:52 AM Boris Poliakovsky <bpol...@gmail.com> wrote:
> How to insert in a loop, either in CQL, or UDF?
>
> Please give an example
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "DataStax Spark Connector for Apache Cassandra" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to spark-connector-...@lists.datastax.com.
>
>
> --
>
>
>
>
> Russell Spitzer
> Software Engineer
>
>
>
>
>
>
>
> https://github.com/datastax/spark-cassandra-connector/blob/master/doc/FAQ.md
> http://spark-packages.org/package/datastax/spark-cassandra-connector

Thanks, Rassel,

Unfortunately, I am not familiar with Java

Could you please send me example of CREATE Java UDF command, inside which I can use block "for key in keys:
   session.execute_async(statement.bind(key))"
??

Sincerely,
Boris

Russell Spitzer

unread,
Oct 18, 2016, 2:05:19 PM10/18/16
to DataStax Spark Connector for Apache Cassandra
I know of no way to do it on the server. Like I said the only way I know is from the *client* code. Perhaps you should ask in the Cassandra or Drivers IRC rooms

Boris Poliakovsky

unread,
Oct 18, 2016, 3:57:39 PM10/18/16
to spark-conn...@lists.datastax.com
I found nou these rooms
Coud you please send me corresponded links ?

2016-10-18 21:05 GMT+03:00 Russell Spitzer <russell...@gmail.com>:
I know of no way to do it on the server. Like I said the only way I know is from the *client* code. Perhaps you should ask in the Cassandra or Drivers IRC rooms
On Tue, Oct 18, 2016 at 10:18 AM Boris Poliakovsky <bpol...@gmail.com> wrote:
вторник, 18 октября 2016 г., 18:29:07 UTC+3 пользователь Russell Spitzer написал:
> To my knowledge there is not internal looping mechanism in CQL. You have to loop in your client language. 
>
> IE:
>
> for key in keys:
>    session.execute_async(statement.bind(key))
>
>
> On Tue, Oct 18, 2016 at 12:52 AM Boris Poliakovsky <bpol...@gmail.com> wrote:
> How to insert in a loop, either in CQL, or UDF?
>
> Please give an example
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "DataStax Spark Connector for Apache Cassandra" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to spark-connector-user+unsub...@lists.datastax.com.

>
>
> --
>
>
>
>
> Russell Spitzer
> Software Engineer
>
>
>
>
>
>
>
> https://github.com/datastax/spark-cassandra-connector/blob/master/doc/FAQ.md
> http://spark-packages.org/package/datastax/spark-cassandra-connector

Thanks, Rassel,

Unfortunately, I am not familiar with Java

Could you please send me example of CREATE Java UDF command, inside which I can use block "for key in keys:
    session.execute_async(statement.bind(key))"
??

Sincerely,
Boris

--
You received this message because you are subscribed to the Google Groups "DataStax Spark Connector for Apache Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spark-connector-user+unsub...@lists.datastax.com.

--
You received this message because you are subscribed to a topic in the Google Groups "DataStax Spark Connector for Apache Cassandra" group.
To unsubscribe from this topic, visit https://groups.google.com/a/lists.datastax.com/d/topic/spark-connector-user/2K9XcHEz8_s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spark-connector-user+unsub...@lists.datastax.com.

Russell Spitzer

unread,
Oct 18, 2016, 4:01:53 PM10/18/16
to spark-conn...@lists.datastax.com

On Tue, Oct 18, 2016 at 12:57 PM Boris Poliakovsky <bpol...@gmail.com> wrote:
I found nou these rooms
Coud you please send me corresponded links ?

2016-10-18 21:05 GMT+03:00 Russell Spitzer <russell...@gmail.com>:
I know of no way to do it on the server. Like I said the only way I know is from the *client* code. Perhaps you should ask in the Cassandra or Drivers IRC rooms
On Tue, Oct 18, 2016 at 10:18 AM Boris Poliakovsky <bpol...@gmail.com> wrote:
вторник, 18 октября 2016 г., 18:29:07 UTC+3 пользователь Russell Spitzer написал:
> To my knowledge there is not internal looping mechanism in CQL. You have to loop in your client language. 
>
> IE:
>
> for key in keys:
>    session.execute_async(statement.bind(key))
>
>
> On Tue, Oct 18, 2016 at 12:52 AM Boris Poliakovsky <bpol...@gmail.com> wrote:
> How to insert in a loop, either in CQL, or UDF?
>
> Please give an example
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "DataStax Spark Connector for Apache Cassandra" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to spark-connector-...@lists.datastax.com.

>
>
> --
>
>
>
>
> Russell Spitzer
> Software Engineer
>
>
>
>
>
>
>
> https://github.com/datastax/spark-cassandra-connector/blob/master/doc/FAQ.md
> http://spark-packages.org/package/datastax/spark-cassandra-connector

Thanks, Rassel,

Unfortunately, I am not familiar with Java

Could you please send me example of CREATE Java UDF command, inside which I can use block "for key in keys:
    session.execute_async(statement.bind(key))"
??

Sincerely,
Boris

--
You received this message because you are subscribed to the Google Groups "DataStax Spark Connector for Apache Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spark-connector-...@lists.datastax.com.

--
You received this message because you are subscribed to a topic in the Google Groups "DataStax Spark Connector for Apache Cassandra" group.
To unsubscribe from this topic, visit https://groups.google.com/a/lists.datastax.com/d/topic/spark-connector-user/2K9XcHEz8_s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spark-connector-...@lists.datastax.com.

--
You received this message because you are subscribed to the Google Groups "DataStax Spark Connector for Apache Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spark-connector-...@lists.datastax.com.
Reply all
Reply to author
Forward
0 new messages