https://delta.io logo
m

Mohit Yadav

03/09/2023, 12:13 PM
has anyone faced this issue in OPTIMIZE :
Copy code
Predicate references non-partition column 'customerid'. Only the partition columns may be referenced: []
OPTIMIZE works for partitioned columns only.??....i am using unpartioned table
j

JosephK (exDatabricks)

03/09/2023, 12:18 PM
You can optimize an entire table. The predicate is if you want to optimize a partition at a time instead of the full table. Are you trying to zorder by customerid?
m

Mohit Yadav

03/09/2023, 12:20 PM
i am trying to optimize using where clause on customerid.....zorder also gives same error with where clause
j

JosephK (exDatabricks)

03/09/2023, 12:22 PM
Optimize changes the files and does some compaction. The where clause if the data is partitioned, it lets you do it part by part instead of the entire table. If the data is not partitioned, you can’t put a where clause and would just do
Copy code
optimize tablename
👍 1
5 Views