Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Incomplete
-
2.4.3
-
None
Description
For a partitioned table, such as:
table test (c1 int, c2 string) partitioned by (c3 Int)
If we use a cast operation in query, which cast the partitioned column, such as :
select * from test where (cast c3 as string) = '0'
One predication of this query is cast(c3 as string) = ’0‘.
It would invoke this method to convert to a filter.
case op @ SpecialBinaryComparison(ExtractAttribute(NonVarcharAttribute(name)), ExtractableLiteral(value)) => Some(s"$name ${op.symbol} $value")
First, it invokes the ExtractAttribute.unapply to judge whether c3 can be casted to string, the result is yes.
Then it would invoke the origin NonVarcharAttribute, because the hivevar type of c3 is not varchar,
this prediction will be converted to c3 = "0", and pushed down.
But, Filtering is supported only on partition keys of type string, so it would trigger an exception.
Attachments
Issue Links
- links to