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: 

withColumnRenamed does not work with databricks-connect 14.3.0

dbal
New Contributor III
I am not able to run our unit tests suite due a possible bug in the databricks-connect library.
 
The problem is with the Dataframe transformation withColumnRenamed. When I run it in a Databricks cluster (Databricks Runtime 14.3 LTS), the column is renamed correctly. But when we run in the local machine (databricks-connect) unit tests, the column is never renamed.
 
Investigating the query plan in both environments I noticed that the Physical Plan in Databricks actually generates a Projection. The plan generated by databricks-connect does not. See images below.
 
Running in Databricks Runtime 14.3 LTS
dbal_3-1715382511871.png
 

Running in local machine using databricks-connect:14.3.0

 dbal_4-1715382516217.png

If I instead of withColumnRenamed I use select, then it works as expected, as shown below:

dbal_1-1715383269610.png

 

 

 

 
2 REPLIES 2

shan_chandra
Esteemed Contributor
Esteemed Contributor

dbal
New Contributor III

Hi @shan_chandra  thank you for your answer.

I am using Scala, not Python. Nevertheless, I tried using the withColumnsRenamed(), but sadly it shows the same issue.

dbal_0-1715954146271.png

 

 

 

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!