drop table aufm;
CREATE TABLE aufm (
mblnr text,mjahr text,zeile text,bldat text,
budat text,bwart text,matnr text,werks text,
lgort text,charg text,sobkz text,lifnr text,
kdauf text,kdpos text,shkzg text,menge text,
bwtar text,aufnr text,bldat1 date,budat1 date,
mandt text,hashResult text,rowNum serial,
PRIMARY KEY (mblnr, mandt, mjahr, zeile)
)
Distributed by (mblnr, mandt, mjahr, zeile)
partition by range(mjahr)
(
partition p2015 start ('2015') inclusive end ('2016') exclusive,
partition p2016 start ('2016') inclusive end ('2017') exclusive,
partition p2017 start ('2017') inclusive end ('2018') exclusive,
partition p2018 start ('2018') inclusive end ('2019') exclusive,
partition p2019 start ('2019') inclusive end ('2020') exclusive,
partition p2020 start ('2020') inclusive end ('2021') exclusive,
partition p2021 start ('2021') inclusive end ('2022') exclusive,
partition p2022 start ('2022') inclusive end ('2023') exclusive,
partition p2023 start ('2023') inclusive end ('2024') exclusive,
partition p2024 start ('2024') inclusive end ('2025') exclusive,
partition p2025 start ('2025') inclusive end ('2026') exclusive,
partition p2026 start ('2026') inclusive end ('2027') exclusive,
partition p2027 start ('2027') inclusive end ('2028') exclusive,
partition p2028 start ('2028') inclusive end ('2029') exclusive,
partition p2029 start ('2029') inclusive end ('2030') exclusive,
default partition default_p
);