kafka-cassandra-sink error for json data insertion in cassandra










0















I am using kafka connect 1.0.0 with kafka version 1.0 for my kafka-cassandra-sink.created a test topic IndiaDataEngineerTest and a cassandra table indiatest having structure as



IndiaTest (
datetime timeuuid,
city text,
phone_number text,
PRIMARY KEY (datetime,phone_number)
);


In my topic data is written as json from a producer as below:



"datetime":"c8ba2390-4783-11e8-af08-d9271f3c3d48","city":"Santa Monica","phone_number":"+131000000001"
"datetime":"42485b20-44f3-11e8-b543-77b9a2d3bc92","city":"Anaheim","phone_number":"+131000000002"
"datetime":"53b5c980-41c7-11e8-8689-7983010e6437","city":"Not Found","phone_number":"+131000000004"
"datetime":"d43b3860-419a-11e8-a2eb-59f9c7b79f07","city":"Anaheim","phone_number":"+131000000003"


i am tryig to write above data in my cassandra table using below sink prop as below:





"name": "cassandra-sink",
"config":
"tasks.max":"1",
"connector.class":"com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraSinkConnector",
"topics":"IndiaDataEngineerTest",
"connect.cassandra.contact.points": "www.abc.com",
"connect.cassandra.port": 9042,
"connect.cassandra.username": "jay",
"connect.cassandra.password": "jaytest",
"connect.cassandra.key.space": "message",
"connect.cassandra.kcql":"INSERT INTO IndiaTest SELECT datetime,city,phone_number FROM IndiaDataEngineerTest"




Now after starting connect as soon I send the config file following error encountered.



[2018-11-13 01:39:55,166] INFO Preparing statements for IndiaDataEngineerTest->IndiaTest (com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter:83)
[2018-11-13 01:39:55,178] ERROR Encountered error line 1:33 missing "(" at (com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter:62)
com.datastax.driver.core.exceptions.SyntaxError: line 1:33 missing "(" at missing at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:58)
at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:24)
at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
at com.datastax.driver.core.AbstractSession.prepare(AbstractSession.java:104)
at com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter$$anonfun$3.apply(CassandraJsonWriter.scala:108)
at com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter$$anonfun$3.apply(CassandraJsonWriter.scala:104)
at scala.util.Try$.apply(Try.scala:192)


Can anyone help me out or suggest what went wrong...??
Advance thanks.










share|improve this question
























  • at com.datastax.driver.core.exceptions.SyntaxError seems to be an internal problem with the DataStax driver, not Kafka Connect, perhaps you can create an issue at github.com/Landoop/stream-reactor/issues ?

    – cricket_007
    Nov 13 '18 at 23:35












  • @cricket_007 thanks i have highlighted the issue.

    – jay singh Tanwer
    Nov 20 '18 at 10:39











  • Where are you running Kafka Connect? On its own machine? Docker? Is it possible that the classpath is colliding with something else?

    – cricket_007
    Nov 20 '18 at 11:22











  • @cricket_007 I was running Kafka connect on differenent server machine other than kafka and zookeper.

    – jay singh Tanwer
    Nov 22 '18 at 10:37












  • And other than Cassandra?

    – cricket_007
    Nov 22 '18 at 17:01















0















I am using kafka connect 1.0.0 with kafka version 1.0 for my kafka-cassandra-sink.created a test topic IndiaDataEngineerTest and a cassandra table indiatest having structure as



IndiaTest (
datetime timeuuid,
city text,
phone_number text,
PRIMARY KEY (datetime,phone_number)
);


In my topic data is written as json from a producer as below:



"datetime":"c8ba2390-4783-11e8-af08-d9271f3c3d48","city":"Santa Monica","phone_number":"+131000000001"
"datetime":"42485b20-44f3-11e8-b543-77b9a2d3bc92","city":"Anaheim","phone_number":"+131000000002"
"datetime":"53b5c980-41c7-11e8-8689-7983010e6437","city":"Not Found","phone_number":"+131000000004"
"datetime":"d43b3860-419a-11e8-a2eb-59f9c7b79f07","city":"Anaheim","phone_number":"+131000000003"


i am tryig to write above data in my cassandra table using below sink prop as below:





"name": "cassandra-sink",
"config":
"tasks.max":"1",
"connector.class":"com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraSinkConnector",
"topics":"IndiaDataEngineerTest",
"connect.cassandra.contact.points": "www.abc.com",
"connect.cassandra.port": 9042,
"connect.cassandra.username": "jay",
"connect.cassandra.password": "jaytest",
"connect.cassandra.key.space": "message",
"connect.cassandra.kcql":"INSERT INTO IndiaTest SELECT datetime,city,phone_number FROM IndiaDataEngineerTest"




Now after starting connect as soon I send the config file following error encountered.



[2018-11-13 01:39:55,166] INFO Preparing statements for IndiaDataEngineerTest->IndiaTest (com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter:83)
[2018-11-13 01:39:55,178] ERROR Encountered error line 1:33 missing "(" at (com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter:62)
com.datastax.driver.core.exceptions.SyntaxError: line 1:33 missing "(" at missing at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:58)
at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:24)
at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
at com.datastax.driver.core.AbstractSession.prepare(AbstractSession.java:104)
at com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter$$anonfun$3.apply(CassandraJsonWriter.scala:108)
at com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter$$anonfun$3.apply(CassandraJsonWriter.scala:104)
at scala.util.Try$.apply(Try.scala:192)


Can anyone help me out or suggest what went wrong...??
Advance thanks.










share|improve this question
























  • at com.datastax.driver.core.exceptions.SyntaxError seems to be an internal problem with the DataStax driver, not Kafka Connect, perhaps you can create an issue at github.com/Landoop/stream-reactor/issues ?

    – cricket_007
    Nov 13 '18 at 23:35












  • @cricket_007 thanks i have highlighted the issue.

    – jay singh Tanwer
    Nov 20 '18 at 10:39











  • Where are you running Kafka Connect? On its own machine? Docker? Is it possible that the classpath is colliding with something else?

    – cricket_007
    Nov 20 '18 at 11:22











  • @cricket_007 I was running Kafka connect on differenent server machine other than kafka and zookeper.

    – jay singh Tanwer
    Nov 22 '18 at 10:37












  • And other than Cassandra?

    – cricket_007
    Nov 22 '18 at 17:01













0












0








0








I am using kafka connect 1.0.0 with kafka version 1.0 for my kafka-cassandra-sink.created a test topic IndiaDataEngineerTest and a cassandra table indiatest having structure as



IndiaTest (
datetime timeuuid,
city text,
phone_number text,
PRIMARY KEY (datetime,phone_number)
);


In my topic data is written as json from a producer as below:



"datetime":"c8ba2390-4783-11e8-af08-d9271f3c3d48","city":"Santa Monica","phone_number":"+131000000001"
"datetime":"42485b20-44f3-11e8-b543-77b9a2d3bc92","city":"Anaheim","phone_number":"+131000000002"
"datetime":"53b5c980-41c7-11e8-8689-7983010e6437","city":"Not Found","phone_number":"+131000000004"
"datetime":"d43b3860-419a-11e8-a2eb-59f9c7b79f07","city":"Anaheim","phone_number":"+131000000003"


i am tryig to write above data in my cassandra table using below sink prop as below:





"name": "cassandra-sink",
"config":
"tasks.max":"1",
"connector.class":"com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraSinkConnector",
"topics":"IndiaDataEngineerTest",
"connect.cassandra.contact.points": "www.abc.com",
"connect.cassandra.port": 9042,
"connect.cassandra.username": "jay",
"connect.cassandra.password": "jaytest",
"connect.cassandra.key.space": "message",
"connect.cassandra.kcql":"INSERT INTO IndiaTest SELECT datetime,city,phone_number FROM IndiaDataEngineerTest"




