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
Databricks Employee
Databricks Employee

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

 

 

 

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