got to know the answer. The answer is the above won't work if it is run in a proper cluster. I was testing it locally using intellij without a flink cluster. Hence intellij runs it using local JVM, everything horizontally accessible to process function. But if we run the above in a cluster the FlinkTableEnvSingleton.getTable won't be accessible from an process fucntion and returns a null.