Alright got it. I have working code that gets passed in a list of columns,
and returns a result set which works all the way to the JDBC driver.
This is starting to make a lot more sense, thanks for the help. Now to add
some complexity. How can I pass in a function as a parameter? Basically
the interface to the compare function above but acting on a row, ie
Function2[String, Object, Boolean] (col, value, include). Am I thinking
about this the right way?
/* 1 */ net.hydromatic.optiq.DataContext root;
/* 2 */
/* 3 */ public net.hydromatic.linq4j.Enumerable bind(final
net.hydromatic.optiq.DataContext root0) {
/* 4 */ root = root0;
/* 5 */ return ((test.RocksDbTableQueryable)
net.hydromatic.optiq.Schemas.queryable(root,
root.getRootSchema().getSubSchema("rdb"), java.lang.Object[].class,
"EVENTS")).createQuery(0L, 9223372036854775807L,
net.hydromatic.optiq.runtime.FlatLists.of(new org.eigenbase.util.Pair[] {
/* 6 */ new org.eigenbase.util.Pair(
/* 7 */ "ts",
/* 8 */ java.lang.Long.class),
/* 9 */ new org.eigenbase.util.Pair(
/* 10 */ "type",
/* 11 */ java.lang.String.class),
/* 12 */ new org.eigenbase.util.Pair(
/* 13 */ "bar",
/* 14 */ java.lang.String.class),
/* 15 */ new org.eigenbase.util.Pair(
/* 16 */ "foo",
/* 17 */ java.lang.String.class)}), null);
/* 18 */ }
/* 19 */
/* 20 */
/* 21 */ public java.lang.reflect.Type getElementType() {
/* 22 */ return java.lang.Object[].class;
/* 23 */ }
/* 24 */
/* 25 */
On Thu, Oct 2, 2014 at 4:52 PM, Julian Hyde <[email protected]> wrote:
> Let’s work on getting the simplest possible query working, which I presume
> is “select k, c from t”, and have your enumerable completely ignore
> projects and filters and always return the row key and the value for one
> hard-coded column c. Once you have cracked code generation, you will find
> it easy to generalize. Run with ‘-Dcalcite.debug=true’ and it will print
> out the generated code before it executes.
>
> Julian
--
Dan Di Spaltro