Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ object CHExpressionUtil {

final val CH_BLACKLIST_SCALAR_FUNCTION: Map[String, FunctionValidator] = Map(
SPLIT_PART -> DefaultValidator(),
TO_PRETTY_STRING -> DefaultValidator(),
TO_UNIX_TIMESTAMP -> UnixTimeStampValidator(),
UNIX_TIMESTAMP -> UnixTimeStampValidator(),
SEQUENCE -> SequenceValidator(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,8 @@ class VeloxTestSettings extends BackendTestSettings {
.exclude("SPARK-41048: Improve output partitioning and ordering with AQE cache")
// Rewrite this test since it checks the physical operator which is changed in Gluten
.exclude("SPARK-27439: Explain result should match collected result after view change")
// https://github.com/apache/incubator-gluten/issues/11570
.exclude("getRows: binary")
enableSuite[GlutenDataFrameTimeWindowingSuite]
enableSuite[GlutenDataFrameTungstenSuite]
enableSuite[GlutenDataFrameWindowFunctionsSuite]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import scala.util.Random

class GlutenDataFrameSuite extends DataFrameSuite with GlutenSQLTestsTrait {

import testImplicits._

testGluten("repartitionByRange") {
val partitionNum = 10
withSQLConf(
Expand Down Expand Up @@ -235,6 +237,16 @@ class GlutenDataFrameSuite extends DataFrameSuite with GlutenSQLTestsTrait {
}
}

testGluten("getRows: binary") {
val df = Seq(
("12".getBytes(StandardCharsets.UTF_8), "ABC.".getBytes(StandardCharsets.UTF_8)),
("34".getBytes(StandardCharsets.UTF_8), "12346".getBytes(StandardCharsets.UTF_8))
).toDF()
val expectedAnswer =
Seq(Seq("_1", "_2"), Seq("[31 32]", "[41 42 43 2E]"), Seq("[33 34]", "[31 32 33 34 36]"))
assert(df.getRows(10, 20) === expectedAnswer)
}

// TODO: fix in spark-4.0
/** Failed to check WholeStageCodegenExec, so we rewrite the UT. */
// testGluten("SPARK-22520: support code generation for large CaseWhen") {
Expand All @@ -252,7 +264,6 @@ class GlutenDataFrameSuite extends DataFrameSuite with GlutenSQLTestsTrait {
// // We check WholeStageTransformer instead of WholeStageCodegenExec
// assert(df.queryExecution.executedPlan.find(_.isInstanceOf[WholeStageTransformer]).isDefined)
// }
import testImplicits._

private lazy val person2: DataFrame = Seq(
("Bob", 16, 176),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,8 @@ class VeloxTestSettings extends BackendTestSettings {
.exclude("SPARK-41048: Improve output partitioning and ordering with AQE cache")
// Rewrite this test since it checks the physical operator which is changed in Gluten
.exclude("SPARK-27439: Explain result should match collected result after view change")
// https://github.com/apache/incubator-gluten/issues/11570
.exclude("getRows: binary")
enableSuite[GlutenDataFrameTimeWindowingSuite]
enableSuite[GlutenDataFrameTungstenSuite]
enableSuite[GlutenDataFrameWindowFunctionsSuite]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,16 @@ class GlutenDataFrameSuite extends DataFrameSuite with GlutenSQLTestsTrait {
}
}

testGluten("getRows: binary") {
val df = Seq(
("12".getBytes(StandardCharsets.UTF_8), "ABC.".getBytes(StandardCharsets.UTF_8)),
("34".getBytes(StandardCharsets.UTF_8), "12346".getBytes(StandardCharsets.UTF_8))
).toDF()
val expectedAnswer =
Seq(Seq("_1", "_2"), Seq("[31 32]", "[41 42 43 2E]"), Seq("[33 34]", "[31 32 33 34 36]"))
assert(df.getRows(10, 20) === expectedAnswer)
}

// TODO: fix in spark-4.0
// private def withExpr(newExpr: Expression): Column = new Column(newExpr)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ object ExpressionNames {
final val MASK = "mask"
final val FORMAT_STRING = "format_string"
final val LUHN_CHECK = "luhn_check"
final val TO_PRETTY_STRING = "to_pretty_string"

// URL functions
final val PARSE_URL = "parse_url"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ class Spark35Shims extends SparkShims {
Sig[CheckOverflowInTableInsert](ExpressionNames.CHECK_OVERFLOW_IN_TABLE_INSERT),
Sig[ArrayAppend](ExpressionNames.ARRAY_APPEND),
Sig[UrlEncode](ExpressionNames.URL_ENCODE),
Sig[UrlDecode](ExpressionNames.URL_DECODE)
Sig[UrlDecode](ExpressionNames.URL_DECODE),
Sig[ToPrettyString](ExpressionNames.TO_PRETTY_STRING)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class Spark40Shims extends SparkShims {
Sig[ArrayAppend](ExpressionNames.ARRAY_APPEND),
Sig[UrlEncode](ExpressionNames.URL_ENCODE),
Sig[KnownNotContainsNull](ExpressionNames.KNOWN_NOT_CONTAINS_NULL),
Sig[UrlDecode](ExpressionNames.URL_DECODE)
Sig[UrlDecode](ExpressionNames.URL_DECODE),
Sig[ToPrettyString](ExpressionNames.TO_PRETTY_STRING)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ class Spark41Shims extends SparkShims {
Sig[ArrayAppend](ExpressionNames.ARRAY_APPEND),
Sig[UrlEncode](ExpressionNames.URL_ENCODE),
Sig[KnownNotContainsNull](ExpressionNames.KNOWN_NOT_CONTAINS_NULL),
Sig[UrlDecode](ExpressionNames.URL_DECODE)
Sig[UrlDecode](ExpressionNames.URL_DECODE),
Sig[ToPrettyString](ExpressionNames.TO_PRETTY_STRING)
)
}

Expand Down
Loading