fix query language generation
add examples from artem on cbreset
add aggregate and scalar functions