Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Support the following PostgreSQL functions for parity with PostgreSQL 14:
- REGEXP_LIKE
- The Spark version of this is being implemented in
CALCITE-6278 - The PostgreSQL version requires supporting a 3-arg version that takes in flags.
- The Spark version of this is being implemented in
- REGEXP_REPLACE
- There is an existing implementation.
- PostgreSQL requires supporting an optional extra flags argument
- DATE_PART
- PostgreSQL and Redshift let the date_part parameter be a string instead of a just an enum-like identifier (eg DATE_PART('year', ...) and DATE_PART(year, ...) are both supported.
- SQL Server does not support using a string here.
- LOG
- We have the BigQuery implementation which has a 1-arg overload that uses base e (ln), and a 2-arg overload which is LOG(value, base)
- PostgreSQL's 1-arg version uses base 10 and the 2-arg overload has the order reversed – LOG(base, value)
- POW
- Our existing implementation always returns double.
- PostgreSQL allows returning a numeric instead of a double when inputs are numeric. Not sure if this makes sense though.
- RANDOM
- This is an alias for RAND(), except it should not support passing in a seed.
- TO_CHAR
- TO_DATE
- TO_TIMESTAMP
- PostgreSQL supports different format strings than the version we have implemented.
Attachments
1.
|
Add REGEXP_LIKE function (enabled in MySQL, Oracle, PostgreSQL and Spark libraries) | Resolved | James Duong | |
2.
|
Add REGEXP_REPLACE function (enabled in PostgreSQL library) | Open | James Duong | |
3.
|
Support PostgreSQL DATE_PART | Open | Unassigned | |
4.
|
Support PostgreSQL LOG | Open | Caican Cai | |
5.
|
Add POWER function for PostgreSQL | In Progress | Norman Jordan | |
6.
|
Add RANDOM function (enabled in Postgres library) | Resolved | James Duong | |
7.
|
Support PostgreSQL TO_DATE, TO_TIMESTAMP | Resolved | Unassigned | |
8.
|
Support all PostgreSQL 14 date/time patterns for to_char | Open | Norman Jordan | |
9.
|
Support all PostgreSQL 14 date/time patterns for to_date/to_timestamp | In Progress | Norman Jordan |