osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calcite example code


Here's another one focused on basic query optimization

https://github.com/michaelmior/calcite-notebooks/blob/master/query-optimization.ipynb

--
Michael Mior
mmior@xxxxxxxxxx


Le mer. 19 déc. 2018 à 18:21, Michael Mior <mmior@xxxxxxxxxx> a écrit :

> Yes the notebook contains the output (it's really just a JSON file). It
> doesn't necessarily have to have output, but it's much more useful if it
> does since it means whoever is viewing doesn't need to execute it. It would
> certainly be possible to use this for tests although it would require an
> installation of Python. Given how ubiquitous Python is, I don't think this
> is a huge concern, although we'd need a way of installing a couple Python
> dependencies.
>
> As Kevin mentioned, you can execute these online with Binder. I just had
> to add a Dockerfile so it could run the IJava kernel since it not the
> default. Check out the link below and you can see what the experience is
> like.
>
> https://mybinder.org/v2/gh/michaelmior/calcite-notebooks/master
>
> Just select a notebook once it loads (it may take a couple minutes). The
> experience is basically the same as what you get when running locally. The
> notebook consists of a series of "cells" which you can run individually and
> edit as you wish. This would also make it easy for people to play around
> with Calcite a little without having to install anything.
>
> --
> Michael Mior
> mmior@xxxxxxxxxx
>
>
> Le mer. 19 déc. 2018 à 17:22, Julian Hyde <jhyde@xxxxxxxxxx> a écrit :
>
>> For old idiots like me, can you explain how the notebook works? The file
>> you checked into GitHub, does it contain the input and output or just the
>> input? Is there a way to edit or use the notebook interactively?
>>
>> It certainly seems a better way to introduce people to examples than
>> saying “go look at this test”.
>>
>> I think quite a few of our tests could be converted into this format.
>>
>> Julian
>>
>>
>> > On Dec 19, 2018, at 10:52 AM, Michael Mior <mmior@xxxxxxxxxx> wrote:
>> >
>> > After seeing so many people ask for example code to do certain basic
>> things
>> > in Calcite, I've been trying to find a good literate programming
>> solution
>> > for Java as I like this approach for demoing. I recently came across the
>> > IJava (https://github.com/SpencerPark/IJava) kernel for Jupyter
>> notebooks.
>> >
>> > This is basically just a proof of concept at this point, but here's a
>> > simple example
>> >
>> >
>> https://github.com/michaelmior/calcite-notebooks/blob/master/Query%20parsing.ipynb
>> >
>> > I'm curious what others think of this approach. If others think it
>> would be
>> > useful, I'd be happy to take suggestions on what should be included.
>> > Eventually, I'd like to get CI set up for this repository so I can
>> re-run
>> > the notebooks at will. I would then aim to check this on every release
>> so
>> > we can have a repository of code samples which we know run correctly.
>> >
>> > --
>> > Michael Mior
>> > mmior@xxxxxxxxxx
>>
>>