Jump to content

Help- data engineers


vendettaa

Recommended Posts

 

I have data frame in scala trying to save it into cassandra  where column data type in cassandra  is Map<text,text> . So when i try to save it am getting error as type mismatch 

val df_m=spark.sql(
      """select concat('{',"v_id'',':',v_id,',',''model_score'',':',model_score,',',''reserved3'',':',nvl(reserved3,'NULL'),'}')
        |as insight_meta_data  from model_scores """.stripMargin)

Result is {v_id:8888,v_score:9999,reserved3:Null}, i need result to be saved as {v_id:8888,v_score:9999,reserved3:Null} 

how i can save this string into data type: Map<text,text> in cassandra

 

Link to comment
Share on other sites

1 hour ago, vendettaa said:

 

I have data frame in scala trying to save it into cassandra  where column data type in cassandra  is Map<text,text> . So when i try to save it am getting error as type mismatch 

val df_m=spark.sql(
      """select concat('{',"v_id'',':',v_id,',',''model_score'',':',model_score,',',''reserved3'',':',nvl(reserved3,'NULL'),'}')
        |as insight_meta_data  from model_scores """.stripMargin)

Result is {v_id:8888,v_score:9999,reserved3:Null}, i need result to be saved as {v_id:8888,v_score:9999,reserved3:Null} 

how i can save this string into data type: Map<text,text> in cassandra

 

type mismatch means expected output is not what it is. ex: result is stream and your expected output is Boolean 

Link to comment
Share on other sites

20 minutes ago, k2s said:

type mismatch means expected output is not what it is. ex: result is stream and your expected output is Boolean 

Expected output Map data type not Boolean 

Link to comment
Share on other sites

1 hour ago, vendettaa said:

issue fixed , evaru  help cheyaru nene cheskovali kasta stack over flow baga search cheskuni

 

ela annav ante...intlo mommy.. pani antha nene cheskovali evvaru help cheyaru naku ani intlo vallani annatlu annav ... 😁😁

 

  • Haha 2
Link to comment
Share on other sites

51 minutes ago, k2s said:

Read my reply again. Thondara patu antey idey mari

type mismatch ani yepdo telsu , but doubt scala lo rasina dataframe ni cassandra lo map data type ki ela save cheydam

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...