diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-14 05:43:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-14 05:43:02 +0000 |
commit | c8d4d4ead5df1c84966431eec8b88e974414dafc (patch) | |
tree | 847e292ab98fe79a3a78cd6797b564b73f4d2681 /sqlglot/dialects/dialect.py | |
parent | Releasing debian version 17.3.0-1. (diff) | |
download | sqlglot-c8d4d4ead5df1c84966431eec8b88e974414dafc.tar.xz sqlglot-c8d4d4ead5df1c84966431eec8b88e974414dafc.zip |
Merging upstream version 17.4.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/dialect.py')
-rw-r--r-- | sqlglot/dialects/dialect.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sqlglot/dialects/dialect.py b/sqlglot/dialects/dialect.py index 4fc93bf..5376dff 100644 --- a/sqlglot/dialects/dialect.py +++ b/sqlglot/dialects/dialect.py @@ -620,7 +620,16 @@ def concat_to_dpipe_sql(self: Generator, expression: exp.Concat | exp.SafeConcat return self.sql(this) -# Spark, DuckDB use (almost) the same naming scheme for the output columns of the PIVOT operator +def regexp_extract_sql(self: Generator, expression: exp.RegexpExtract) -> str: + bad_args = list(filter(expression.args.get, ("position", "occurrence", "parameters"))) + if bad_args: + self.unsupported(f"REGEXP_EXTRACT does not support the following arg(s): {bad_args}") + + return self.func( + "REGEXP_EXTRACT", expression.this, expression.expression, expression.args.get("group") + ) + + def pivot_column_names(aggregations: t.List[exp.Expression], dialect: DialectType) -> t.List[str]: names = [] for agg in aggregations: |