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

 

 

 

 

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