added aggregation and window function support.
Fix ambiguous function retrival bug.