Fix https://github.com/julianhyde/optiq/issues/222, "User-defined table macros".
Convert uses of NL in tests to Linux newline "\n". This makes string constants simpler.
Fix https://github.com/julianhyde/optiq/issues/223, "Add NOTICE and LICENSE files in all generated JAR files".

Also fix filtering in net-hydromatic-optiq-jdbc.properties, and remove a spurious copy of that file.
Test view and sub-query with ORDER BY and LIMIT.
Fix https://github.com/julianhyde/optiq/pull/227, "Extend extract function to support DateTime data types".
Extend PlannerImpl to pass a custom ConvertletTable.

Add test to SqlOperatorBaseTest.
Use a singleton in StandardConvertletTable.
Implement EXTRACT for DATE, TIME and TIMESTAMP values.
Fix julian date formula for dates before 1900-03-01.
Add test case for https://github.com/julianhyde/optiq/pull/230.
Fix https://github.com/julianhyde/optiq/pull/230, "RemoveSortRule derives trait set from sort, should derive it from sort's child".

There was also a bug in the test case; it was asking for un-sorted output, and it got it!
Fix https://github.com/julianhyde/optiq/issues/229, "Join between different JDBC schemas not implementable".

A JdbcConvention was registered when the first JdbcTableScan was registered, but the other instance of JdbcConvention (for the other data source) was not, because it was not the first instance of class JdbcTableScan. The solution was to add a RelTrait.register(RelOptPlanner) method. It is called for each trait present in the initial RelNode tree.

Test case contributed by Bruno Dumon.

This is a breaking change. Classes that implement RelTrait will need to add a 'register(RelOptPlanner)' method.
Fix https://github.com/julianhyde/optiq/issues/226, "User-defined functions should work without explicit schema prefix".

Each schema now has a path, which is a list of schemas to look in when resolving functions. The default path of each schema is itself, but you can override by setting the "path" attribute of a JSON schema. It is a list, and its elements are either strings or lists of strings: the empty list means the root schema, a singleton list or a string means a level 1 schema, and so forth.
Obsolete RexImpTable.AggregateImplementor.
Fix https://github.com/julianhyde/optiq/issues/237, "Allow user-defined aggregate functions (UDAs) to be defined in a model".
Fix https://github.com/julianhyde/optiq/issues/228, "Error while compiling generated Java code when using UDF in expression"
Add SqlUnresolvedFunction, to improve how return type of user-defined functions is resolved.

Even though SqlValidator had overload detection and type resolution logic it did not fire since function.getFunctionType() == null was always false.
Convert CombinerParser.jj into freemarker template to allow custom parser implementations.
Improve CompositeList type-safety.
Fix https://github.com/julianhyde/optiq/issues/232, "Sum and avg of empty set should be null as per SQL specification".

We achieve this by replacing 'SUM(x)' by 'CASE COUNT(*) = 0 THEN NULL ELSE SUM0(x) END' if it is possible for the group to be empty (either x is nullable or the aggregate query applies to the whole table), where SUM0 is an aggregate operator similar to SUM but returns 0 if applied to the empty set.
Fix translation of SUM and SUM0 in MongoDB.