cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Need a way to show the non-trimmed data while query a table ?

Rajkishore
New Contributor II

When querying a json data , the values are getting trimmed. I need to see the full data for that field, is there any way to do so ?

6 REPLIES 6

pvignesh92
Honored Contributor

@Raj Sethiโ€‹ Hi, I believe you are using display option. Try to use show with truncate as False so that your entire contents can be displayed

Ex. df.show(truncate = False)

Thanks for the response @Vigneshraja Palanirajโ€‹  ! While executing in python it works, but if I run it as sql ,do I have this option? Please let me know if you have come across any solution for this .

Hi @Raj Sethiโ€‹ , If you are expecting something like below

%sql

select * from tbl -> This internally uses .display API to display your results. So you can't really control truncation there.

But if you can try the same above command like below, it could help to solve your issue.

spark.sql("select * from tbl").show(truncate = False)

Please let me know if this helps.

Lakshay
Esteemed Contributor
Esteemed Contributor

Hi @Raj Sethiโ€‹ , I think if you use "df.show(truncate=False)" , this should display the complete result. But, a better option would be to write the data to a table or file to see the complete value

Rajkishore
New Contributor II

Thanks for the response @Lakshay Goelโ€‹  ! While executing in python it works, but if I run it as sql ,do I have this option? Please let me know if you have come across any solution for this .

Anonymous
Not applicable

Hi @Raj Sethiโ€‹ 

We haven't heard from you since the last response from @Lakshay Goelโ€‹  and @Vigneshraja Palanirajโ€‹ โ€‹, and I was checking back to see if her suggestions helped you.

Or else, If you have any solution, please share it with the community, as it can be helpful to others. 

Also, Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.