Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISTHMUS] ClassCastException when converting ORDER BY clause which isn't a column reference #192

Open
patientstreetlight opened this issue Oct 31, 2023 · 0 comments · May be fixed by #235

Comments

@patientstreetlight
Copy link
Contributor

The substrait for a SQL query like:

SELECT c FROM t ORDER BY c + 1

is currently failing to convert to calcite with a ClassCastException, since it doesn't expect the ORDER BY clause to be arbitrarily complex expressions, only RexSlots.

java.lang.ClassCastException: class org.apache.calcite.rex.RexLiteral cannot be cast to class org.apache.calcite.rex.RexSlot (org.apache.calcite.rex.RexLiteral and org.apache.calcite.rex.RexSlot are in unnamed module of loader 'app')
	at io.substrait.isthmus.SubstraitRelNodeConverter.toRelFieldCollation(SubstraitRelNodeConverter.java:347)
	at io.substrait.isthmus.SubstraitRelNodeConverter.lambda$visit$7(SubstraitRelNodeConverter.java:318)

Full substrait file:
class-cast-exception.json

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 a pull request may close this issue.

1 participant