dongjoon-hyun commented on code in PR #60380:
URL: https://github.com/apache/spark/pull/60380#discussion_r4553399595
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog/InMemoryTableWithV2Filter.scala:
##########
@@ -203,15 +214,36 @@ object InMemoryTableWithV2Filter {
}
}
+ /**
+ * Table property that lets an overwrite compare `CHAR_READ_SIDE_PADDING` of
a column with a
+ * literal, as a connector that pads the CHAR values stored without padding
would do.
+ */
+ val AcceptCharReadSidePaddingKey = "accept-char-read-side-padding"
+
+ private object CharReadSidePadding {
+ def unapply(expr: V2Expression): Option[(NamedReference, Int)] = expr
match {
+ case e: GeneralScalarExpression if e.name() ==
CharVarcharUtils.V2_CHAR_READ_SIDE_PADDING =>
+ e.children().toSeq match {
+ case Seq(ref: NamedReference, LiteralValue(length: Int, _), _) =>
Some((ref, length))
+ case _ => None
+ }
+ case _ => None
+ }
+ }
+
/**
* Whether every predicate has a shape [[evalPredicate]] can evaluate: a
plain column, or a
* column and a literal. A predicate over an expression, e.g. a cast, is not
supported and
* returned to Spark, as a real connector without expression support would
do.
*/
- def supportsPredicates(predicates: Array[Predicate]): Boolean = {
+ def supportsPredicates(
+ predicates: Array[Predicate],
+ acceptCharReadSidePadding: Boolean = false): Boolean = {
Review Comment:
Thank you. I updated the scaladoc to describe `acceptCharReadSidePadding`
and the `accept-char-read-side-padding` table property.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]