SELECT on VIEW not showing any data in the table after unsetting timezone

Use the Apache Spark configuration spark.conf.set("spark.sql.legacy.useCurrentConfigsForView", "true").

Written by vinay.mr

Last published at: July 18th, 2025

Problem

You want to change your data timezone from the default UTC to a specific region. You first unset a view’s table property view.sqlConfig.spark.sql.session.timeZone using the following code. 

ALTER VIEW <catalog>.<schemal>.<view> UNSET TBLPROPERTIES ('view.sqlConfig.spark.sql.session.timeZone')

 

You then try to use the SELECT operation on the VIEW using the following code to finish setting the timezone.   

SELECT * FROM <catalog>.<schemal>.<view>

 

You see that no data appears from the table. 

 

Cause

When you unset the timezone table property, the data can no longer be read and so cannot be returned. 

 

Solution

Use the following Apache Spark configuration, which uses your current session's SQL configs for view resolution, rather than the configs captured at the time the view was created or altered (such as UTC). 

spark.conf.set("spark.sql.legacy.useCurrentConfigsForView", "true") 

 

For details on how to apply Spark configs, refer to the “Spark configuration” section of the Compute configuration reference (AWS | Azure | GCP) documentation.