diff --git a/backends-clickhouse/src/main/scala/org/apache/gluten/expression/CHExpressionTransformer.scala b/backends-clickhouse/src/main/scala/org/apache/gluten/expression/CHExpressionTransformer.scala index ab9fdd29f6aa..762160110f53 100644 --- a/backends-clickhouse/src/main/scala/org/apache/gluten/expression/CHExpressionTransformer.scala +++ b/backends-clickhouse/src/main/scala/org/apache/gluten/expression/CHExpressionTransformer.scala @@ -125,12 +125,6 @@ case class CHStringTranslateTransformer( throw new GlutenNotSupportException(s"$original not supported yet.") } - val matchingLiteral = matchingNode.asInstanceOf[StringLiteralNode].getValue - val replaceLiteral = replaceNode.asInstanceOf[StringLiteralNode].getValue - if (matchingLiteral.length() != replaceLiteral.length()) { - throw new GlutenNotSupportException(s"$original not supported yet.") - } - super.doTransform(args) } } diff --git a/backends-clickhouse/src/test/scala/org/apache/gluten/execution/compatibility/GlutenClickhouseFunctionSuite.scala b/backends-clickhouse/src/test/scala/org/apache/gluten/execution/compatibility/GlutenClickhouseFunctionSuite.scala index 2437ffd03550..8f2658ef8f24 100644 --- a/backends-clickhouse/src/test/scala/org/apache/gluten/execution/compatibility/GlutenClickhouseFunctionSuite.scala +++ b/backends-clickhouse/src/test/scala/org/apache/gluten/execution/compatibility/GlutenClickhouseFunctionSuite.scala @@ -415,4 +415,18 @@ class GlutenClickhouseFunctionSuite extends GlutenClickHouseTPCHAbstractSuite { } } + test("GLUTEN-7755: translate support args with unequal length") { + withTable("test_7755") { + sql("create table if not exists test_7755 (id string) using parquet") + sql("insert into test_7755 values('aAbBcC')") + compareResultsAgainstVanillaSpark( + """ + |select translate(id, 'abc', '12') from test_7755 + """.stripMargin, + true, + { _ => } + ) + } + } + }