MySQL replication : Query partially completed on the master (error on master: 1053)
If the query was OPTIMIZE TABLE table_name, there is no worry about data inconsistency. 
You can run SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; to skip the error on the slave, and re-run the optimization on each server by itself if needed. Use LOCAL so the statement is not replicated:

OPTIMIZE LOCAL TABLE table_name