Skip to content

Commit 0bda008

Browse files
fix: Update Spark test expectation for TIMESTAMPTZ values
After rebasing on main, the Spark test expectations were reverted to the old incorrect values. This commit re-applies the fix for TIMESTAMPTZ handling in HyperResultSourceTest. The test now correctly expects Timestamp.from(Instant.parse(...)) for TIMESTAMPTZ columns, which preserves the correct epoch milliseconds instead of incorrectly interpreting the value as a local time. Test: HyperResultSourceTest - supports reading all types
1 parent 2f91cbb commit 0bda008

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

spark-datasource-core/src/test/scala/HyperResultSourceTest.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.salesforce.datacloud.jdbc.hyper.HyperServerManager.ConfigFile
88

99
import java.sql.{Date, SQLException, Timestamp}
1010
import java.math.BigDecimal
11+
import java.time.Instant
1112
import org.apache.spark.sql.types.{
1213
BinaryType,
1314
BooleanType,
@@ -214,8 +215,8 @@ class HyperResultSourceTest extends AnyFunSuite with WithSparkSession {
214215
assert(row.getAs[Date]("date") == Date.valueOf("2024-01-01"))
215216
assert(row.isNullAt(row.fieldIndex("date_null")))
216217
assert(
217-
row.getAs[Timestamp]("timestamp") == Timestamp.valueOf(
218-
"2024-01-01 12:00:00"
218+
row.getAs[Timestamp]("timestamp") == Timestamp.from(
219+
Instant.parse("2024-01-02T04:00:00Z")
219220
)
220221
)
221222
assert(

0 commit comments

Comments
 (0)