calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Di Spaltro <dan.dispal...@gmail.com>
Subject Re: Filter push
Date Tue, 07 Oct 2014 00:02:43 GMT
Do you think this would make more sense to follow in the footsteps of the
spark model, since it's more about generating code that is run via spark
RDD's vs translating queries from one language to another (in the case of
Mongo/splunk)?  I haven't worked on SQL/DB engines before so the
terminology/codegen/model is a bit foreign. As always, a good example
helps. I also can't tell what shape the spark adapter is in.

Thanks for the help,

-Dan

On Thu, Oct 2, 2014 at 6:55 PM, Dan Di Spaltro <dan.dispaltro@gmail.com>
wrote:

> 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 <julian@hydromatic.net> 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
>



-- 
Dan Di Spaltro

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message