LazyGenius
New Contributor III

I found weird behavior here while creating table using SQL
If you are creating new table and have added partition column at the last of the column mapping it won't work but if you add it at the beginning it will work!!
For example :-
Below query will work - 

 

CREATE TABLE IF NOT EXISTS schema_name.table_name 
( id BIGINT,
partition_column STRING,
other_column1 DOUBLE,
other_column2 DOUBLE
)
USING ICEBERG
PARTITIONED BY (partition_column);

But this following one will give same error as you got - 

 

CREATE TABLE IF NOT EXISTS schema_name.table_name 
( id BIGINT,
other_column1 DOUBLE,
other_column2 DOUBLE,
partition_column STRING
)
USING ICEBERG
PARTITIONED BY (partition_column);

So, you can try the same in pyspark keep the column which you will be partitioning in between of columns