Commit bdd89f2
[SPARK-56469][SQL][TESTS]
### What changes were proposed in this pull request?
Extracted from #55116.
The test-framework reader in `InMemoryBaseTable` now tracks a closed flag and throws `IllegalStateException` for reads, double-closes, or metric fetches on a closed reader. This ensures future tests catch reader lifecycle bugs that were previously hidden by the noop `close()`.
### Why are the changes needed?
Improve test framework.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing UTs.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #55336 from peter-toth/SPARK-56469-bufferedrowsreader-lifecycle-hardening.
Authored-by: Peter Toth <peter.toth@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>BufferedRowsReader lifecycle hardening1 parent 53f6b15 commit bdd89f2
File tree
1 file changed
+14
-1
lines changed- sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog
1 file changed
+14
-1
lines changedLines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
880 | 884 | | |
881 | 885 | | |
| 886 | + | |
882 | 887 | | |
883 | 888 | | |
884 | 889 | | |
885 | 890 | | |
886 | 891 | | |
887 | 892 | | |
888 | 893 | | |
| 894 | + | |
889 | 895 | | |
890 | 896 | | |
891 | 897 | | |
| |||
895 | 901 | | |
896 | 902 | | |
897 | 903 | | |
898 | | - | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
899 | 911 | | |
900 | 912 | | |
901 | 913 | | |
| |||
1041 | 1053 | | |
1042 | 1054 | | |
1043 | 1055 | | |
| 1056 | + | |
1044 | 1057 | | |
1045 | 1058 | | |
1046 | 1059 | | |
| |||
0 commit comments