上一页 1 ··· 58 59 60 61 62 63 64 65 66 ··· 81 下一页
摘要: # -*- coding: UTF-8 -*- import time import phoenixdb import psycopg2 import pymysql from urllib.parse import urlparse """ 将数据库的连接信息组装成一个connection对象 " 阅读全文
posted @ 2020-05-20 20:40 Mars.wang 阅读(157) 评论(0) 推荐(0) 编辑
摘要: class HadoopCommand(object): def __init__(self, path, command=HADOOP_COMMAND_PATH): self.command = command self.path = path def remove(self): command_ 阅读全文
posted @ 2020-05-20 20:35 Mars.wang 阅读(858) 评论(0) 推荐(0) 编辑
摘要: command+shift+P:查看变量类型(Scala) 阅读全文
posted @ 2020-05-14 13:41 Mars.wang 阅读(108) 评论(0) 推荐(0) 编辑
摘要: public static Map<String,String> loadDataFromFile() { Map<String,String> map = new ConcurrentHashMap<>(); try { File file = new File("filename.txt"); 阅读全文
posted @ 2020-05-12 10:57 Mars.wang 阅读(674) 评论(0) 推荐(0) 编辑
摘要: //spark读取数据 Dataset<Row> df = spark.read().textFile(currentSrcPath, 1); Dataset<Row> df = spark.read().json(path); Dataset<Row> df = spark.read().orc( 阅读全文
posted @ 2020-05-08 17:39 Mars.wang 阅读(563) 评论(0) 推荐(0) 编辑
摘要: locals()局部变量 globals()全局变量 vars() 阅读全文
posted @ 2020-04-27 10:22 Mars.wang 阅读(116) 评论(0) 推荐(0) 编辑
摘要: # 视图的基础函数——HttpResponse from django.http import HttpResponse def current_datetime(request): now = datetime.datetime.now() html = "<html><body>It is no 阅读全文
posted @ 2020-04-24 15:45 Mars.wang 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 转自:https://blog.51cto.com/ljbaby/2348663 接口类 面向对象中的继承有两种用途:1)可以通过继承做到代码重用,并完成扩展;2)接口继承。所谓的接口继承就是定义一个接口类 Interface,接口类中定义了一些接口(就是函数,但这些函数都没有具体的实现),子类继承 阅读全文
posted @ 2020-04-24 12:01 Mars.wang 阅读(216) 评论(0) 推荐(0) 编辑
摘要: #zk监控 import json from datetime import datetime, timedelta from kazoo.client import KazooClient from kazoo.exceptions import NoNodeError def canal_mon 阅读全文
posted @ 2020-04-22 19:58 Mars.wang 阅读(1072) 评论(0) 推荐(0) 编辑
摘要: 之前一直困惑于python类在继承中冗长的参数,经过研究airflow的代码,发现是可以进行优化的. Father类有两个必选参数src,dst,和一个默认参数concurrency, 子类有两个必选参数target_db, target_tb,在子类的初始化方法__init__中只需要有targe 阅读全文
posted @ 2020-04-22 15:20 Mars.wang 阅读(3085) 评论(0) 推荐(0) 编辑
上一页 1 ··· 58 59 60 61 62 63 64 65 66 ··· 81 下一页