|
18 | 18 | package org.apache.spark.sql.streaming
|
19 | 19 |
|
20 | 20 | import java.io.File
|
| 21 | +import java.nio.ByteOrder |
21 | 22 | import java.sql.Timestamp
|
22 | 23 |
|
23 | 24 | import org.apache.commons.io.FileUtils
|
@@ -458,7 +459,17 @@ class FlatMapGroupsWithStateSuite extends StateStoreMetricsTest {
|
458 | 459 | checkAnswer(df, Seq(("a", 2), ("b", 1)).toDF())
|
459 | 460 | }
|
460 | 461 |
|
| 462 | + // Skip the v1 tests with timeout on big endian platforms because the |
| 463 | + // timestampTimeoutAttribute of StateManagerImplV1 is declared as IntegerType instead |
| 464 | + // of LongType which breaks serialization on big endian. This can't be fixed because it |
| 465 | + // would be a breaking schema change. |
| 466 | + def isStateFormatSupported(stateFormatVersion: Int): Boolean = { |
| 467 | + stateFormatVersion != 1 || ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN) |
| 468 | + } |
| 469 | + |
461 | 470 | testWithAllStateVersions("flatMapGroupsWithState - streaming with processing time timeout") {
|
| 471 | + assume( |
| 472 | + isStateFormatSupported(sqlConf.getConf(SQLConf.FLATMAPGROUPSWITHSTATE_STATE_FORMAT_VERSION))) |
462 | 473 | // Function to maintain the count as state and set the proc. time timeout delay of 10 seconds.
|
463 | 474 | // It returns the count if changed, or -1 if the state was removed by timeout.
|
464 | 475 | val stateFunc = (key: String, values: Iterator[String], state: GroupState[RunningCount]) => {
|
@@ -526,6 +537,8 @@ class FlatMapGroupsWithStateSuite extends StateStoreMetricsTest {
|
526 | 537 | }
|
527 | 538 |
|
528 | 539 | testWithAllStateVersions("flatMapGroupsWithState - streaming w/ event time timeout + watermark") {
|
| 540 | + assume( |
| 541 | + isStateFormatSupported(sqlConf.getConf(SQLConf.FLATMAPGROUPSWITHSTATE_STATE_FORMAT_VERSION))) |
529 | 542 | val inputData = MemoryStream[(String, Int)]
|
530 | 543 | val result =
|
531 | 544 | inputData.toDS()
|
|
0 commit comments