12345678910111213141516171819202122232425262728293031323334 |
- from app.core.datasource.datasource import DataSourceBase
- from app.core.datasource.hive import HiveDS
- from configs.settings import DefaultOption, config
- from utils import flat_map
- HOST = config.get('HIVE', 'HOST')
- PORT = config.get('HIVE', 'PORT')
- USERNAME = config.get('HIVE', 'USERNAME')
- PASSWORD = config.get('HIVE', 'PASSWORD')
- DATABASE_NAME = config.get('HIVE', 'DATABASE_NAME')
- KERBEROS = config.get('HIVE', 'KERBEROS')
- KEYTAB = config.get('HIVE', 'KEYTAB', vars=DefaultOption(config, 'HIVE', KEYTAB = None))
- KRB5CONFIG = config.get('HIVE', 'KRB5CONFIG', vars=DefaultOption(config, 'HIVE', KRB5CONFIG = None))
- KERBEROS_SERVICE_NAME = config.get('HIVE', 'KERBEROS_SERVICE_NAME', vars=DefaultOption(config, 'HIVE', KERBEROS_SERVICE_NAME = None))
- PRINCIPAL = config.get('HIVE', 'PRINCIPAL', vars=DefaultOption(config, 'HIVE', PRINCIPAL = None))
- ZOOKEEPER_ENABLE = config.get('HIVE', 'ZOOKEEPER_ENABLE', vars=DefaultOption(config, 'HIVE', ZOOKEEPER_ENABLE = 0))
- ZOOKEEPER_HOSTS = config.get('HIVE', 'ZOOKEEPER_HOSTS', vars=DefaultOption(config, 'HIVE', ZOOKEEPER_HOSTS = None))
- ZOOKEEPER_NAMESPACE = config.get('HIVE', 'ZOOKEEPER_NAMESPACE', vars=DefaultOption(config, 'HIVE', ZOOKEEPER_NAMESPACE = None))
- hiveDs = HiveDS(**{'type': 'hive',
- 'host': HOST,
- 'port': PORT,
- 'username': USERNAME,
- 'password': PASSWORD,
- 'database_name': DATABASE_NAME,
- 'kerberos': KERBEROS,
- 'keytab': KEYTAB,
- 'krb5config': KRB5CONFIG,
- 'kerberos_service_name': KERBEROS_SERVICE_NAME,
- 'principal':PRINCIPAL,
- 'path_type': 'local',
- 'zookeeper_enable': ZOOKEEPER_ENABLE,
- 'zookeeper_hosts': ZOOKEEPER_HOSTS,
- 'zookeeper_namespace': ZOOKEEPER_NAMESPACE})
|