-
Notifications
You must be signed in to change notification settings - Fork 76
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
Create Attribute Type Rules for Interval Join, Scatter Plot, Sort Partitions, Type Casting #2005
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…xera into cli-attr-type-checking
# Conflicts: # core/new-gui/src/app/workspace/service/dynamic-schema/schema-propagation/schema-propagation.service.ts
- Interval Join - Scatter Plot - Sort Partitions - Type Casting
Fix checkAllConstraint condition
The `sum`, `average`, `min`, and `max` aggregation functions in the Aggregation operator should support all numeric types (integer, double, long, and timestamp). The code does support these types, but the `attributeTypeRules` injected did not include the timestamp type. This PR adds the timestamp type for these aggregation functions.
Yicong-Huang
approved these changes
Jun 19, 2023
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.
LGTM! the rules are very clear.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the second PR for the attribute type checking feature. The first one is #1924.
Description of Attribute Type Rules
Interval Join
leftAttributeName
(andrightAttributeName
) must beinteger
,long
,double
, ortimestamp
.And,
leftAttributeName
attribute must have the same type as therightAttributeName
.Note: We intentionally put
enum
test in front ofconst
test, because we want to test whether they have the correct type. Or, if we put theconst
test first, i.erightAttributeName
rule first, and ifleftAttributeName
's attribute type is an invalid type likestring
, then it will prompt the user thatrightAttributeName
should have the same attribute type asleftAttributeName
--string
-- which is incorrect since both should not be astring
type.Scatter Plot
xColumn
andyColumn
attributes must be ofinteger
ordouble
type.Note: it may support
long
in the future. See #1954.Sort Partitions
sortAttributeName
attribute type must beinteger
,long
, ordouble
.Note: May support
timestamp
in the future. See #1954.Type Casting
For example, if we want to convert an attribute to
integer
, it must have attribute type ofstring
,long
,double
, orboolean
. A type should not convert to the type itself. See the schema for detail.Note: The type constraint is enforced in
core/amber/src/main/scala/edu/uci/ics/texera/workflow/common/tuple/schema/AttributeTypeUtils.scala
.