-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-21110][SQL] Structs, arrays, and other orderable datatypes should be usable in inequalities #18818
[SPARK-21110][SQL] Structs, arrays, and other orderable datatypes should be usable in inequalities #18818
Changes from all commits
cf29fc5
0d1fd56
d1c7565
ec8dc95
caf74bf
c4f43e9
cc2f3ec
6e01186
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,18 +78,6 @@ private[sql] class TypeCollection(private val types: Seq[AbstractDataType]) | |
|
||
private[sql] object TypeCollection { | ||
|
||
/** | ||
* Types that can be ordered/compared. In the long run we should probably make this a trait | ||
* that can be mixed into each data type, and perhaps create an `AbstractDataType`. | ||
*/ | ||
// TODO: Should we consolidate this with RowOrdering.isOrderable? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious: Do we need to do anything with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, |
||
val Ordered = TypeCollection( | ||
BooleanType, | ||
ByteType, ShortType, IntegerType, LongType, | ||
FloatType, DoubleType, DecimalType, | ||
TimestampType, DateType, | ||
StringType, BinaryType) | ||
|
||
/** | ||
* Types that include numeric types and interval type. They are only used in unary_minus, | ||
* unary_positive, add and subtract operations. | ||
|
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.
The acceptable types in
TypeUtils.getInterpretedOrdering
are less thanRowOrdering.isOrderable
. It only acceptsAtomicType
,ArrayType
andStructType
.NullType
,UserDefinedType
can cause problems.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.
As
ordering
is lazily accessed, and any nulls don't lead us to access it in those predicates,NullType
should be safe. We should add related test.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.
addressed in cc2f3ec