Now after starting connect as soon I send the config file following error encountered.



[2018-11-13 01:39:55,166] INFO Preparing statements for IndiaDataEngineerTest->IndiaTest (com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter:83)
[2018-11-13 01:39:55,178] ERROR Encountered error line 1:33 missing "(" at (com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter:62)
com.datastax.driver.core.exceptions.SyntaxError: line 1:33 missing "(" at missing at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:58)
at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:24)
at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
at com.datastax.driver.core.AbstractSession.prepare(AbstractSession.java:104)
at com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter$$anonfun$3.apply(CassandraJsonWriter.scala:108)
at com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter$$anonfun$3.apply(CassandraJsonWriter.scala:104)
at scala.util.Try$.apply(Try.scala:192)


Can anyone help me out or suggest what went wrong...??
Advance thanks.










share|improve this question
















I am using kafka connect 1.0.0 with kafka version 1.0 for my kafka-cassandra-sink.created a test topic IndiaDataEngineerTest and a cassandra table indiatest having structure as



IndiaTest (
datetime timeuuid,
city text,
phone_number text,
PRIMARY KEY (datetime,phone_number)
);


In my topic data is written as json from a producer as below:



"datetime":"c8ba2390-4783-11e8-af08-d9271f3c3d48","city":"Santa Monica","phone_number":"+131000000001"
"datetime":"42485b20-44f3-11e8-b543-77b9a2d3bc92","city":"Anaheim","phone_number":"+131000000002"
"datetime":"53b5c980-41c7-11e8-8689-7983010e6437","city":"Not Found","phone_number":"+131000000004"
"datetime":"d43b3860-419a-11e8-a2eb-59f9c7b79f07","city":"Anaheim","phone_number":"+131000000003"


i am tryig to write above data in my cassandra table using below sink prop as below:





"name": "cassandra-sink",
"config":
"tasks.max":"1",
"connector.class":"com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraSinkConnector",
"topics":"IndiaDataEngineerTest",
"connect.cassandra.contact.points": "www.abc.com",
"connect.cassandra.port": 9042,
"connect.cassandra.username": "jay",
"connect.cassandra.password": "jaytest",
"connect.cassandra.key.space": "message",
"connect.cassandra.kcql":"INSERT INTO IndiaTest SELECT datetime,city,phone_number FROM IndiaDataEngineerTest"




Now after starting connect as soon I send the config file following error encountered.



[2018-11-13 01:39:55,166] INFO Preparing statements for IndiaDataEngineerTest->IndiaTest (com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter:83)
[2018-11-13 01:39:55,178] ERROR Encountered error line 1:33 missing "(" at (com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter:62)
com.datastax.driver.core.exceptions.SyntaxError: line 1:33 missing "(" at missing at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:58)
at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:24)
at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
at com.datastax.driver.core.AbstractSession.prepare(AbstractSession.java:104)
at com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter$$anonfun$3.apply(CassandraJsonWriter.scala:108)
at com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraJsonWriter$$anonfun$3.apply(CassandraJsonWriter.scala:104)
at scala.util.Try$.apply(Try.scala:192)


Can anyone help me out or suggest what went wrong...??
Advance thanks.







apache-kafka cassandra-3.0 apache-kafka-connect






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 23:35









cricket_007

81.7k1143111




81.7k1143111










asked Nov 13 '18 at 10:36









jay singh Tanwerjay singh Tanwer

65




