feat: add replace option to hive csv upload (#9764)

This commit is contained in:
Erik Ritter
2020-06-10 08:57:33 -07:00
committed by GitHub
parent 56397d75cc
commit e17da58a39
2 changed files with 33 additions and 1 deletions

View File

@@ -17,6 +17,8 @@
from unittest import mock
from superset.db_engine_specs.hive import HiveEngineSpec
from superset.exceptions import SupersetException
from superset.sql_parse import Table
from tests.db_engine_specs.base_tests import DbEngineSpecTestCase
@@ -162,3 +164,14 @@ class HiveTests(DbEngineSpecTestCase):
HiveEngineSpec.convert_dttm("TIMESTAMP", dttm),
"CAST('2019-01-02 03:04:05.678900' AS TIMESTAMP)",
)
def test_create_table_from_csv_append(self) -> None:
self.assertRaises(
SupersetException,
HiveEngineSpec.create_table_from_csv,
"foo.csv",
Table("foobar"),
None,
{},
{"if_exists": "append"},
)