# Function Desc : HDFS操作模块
#
# History       :
#                 20181224  zhaogx     Create
#
# Remarks       :
################################################################################
import datetime
import traceback

from hdfs.ext.kerberos import KerberosClient

from didp_logger import Logger

# 全局变量
LOG = Logger()

class HdfsOperator(KerberosClient):
    """ HDFS Kerberos客户端操作类(继承自hdfs.ext.kerberos.KerberosClient)
    
    Attributes:

    """

if __name__ == '__main__':
    h = HdfsOperator('http://kbapc001:50070;http://kbapc002:50070', principal='hive')

    a = h.list("/")
    print a

# Write By      : adtec(zhaogx)
# Function Desc : ddl操作类
#
# History       :
#                 20181127  xiazhy     Create
#
# Remarks       :
################################################################################
import re
import os
import xml.dom.minidom

from didp_logger import Logger
from didp_tools import generate_common_ddl_type

LOG = Logger()


class DDLFileParser:
    """ DDL文件解析类
    Attributes:
    """

    # ddl文件类型: 1-SQL文件 2-XML文件 3-JSON文件 4-STD检核后生成
    __ddl_file_type = ""
    __file = ""
    # 目标数据库类型 Inceptor/db2
    __tar_db_type = "INCEPTOR"

    def __init__(self, fname, file_type="XML"):
        self.__file = fname