Explorar o código

[hive] Do not create test DBs if they already exists

Romain Rigaux %!s(int64=10) %!d(string=hai) anos
pai
achega
1a9d4df
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      apps/beeswax/src/beeswax/test_base.py

+ 2 - 2
apps/beeswax/src/beeswax/test_base.py

@@ -370,8 +370,8 @@ class BeeswaxSampleProvider(object):
     if _INITIALIZED:
       return
 
-    make_query(cls.client, 'CREATE DATABASE %(db)s' % {'db': cls.db_name}, wait=True)
-    make_query(cls.client, 'CREATE DATABASE %(db)s_other' % {'db': cls.db_name}, wait=True)
+    make_query(cls.client, 'CREATE DATABASE IF NOT EXISTS %(db)s' % {'db': cls.db_name}, wait=True)
+    make_query(cls.client, 'CREATE DATABASE IF NOT EXISTS %(db)s_other' % {'db': cls.db_name}, wait=True)
 
     data_file = cls.cluster.fs_prefix + u'/beeswax/sample_data_échantillon_%d.tsv'