This is much needed. Thanks for volunteering. Please log a jira case,
assign it to yourself, and go for it.

I think most of the errors relate to resolving names to tables and
columns, but data types might be other sources of error (e.g. using an
integer-typed expression as a WHERE clause, or applying '+' or
'SUBSTRING' to arguments of the wrong types) and there are a few cases
where columns need to match up on number and type (e.g. union).

In type checking, RelBuilder should allow the same implicit
conversions as SQL (e.g. integer + float is OK).

I haven't checked what happens if you reference a view or a schema in
a place that requires a table.

RelBuilder is currently case-sensitive when matching table and column
names, so test for that. In future we may allow case-insensitive
matching, which will require a different set of tests.

It seems to me that a good way to start is to write a test up front
for every dumb thing a user might do. I.e. test-driven development.

Julian


On Thu, Oct 22, 2015 at 7:21 AM, Andy Grove <[email protected]> wrote:
> First of all, congratulations on graduating :-)
>
> I was excited to see the news about the new builder API for building
> relational expressions and this opens up an opportunity for me to integrate
> Calcite in the next version of our product and gives me a reason to start
> contributing to the project.
>
> My goal is to create relational algebra from our product's SQL
> implementation. To get started, I tried adapting the RelBuilderExample and
> soon ran into a NullPointerException.
>
> After some digging, I understand the cause of the exception, and it is my
> mistake, but I think I should really be seeing a more helpful exception,
> such as an InvalidTableException with the message "Table FOO does not exist
> in schema BAR".
>
> This might be a good place for me to start contributing to help make it
> easier for first time users who are trying to integrate Calcite into their
> products.
>
> Before I start creating JIRA issues and pull requests, I wanted to ask if
> this is considered a useful effort and see if there were any particular
> standards for exceptions that I should follow.
>
>
> ```
> Exception in thread "main" java.lang.NullPointerException
> at
> org.apache.calcite.rel.logical.LogicalTableScan.create(LogicalTableScan.java:98)
> at
> org.apache.calcite.rel.core.RelFactories$TableScanFactoryImpl.createScan(RelFactories.java:331)
> at org.apache.calcite.tools.RelBuilder.scan(RelBuilder.java:476)
> ```
>
> Thanks,
>
> Andy.
>
> --
>
> Andy Grove
> Chief Architect
> AgilData - Simple Streaming SQL that Scales
> www.agildata.com

Reply via email to