-
- Downloads
[SPARK-20749][SQL] Built-in SQL Function Support - all variants of LEN[GTH]
## What changes were proposed in this pull request? This PR adds built-in SQL function `BIT_LENGTH()`, `CHAR_LENGTH()`, and `OCTET_LENGTH()` functions. `BIT_LENGTH()` returns the bit length of the given string or binary expression. `CHAR_LENGTH()` returns the length of the given string or binary expression. (i.e. equal to `LENGTH()`) `OCTET_LENGTH()` returns the byte length of the given string or binary expression. ## How was this patch tested? Added new test suites for these three functions Author: Kazuaki Ishizaki <ishizaki@jp.ibm.com> Closes #18046 from kiszk/SPARK-20749.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala 3 additions, 0 deletions...apache/spark/sql/catalyst/analysis/FunctionRegistry.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala 59 additions, 2 deletions...he/spark/sql/catalyst/expressions/stringExpressions.scala
- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/StringExpressionsSuite.scala 20 additions, 0 deletions...ark/sql/catalyst/expressions/StringExpressionsSuite.scala
- sql/core/src/test/resources/sql-tests/inputs/operators.sql 5 additions, 0 deletionssql/core/src/test/resources/sql-tests/inputs/operators.sql
- sql/core/src/test/resources/sql-tests/results/operators.sql.out 25 additions, 1 deletion...re/src/test/resources/sql-tests/results/operators.sql.out
Loading
Please register or sign in to comment