fix the logic of create anonymous and Test the QueryProvider class

1.fix the logic of create anonymous.
2.Test the QueryProvider class.