问题:azkaban调用时报错,找不到HiveHook,报错FAILED: RuntimeException Error loading hooks(hive.exec.post.hooks): java.lang.ClassNotFoundException: org.apache.atlas.hive.hook.HiveHook

解决:因为在配置atlas时对hive的配置文件进行了各节点分发

方法:

因为atlas只需要配置一个节点,所以修改的hive/conf目录下的配置文件不需要分发,删除就可以了

问题:azkaban调度任务的时候报错:hive: command not found

解决:azkaban启动时未在azkaban-exec目录下启动

方法:

cd /opt/module/azkaban/azkaban-exec/
bin/start-exec.sh
curl -G 'hadoop102:12321/executor?action=activate' && echo
cd /opt/module/azkaban/azkaban-web
bin/start-web.sh

注意:必须到每个节点进行启动

阅读全文

问题:sqlalchemy.exc.ArgumentError: Mapper mapped class UserTotal->user_total could not assemble any primary key columns for mapped

解决:sqlalchemy的model不能没有primary_key

方法:

class UserTotal(Base):
    __tablename__ = "user_total"

    dt = Column(Date, nullable=False)
    recent_days = Column(Integer, nullable=False)
    login_num_count = Column(BigInteger)
    page_count = Column(BigInteger)

    __mapper_args__ = { 
        'primary_key': [dt, recent_days]
    }

问题:pydantic如何让字段只允许几个固定的值

解决:python3 内置的enum 模块可以支持枚举类型

方法:

from enum import Enum, IntEnum

class dayEnum(IntEnum):
    all = 0 
    one = 1 
    seven = 7 
    month = 30

class DaySchema(BaseModel):
    day: dayEnum=all

阅读全文