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

feat: add support for empty list literals #227

Merged

Conversation

patientstreetlight
Copy link
Contributor

The substrait proto definition provides a representation of empty list literals which is separate from the
representation of non-empty list literals:

message Literal {
  oneof literal_type {
    ...
    List list = 30;
    Type.List empty_list = 31;
    ...
  }
}

This change gives substrait-java a representation for empty list literals, along with conversions to/from
protobuf and to/from Calcite in Isthmus.

BREAKING CHANGE:

  • ExpressionVisitor has a new method to visit Expression.EmptyListLiteral. Implementors which don’t extend AbstractExpressionVisitor will have to add their own implementation.
  • Public class LiteralConstructorConverter now requires a TypeConverter to be passed to its constructor.
  • ExpressionCopyOnWriteVisitor#visitLiteral() may now be called with Expression.EmptyListLiteral.

@CLAassistant
Copy link

CLAassistant commented Feb 9, 2024

CLA assistant check
All committers have signed the CLA.

@patientstreetlight patientstreetlight force-pushed the chris.rice/empty-array-literal branch 2 times, most recently from c44b090 to f0c3bf8 Compare February 12, 2024 15:45
@patientstreetlight patientstreetlight force-pushed the chris.rice/empty-array-literal branch from f0c3bf8 to 4a92e2b Compare February 12, 2024 20:22
Copy link
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

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

Overall this looks good. I do have some questions and suggestion in various places.

@patientstreetlight patientstreetlight force-pushed the chris.rice/empty-array-literal branch from 9e1fa06 to 43ed4b2 Compare February 15, 2024 19:00
BREAKING CHANGE:
* ExpressionVisitor has a new method to visit Expression.EmptyListLiteral.
  Implementors which don’t extend AbstractExpressionVisitor will have to
  add their own implementation.
* Public class LiteralConstructorConverter now requires a TypeConverter to
  be passed to its constructor.
* ExpressionCopyOnWriteVisitor#visitLiteral() may now be called with
  Expression.EmptyListLiteral.
@patientstreetlight patientstreetlight force-pushed the chris.rice/empty-array-literal branch from 43ed4b2 to b19ad8b Compare February 16, 2024 21:43
Copy link
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

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

Thanks for adding this in! Changes look good 🎉

@vbarua vbarua merged commit 2a98e3c into substrait-io:main Feb 16, 2024
8 checks passed
@patientstreetlight patientstreetlight deleted the chris.rice/empty-array-literal branch February 20, 2024 16:44
ajegou pushed a commit to ajegou/substrait-java that referenced this pull request Mar 29, 2024
BREAKING CHANGE: ExpressionVisitor now has a `visit(Expression.EmptyListLiteral)` method
BREAKING CHANGE: LiteralConstructorConverter constructor now requires a TypeConverter
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.

4 participants