Skip to content

Support for i8, Time. Documented PIVOT operation.#383

Merged
mihaibudiu merged 2 commits into
mainfrom
i8
Jul 25, 2023
Merged

Support for i8, Time. Documented PIVOT operation.#383
mihaibudiu merged 2 commits into
mainfrom
i8

Conversation

@mihaibudiu
Copy link
Copy Markdown
Contributor

This started as a simple effort to document the PIVOT operation, but snowballed.
The example tests I found required support for Time and I8 (TINYINT).
So I added these too.
In the process I realized that the work done to add new types grows quadratically, since casts need to go from any type to any type, so I used more Rust macros to simplify the process.
We don't yet have time functions, but I didn't claim that we are done with Time yet.

@mihaibudiu mihaibudiu requested a review from lalithsuresh July 21, 2023 04:16
@mihaibudiu
Copy link
Copy Markdown
Contributor Author

I find it a bit ugly that I had to leak Decimal into the dbsp algebra crate, but that's where mul_by_weigh trait is defined... and Rust doesn't let you put it elsewhere.

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
} catch (CalciteContextException e) {
this.messages.reportError(e);
if (this.options.optimizerOptions.throwOnError) {
System.err.println(this.messages.toString());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be logging these instead of reporting to stderr?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually just for debugging. The 'throwOnError' flag is only designed for development.
The effect of this is to print in the IDE console some much nicer errors in addition to a stack trace:

(no input file): Error parsing SQL
(no input file):23:17: error: Error parsing SQL: Encountered "," at line 23, column 17.
Was expecting:
    "IN" ...
    
   23|        FOR name, age) IN (('John', 30) AS c1, ('Mike', 40) AS c2)
                      ^^

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
@mihaibudiu
Copy link
Copy Markdown
Contributor Author

I have no idea why this CI run failed, I will merge my code anyway.

@mihaibudiu mihaibudiu merged commit 163140b into main Jul 25, 2023
@mihaibudiu mihaibudiu deleted the i8 branch July 25, 2023 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants