1
0
Fork 0

Adding upstream version 23.7.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:30:02 +01:00
parent f1aa09959c
commit 27c061b7af
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
187 changed files with 86502 additions and 71397 deletions

View file

@ -235,15 +235,18 @@ class TestHive(Validator):
},
)
self.validate_all(
"'\\\\a'",
"'\\\\\\\\a'",
read={
"drill": "'\\\\\\\\a'",
"duckdb": "'\\\\a'",
"presto": "'\\\\a'",
},
write={
"drill": "'\\\\\\\\a'",
"duckdb": "'\\\\a'",
"hive": "'\\\\\\\\a'",
"presto": "'\\\\a'",
"hive": "'\\\\a'",
"spark": "'\\\\a'",
"spark": "'\\\\\\\\a'",
},
)
@ -369,7 +372,7 @@ class TestHive(Validator):
"UNIX_TIMESTAMP(x)",
write={
"duckdb": "EPOCH(STRPTIME(x, '%Y-%m-%d %H:%M:%S'))",
"presto": "TO_UNIXTIME(DATE_PARSE(x, '%Y-%m-%d %T'))",
"presto": "TO_UNIXTIME(COALESCE(TRY(DATE_PARSE(CAST(x AS VARCHAR), '%Y-%m-%d %T')), PARSE_DATETIME(CAST(x AS VARCHAR), 'yyyy-MM-dd HH:mm:ss')))",
"hive": "UNIX_TIMESTAMP(x)",
"spark": "UNIX_TIMESTAMP(x)",
"": "STR_TO_UNIX(x, '%Y-%m-%d %H:%M:%S')",
@ -563,7 +566,7 @@ class TestHive(Validator):
"LOCATE('a', x, 3)",
write={
"duckdb": "STRPOS(SUBSTR(x, 3), 'a') + 3 - 1",
"presto": "STRPOS(x, 'a', 3)",
"presto": "STRPOS(SUBSTR(x, 3), 'a') + 3 - 1",
"hive": "LOCATE('a', x, 3)",
"spark": "LOCATE('a', x, 3)",
},
@ -653,15 +656,6 @@ class TestHive(Validator):
"spark": "LN(10)",
},
)
self.validate_all(
"LOG(10, 2)",
write={
"duckdb": "LOG(10, 2)",
"presto": "LOG(10, 2)",
"hive": "LOG(10, 2)",
"spark": "LOG(10, 2)",
},
)
self.validate_all(
'ds = "2020-01-01"',
write={
@ -745,13 +739,12 @@ class TestHive(Validator):
)
def test_escapes(self) -> None:
self.validate_identity("'\n'")
self.validate_identity("'\n'", "'\\n'")
self.validate_identity("'\\n'")
self.validate_identity("'\\\n'")
self.validate_identity("'\\\n'", "'\\\\\\n'")
self.validate_identity("'\\\\n'")
self.validate_identity("''")
self.validate_identity("'\\\\'")
self.validate_identity("'\\z'")
self.validate_identity("'\\\\z'")
def test_data_type(self):