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: 

What is the equivalent function to oracle trunc() for numerics in databricks?

Hemanth998
New Contributor
 
1 ACCEPTED SOLUTION

Accepted Solutions

Aashita
Contributor III
Contributor III

@Hemanth​ , example :

spark.sql("select substring(25.45678,0, instr(25.45678,'.')+2) as out").show()
 

will give

View solution in original post

3 REPLIES 3

Aashita
Contributor III
Contributor III

@Hemanth​ , example :

spark.sql("select substring(25.45678,0, instr(25.45678,'.')+2) as out").show()
 

will give

@Hemanth​  does it work now?

Kaniz_Fatma
Community Manager
Community Manager

Hi @Hemanth​ , Just a friendly follow-up. Do you still need help, or @Aashita Ramteke​ 's response help you to find the solution? Please let us know.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!