Share via

Issue with python code in dataframe

Shubham Garg 0 Reputation points
2025-01-21T13:18:04.57+00:00

File name is cdr-1725341100483.csv. Requirement is to fetch 13 digit code from filename and convert into date using epoch date.

below code is able to fetch 13 digit . but unable to convert to date.

"file_date",

          from_unixtime(

            (split(split(col("file_name"), "-").getItem(-1), ".").getItem(0).cast("int")/1000).cast("long")

         ).cast("date")

Community Center | Not monitored
0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-01-21T13:42:44.8166667+00:00

    Hi Shubham Garg,

    Thank you for reaching out to us on the Microsoft Q&A forum.

    This topic is currently not supported in the Q&A forums. 

    We recommend posting your query in the dedicated Microsoft Fabric Community Forum under the General Discussion section. Experts and moderators are available there to provide assistance and guidance. You can access the community here.

    I hope this information is helpful. If it is, please click Accept Answer and Upvote to assist other community members.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.