Commit fe3c0c9
authored
fix(parquet): Avoid panic on malformed thrift bool fields in parquet metadata (#9840)
Return a Parquet error when a compact thrift field is expected to be a
`bool` but the field header contains a non-bool wire type. This replaces
the remaining `bool_val` unwraps in generated thrift readers and the
hand-expanded `DataPageHeaderV2` reader.
Add regression tests for malformed `DictionaryPageHeader.is_sorted` and
`DataPageHeaderV2.is_compressed` headers to ensure corrupt input returns
an error instead of panicking.
# Which issue does this PR close?
- Closes #9839.
# Rationale for this change
See #9839
# What changes are included in this PR?
Proper error handling instead of using `unwrap`.
# Are these changes tested?
Yes. Added 2 UTs.
# Are there any user-facing changes?
An error string that can find its way all the way to the end user.1 parent fc3f778 commit fe3c0c9
2 files changed
Lines changed: 89 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1128 | 1128 | | |
1129 | 1129 | | |
1130 | 1130 | | |
1131 | | - | |
1132 | | - | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
1133 | 1138 | | |
1134 | 1139 | | |
1135 | 1140 | | |
| |||
1721 | 1726 | | |
1722 | 1727 | | |
1723 | 1728 | | |
1724 | | - | |
| 1729 | + | |
1725 | 1730 | | |
1726 | | - | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
1727 | 1735 | | |
1728 | 1736 | | |
1729 | 1737 | | |
1730 | | - | |
| 1738 | + | |
| 1739 | + | |
1731 | 1740 | | |
1732 | 1741 | | |
1733 | 1742 | | |
| |||
1794 | 1803 | | |
1795 | 1804 | | |
1796 | 1805 | | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
1797 | 1829 | | |
1798 | 1830 | | |
1799 | 1831 | | |
| |||
1873 | 1905 | | |
1874 | 1906 | | |
1875 | 1907 | | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
1876 | 1956 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
468 | 471 | | |
469 | 472 | | |
470 | 473 | | |
| |||
0 commit comments