-
Notifications
You must be signed in to change notification settings - Fork 74
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!: handle user-defined types in Isthmus #149
feat!: handle user-defined types in Isthmus #149
Conversation
ffbbd4f
to
b8a4561
Compare
Change SummaryUpdated the As part of this change, I renamed Additionally, I've simplified the resolution of URIs for types by injecting the URI directly into the ObjectMapper. This came up because types in FuncArgs were being created without URIs, and propagating the resolution to them was harder than just getting rid of it entirely. See |
b8a4561
to
1cdd1d1
Compare
.addAllTypes( | ||
extensionSignatures.types().stream() | ||
.map(t -> t.resolve(namespace)) | ||
.collect(java.util.stream.Collectors.toList())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually, I would like to remove the need for function resolution as well.
return convert(type, typeExpression, null); | ||
public RelDataType toCalcite( | ||
RelDataTypeFactory relDataTypeFactory, TypeExpression typeExpression) { | ||
return toCalcite(relDataTypeFactory, typeExpression, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This takes a RelDataTypeFactory
, rather than bundling it in the TypeConverter
itself, because not everywhere where you would want to build a TypeConverter
has easy access to one of these factories, but everywhere you want to call toCalcite
does.
* Utility factory for creating user-defined types implementing {@link RelDataTypeImpl}, correctly. | ||
* Used for creating types as part of testing. | ||
*/ | ||
public class UserTypeFactory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of boilerplate to implementing a RelDataType
in Calcite, so I made a factory for them (for testing only).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confession, this is a bit of a rubberstamp. Feels like it is better to get this in and iterate if we figure out it needs improvements later. It has been hanging open too long.
On my end, I'm more than happy to make any fixes and improvements as the need arises 🙇 |
* feat: user-defined type handling * test: user-defined type conversion * refactor: inject URI into extension parser * refactor: inject URI into type string parser * test: verify custom types in functions roundtrip BREAKING CHANGE: TypeConverter no longer uses static methods BREAKING CHANGE: SimpleExtension.MAPPER has been replaced with SimpleExtension.objectMapper(String namespace)
BREAKING CHANGE: TypeConverter no longer uses static methods
BREAKING CHANGE: SimpleExtension.MAPPER has been replaced
with SimpleExtension.objectMapper(String namespace)