diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-07 12:35:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-07 12:35:01 +0000 |
commit | 58c11f70074708344e433080e47621091a6dcd84 (patch) | |
tree | 2589166e0e58be4947e07a956d26efa497bccaf2 /sqlglot/dialects/hive.py | |
parent | Adding upstream version 11.4.5. (diff) | |
download | sqlglot-58c11f70074708344e433080e47621091a6dcd84.tar.xz sqlglot-58c11f70074708344e433080e47621091a6dcd84.zip |
Adding upstream version 11.5.2.upstream/11.5.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/hive.py')
-rw-r--r-- | sqlglot/dialects/hive.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sqlglot/dialects/hive.py b/sqlglot/dialects/hive.py index 68137ae..c39656e 100644 --- a/sqlglot/dialects/hive.py +++ b/sqlglot/dialects/hive.py @@ -261,6 +261,7 @@ class Hive(Dialect): "SIZE": exp.ArraySize.from_arg_list, "SPLIT": exp.RegexpSplit.from_arg_list, "TO_DATE": format_time_lambda(exp.TsOrDsToDate, "hive"), + "TO_JSON": exp.JSONFormat.from_arg_list, "UNIX_TIMESTAMP": format_time_lambda(exp.StrToUnix, "hive", True), "YEAR": lambda args: exp.Year(this=exp.TsOrDsToDate.from_arg_list(args)), } @@ -281,6 +282,7 @@ class Hive(Dialect): exp.DataType.Type.DATETIME: "TIMESTAMP", exp.DataType.Type.VARBINARY: "BINARY", exp.DataType.Type.TIMESTAMPTZ: "TIMESTAMP", + exp.DataType.Type.BIT: "BOOLEAN", } TRANSFORMS = { @@ -305,6 +307,7 @@ class Hive(Dialect): exp.Join: _unnest_to_explode_sql, exp.JSONExtract: rename_func("GET_JSON_OBJECT"), exp.JSONExtractScalar: rename_func("GET_JSON_OBJECT"), + exp.JSONFormat: rename_func("TO_JSON"), exp.Map: var_map_sql, exp.Max: max_or_greatest, exp.Min: min_or_least, @@ -343,6 +346,7 @@ class Hive(Dialect): exp.SerdeProperties: lambda self, e: self.properties(e, prefix="WITH SERDEPROPERTIES"), exp.NumberToStr: rename_func("FORMAT_NUMBER"), exp.LastDateOfMonth: rename_func("LAST_DAY"), + exp.National: lambda self, e: self.sql(e, "this"), } PROPERTIES_LOCATION = { |