65












  • at com.datastax.driver.core.exceptions.SyntaxError seems to be an internal problem with the DataStax driver, not Kafka Connect, perhaps you can create an issue at github.com/Landoop/stream-reactor/issues ?

    – cricket_007
    Nov 13 '18 at 23:35












  • @cricket_007 thanks i have highlighted the issue.

    – jay singh Tanwer
    Nov 20 '18 at 10:39











  • Where are you running Kafka Connect? On its own machine? Docker? Is it possible that the classpath is colliding with something else?

    – cricket_007
    Nov 20 '18 at 11:22











  • @cricket_007 I was running Kafka connect on differenent server machine other than kafka and zookeper.

    – jay singh Tanwer
    Nov 22 '18 at 10:37












  • And other than Cassandra?

    – cricket_007
    Nov 22 '18 at 17:01

















  • at com.datastax.driver.core.exceptions.SyntaxError seems to be an internal problem with the DataStax driver, not Kafka Connect, perhaps you can create an issue at github.com/Landoop/stream-reactor/issues ?

    – cricket_007
    Nov 13 '18 at 23:35












  • @cricket_007 thanks i have highlighted the issue.

    – jay singh Tanwer
    Nov 20 '18 at 10:39











  • Where are you running Kafka Connect? On its own machine? Docker? Is it possible that the classpath is colliding with something else?

    – cricket_007
    Nov 20 '18 at 11:22











  • @cricket_007 I was running Kafka connect on differenent server machine other than kafka and zookeper.

    – jay singh Tanwer
    Nov 22 '18 at 10:37












  • And other than Cassandra?

    – cricket_007
    Nov 22 '18 at 17:01
















at com.datastax.driver.core.exceptions.SyntaxError seems to be an internal problem with the DataStax driver, not Kafka Connect, perhaps you can create an issue at github.com/Landoop/stream-reactor/issues ?

– cricket_007
Nov 13 '18 at 23:35






at com.datastax.driver.core.exceptions.SyntaxError seems to be an internal problem with the DataStax driver, not Kafka Connect, perhaps you can create an issue at github.com/Landoop/stream-reactor/issues ?

– cricket_007
Nov 13 '18 at 23:35














@cricket_007 thanks i have highlighted the issue.

– jay singh Tanwer
Nov 20 '18 at 10:39





@cricket_007 thanks i have highlighted the issue.

– jay singh Tanwer
Nov 20 '18 at 10:39













Where are you running Kafka Connect? On its own machine? Docker? Is it possible that the classpath is colliding with something else?

– cricket_007
Nov 20 '18 at 11:22





Where are you running Kafka Connect? On its own machine? Docker? Is it possible that the classpath is colliding with something else?

– cricket_007
Nov 20 '18 at 11:22













@cricket_007 I was running Kafka connect on differenent server machine other than kafka and zookeper.

– jay singh Tanwer
Nov 22 '18 at 10:37






@cricket_007 I was running Kafka connect on differenent server machine other than kafka and zookeper.

– jay singh Tanwer
Nov 22 '18 at 10:37














And other than Cassandra?

– cricket_007
Nov 22 '18 at 17:01





And other than Cassandra?

– cricket_007
Nov 22 '18 at 17:01












1 Answer
1






active

oldest

votes


















0














The issue was resolved as I am not using correct version of Cassandra. For kafka connect 1.0.0 with kafka version 1.0 , it require Cassandra version 3.0.9 or above.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53279106%2fkafka-cassandra-sink-error-for-json-data-insertion-in-cassandra%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The issue was resolved as I am not using correct version of Cassandra. For kafka connect 1.0.0 with kafka version 1.0 , it require Cassandra version 3.0.9 or above.






    share|improve this answer



























      0














      The issue was resolved as I am not using correct version of Cassandra. For kafka connect 1.0.0 with kafka version 1.0 , it require Cassandra version 3.0.9 or above.






      share|improve this answer

























        0












        0








        0







        The issue was resolved as I am not using correct version of Cassandra. For kafka connect 1.0.0 with kafka version 1.0 , it require Cassandra version 3.0.9 or above.






        share|improve this answer













        The issue was resolved as I am not using correct version of Cassandra. For kafka connect 1.0.0 with kafka version 1.0 , it require Cassandra version 3.0.9 or above.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 19 '18 at 7:14









        jay singh Tanwerjay singh Tanwer

        65




        65





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53279106%2fkafka-cassandra-sink-error-for-json-data-insertion-in-cassandra%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Use pre created SQLite database for Android project in kotlin

            Darth Vader #20

            Ondo