|
16 | 16 | build_date_delta, |
17 | 17 | no_last_day_sql, |
18 | 18 | DATE_ADD_OR_SUB, |
| 19 | + build_timetostr_or_tochar, |
19 | 20 | ) |
20 | 21 | from sqlglot.generator import unsupported_args |
21 | 22 | from sqlglot.helper import seq_get |
@@ -368,7 +369,7 @@ class Parser(parser.Parser): |
368 | 369 | "TRUNCATE": _build_trunc, |
369 | 370 | "VAR_POP": exp.VariancePop.from_arg_list, |
370 | 371 | "APPROXIMATE_COUNT_DISTINCT": exp.ApproxDistinct.from_arg_list, |
371 | | - "TO_CHAR": build_formatted_time(exp.ToChar, "exasol"), |
| 372 | + "TO_CHAR": build_timetostr_or_tochar, |
372 | 373 | "TO_DATE": build_formatted_time(exp.TsOrDsToDate, "exasol"), |
373 | 374 | # https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/convert_tz.htm |
374 | 375 | "CONVERT_TZ": lambda args: exp.ConvertTimezone( |
@@ -438,6 +439,9 @@ class Generator(generator.Generator): |
438 | 439 | exp.DataType.Type.DECIMAL128: "DECIMAL", |
439 | 440 | exp.DataType.Type.DECIMAL256: "DECIMAL", |
440 | 441 | exp.DataType.Type.DATETIME: "TIMESTAMP", |
| 442 | + exp.DataType.Type.TIMESTAMPTZ: "TIMESTAMP", |
| 443 | + exp.DataType.Type.TIMESTAMPLTZ: "TIMESTAMP", |
| 444 | + exp.DataType.Type.TIMESTAMPNTZ: "TIMESTAMP", |
441 | 445 | } |
442 | 446 |
|
443 | 447 | def datatype_sql(self, expression: exp.DataType) -> str: |
|
0 commit comments