implement create schema functionality

'port' from vanilla java library