exasol / databricks-virtual-schema

Virtual Schema for connecting Databricks as a data source to Exasol
MIT License
0 stars 0 forks source link

Add support for capabilities FN_PRED_LIKE and FN_PRED_LIKE_ESCAPE #25

Closed kaklakariada closed 1 month ago

kaklakariada commented 1 month ago

The LIKE operator in Databricks behaves differently than Exasol: Exasol uses ? for exactly one char, Databricks uses _ instead. See https://docs.databricks.com/en/sql/language-manual/functions/like.html :

The pattern is a string which is matched literally, with exception to the following special symbols: _ matches any one character in the input (similar to . in POSIX regular expressions) % matches zero or more characters in the input (similar to .* in POSIX regular expressions). The default escape character is the '\'. If an escape character precedes a special symbol or another escape character, the following character is matched literally. It is invalid to escape any other character.

To support capabilities FN_PRED_LIKE and FN_PRED_LIKE_ESCAPE the VS must convert the placeholder char, considering the default or custom escape char.

kaklakariada commented 1 month ago

This is not required because Exasol uses the same placeholers _ and %, see https://docs.exasol.com/db/latest/sql_references/predicates/not_like.htm

See #21