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:ย 

bug: add csv data UI: missing leading zero

lizou
Contributor II

use add data UI, add csv manually, even set data type as string, the leading zero will be missing

example csv

val1,val2

0012345, abc

after load data,

123,abc is stored in table

imageimage

3 REPLIES 3

Aviral-Bhardwaj
Esteemed Contributor III

Hey @lizo I don't think there is any bug we generally do not count Zeros in front of the number

It's not able to CSV I created a table in the databricks but it is happening the same.

image 

Thanks

Aviral Bhardwaj

AviralBhardwaj

Chaitanya_Raju
Honored Contributor

Hi @lizouโ€‹ ,

Can you please check again in your .csv file if the value is appended with zeros and stored as a string only, as per the post I believe you are fine to store the number as a string, and I am not facing any issues.

I tried to replicate the same as mentioned below

Created a .csv file with numbers as text with zeros at the start and manually uploaded in UI of the data tab in databricks and read into df , working fine without any issues as shown below,

Please let me know if this answers your query

Capture

Happy Learning!!

Thanks for reading and like if this is useful and for improvements or feedback please comment.

lizou
Contributor II

there are no issues using spark.read in notebooks

the issue is specific to using Add Data User interface and adding a csv file manually.

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