Skip to content
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

[GLUTEN-6813][CH] Support soundex function #7093

Merged
merged 4 commits into from
Sep 5, 2024
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 @@ -207,7 +207,6 @@ object CHExpressionUtil {
URL_ENCODE -> DefaultValidator(),
FORMAT_STRING -> FormatStringValidator(),
SKEWNESS -> DefaultValidator(),
SOUNDEX -> DefaultValidator(),
MAKE_YM_INTERVAL -> DefaultValidator(),
MAP_ZIP_WITH -> DefaultValidator(),
ZIP_WITH -> DefaultValidator(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2936,5 +2936,11 @@ class GlutenClickHouseTPCHSaltNullParquetSuite extends GlutenClickHouseTPCHAbstr
checkBHJWithIsNullAwareAntiJoin(df)
})
}

test("soundex") {
runQueryAndCompare("select soundex(c_mktsegment) from customer limit 50") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
}
}
// scalastyle:on line.size.limit
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ REGISTER_COMMON_SCALAR_FUNCTION_PARSER(LT, lt, less);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(And, and, and);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Or, or, or);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Equal, equal, equals);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Not, not, not);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Not, not, not );
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Xor, xor, xor);

REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Cast, cast, CAST);
Expand Down Expand Up @@ -134,6 +134,7 @@ REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Uuid, uuid, generateUUIDv4);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Levenshtein, levenshtein, editDistanceUTF8);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(FormatString, format_string, printf);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Concat, concat, concat);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(SoundEx, soundex, soundex);

REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Crc32, crc32, CRC32);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Murmur3Hash, murmur3hash, sparkMurmurHash3_32);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,9 @@ class ClickHouseTestSettings extends BackendTestSettings {
.exclude("ParseUrl")
.exclude("SPARK-33468: ParseUrl in ANSI mode should fail if input string is not a valid url")
.exclude("FORMAT") // refer https://github.com/apache/incubator-gluten/issues/6765
.exclude(
"soundex unit test"
) // CH and spark returns different results when input non-ASCII characters
.excludeGlutenTest("SPARK-40213: ascii for Latin-1 Supplement characters")
enableSuite[GlutenTryCastSuite]
.exclude("null cast")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,9 @@ class ClickHouseTestSettings extends BackendTestSettings {
.exclude("ParseUrl")
.exclude("SPARK-33468: ParseUrl in ANSI mode should fail if input string is not a valid url")
.exclude("FORMAT") // refer https://github.com/apache/incubator-gluten/issues/6765
.exclude(
"soundex unit test"
) // CH and spark returns different results when input non-ASCII characters
enableSuite[GlutenTryCastSuite]
.exclude("null cast")
.exclude("cast string to date")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,9 @@ class ClickHouseTestSettings extends BackendTestSettings {
.exclude("ParseUrl")
.exclude("SPARK-33468: ParseUrl in ANSI mode should fail if input string is not a valid url")
.exclude("FORMAT") // refer https://github.com/apache/incubator-gluten/issues/6765
.exclude(
"soundex unit test"
) // CH and spark returns different results when input non-ASCII characters
enableSuite[GlutenDataSourceV2DataFrameSessionCatalogSuite]
enableSuite[GlutenDataSourceV2SQLSessionCatalogSuite]
enableSuite[GlutenDataSourceV2SQLSuiteV1Filter]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,9 @@ class ClickHouseTestSettings extends BackendTestSettings {
.exclude("ParseUrl")
.exclude("SPARK-33468: ParseUrl in ANSI mode should fail if input string is not a valid url")
.exclude("FORMAT") // refer https://github.com/apache/incubator-gluten/issues/6765
.exclude(
"soundex unit test"
) // CH and spark returns different results when input non-ASCII characters
enableSuite[GlutenDataSourceV2DataFrameSessionCatalogSuite]
enableSuite[GlutenDataSourceV2SQLSessionCatalogSuite]
enableSuite[GlutenDataSourceV2SQLSuiteV1Filter]
Expand Down
Loading