cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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
Databricks Employee
Databricks Employee

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.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group