Move table from InnoDB to Memory
Yes:

ALTER TABLE the_table ENGINE=MEMORY;


That said, I must strongly advice against doing this because the contents of memory tables are lost once the MariaDB server is shut down.

InnoDB is perfect for having some rows in memory and some on disk: It will put as much into memory as it can, and if there isn't enough memory for all of them, then it will only keep those that are accessed the most frequently. Also, it will persist the data to disk so that it's not lost when the MariaDB server is shut down.