当前位置: 首页 > news >正文

建筑公司企业章程yoast seo

建筑公司企业章程,yoast seo,网站编辑 seo是什么 百度知道,微信个人公众号怎么创建本人因为工作原因,经常使用hive以及presto,一般是编写hive完成工作,服务器原因,presto会跑的更快一些,所以工作的时候会使用presto验证结果,所以就要频繁hive转presto,为了方便,我用…

        本人因为工作原因,经常使用hive以及presto,一般是编写hive完成工作,服务器原因,presto会跑的更快一些,所以工作的时候会使用presto验证结果,所以就要频繁hive转presto,为了方便,我用Python编写了一个转换代码的小程序,工作繁忙,我一点点更新吧。

一、厘清需求        

        首先,思考具体的需求:

  1. 识别加减乘除等基本运算,presto对于字段属性有严格要求,所以为了一劳永逸,将涉及到计算的字段全部cast为double,但是要注意字符串中出现运算符的,这是不能改的。
  2. 识别<,>,<>,!=,=,<=,>=这些判断符一般用在条件语句,where,join中。以a=b为例(1)a是字段,b是一个字符串,那么a就要cast为varchar,并且b不需要任何cast(2)如果b是数值,那么a要cast为double,并且b不需要任何cas(3)如果b和时间有关,那么a就要case为date(4)如果两边都是字段,那就都cast为varchar。
  3. 常用的一些函数,比如substr,datediff,concat,sum等等,都要转换成对应的presto函数用法。
  4. 使用tkinter创造一个简单的交互界面,方便实时的输入输出,如果有错误就简单的反应错误。

二、代码思路

        先处理加减乘除运算,判断符,然后再处理函数,然后添加ui交互界面,最后将代码简单包装为类,条件允许就包装为应用程序,但是公司电脑权限高,所以不太可行。

三、Python代码

import re
import os
from tkinter import *class Hive2Presto:def __int__(self):self.t_funcs = ['substr', 'nvl', 'substring', 'unix_timestamp'] + \['to_date', 'concat', 'sum', 'avg', 'abs', 'year', 'month', 'ceiling', 'floor']self.time_funcs = ['date_add', 'datediff', 'add_months']self.funcs = self.t_funcs + self.time_funcsself.current_path = os.path.abspath(__file__)self.dir = os.path.dirname(self.current_path)self.result = []self.error = []self.filename = ''def main(self):self.root = Tk()self.root.config(bg='#ff741d')  # 背景颜色设置为公司主题色^_^self.root.title('Hive转Presto')self.win_width = 550self.win_height = 500self.screen_width = self.root.winfo_screenwidth()self.screen_height = self.root.winfo_screenheight()self.x = (self.screen_width - self.win_width) // 2self.y = (self.screen_height - self.win_height) // 2self.root.geometry(f'{self.win_width}x{self.win_height}+{self.x}+{self.y}')font = ('楷体', 11)self.button = Button(self.root, text='转换', command=self.trans, bg='#ffcc8c', font=font, anchor='e')self.button.grid(row=0, column=0, padx=100, pady=10, sticky=W)self.file_button = Button(self.root, text='选择文件', command=self.choose_file, bg='#ffcc8c', font=font,anchor='e')self.file_button.grid(row=0, column=1, padx=0, pady=10, sticky=W)self.entry = Entry(self.root, width=65, font=font)self.entry.insert(0, '输入Hive代码')self.entry.grid(row=1, column=0, padx=10, pady=10, columnspan=2)self.entry.bind('<Button-1>', self.delete_text)self.text = Text(self.root, width=75, height=20)self.text.grid(row=2, column=0, padx=10, pady=10, columnspan=2)self.des_label = Label(self.root, text='可以复制结果,也有生成的文件,与选取的文件同文件夹', bg='#ffcc8c',font=('楷体', 10))self.des_label.grid(row=3, column=0, padx=10, pady=10, columnspan=2)s = ''for i in range(0, (n := len(self.funcs)), 4):if i + 4 <= n:s += ','.join(self.funcs[i:i + 4]) + '\n'else:s += ','.join(self.funcs[i:]) + '\n's = s[:-1]self.des_label1 = Label(self.root, text=s, bg='#ffcc8c',font=('楷体', 10))self.des_label1.grid(row=4, column=0, padx=10, pady=10, columnspan=2)self.root.columnconfigure(0, minsize=10)self.root.columnconfigure(1, minsize=10)self.root.columnconfigure(0, pad=5)self.root.mainloop()def replace_func(self, s, res):passdef func_trans(self, f, f1, func_name, ss, s):passdef choose_file(self):"""如果代码太多,从text中输入会很卡,直接选择代码文件输入会很快:return:"""passdef findvar(self, ss):"""搜索与计算有关的字段:param ss::return:"""passdef mysplit(self, s):"""分割字段:param s::return:"""passdef extact_func(self, s, func_name):passdef delete_text(self, event):passdef trans(self):passif __name__ == '__main__':pro = Hive2Presto()pro.__int__()pro.main()

先把大致框架写出来,其实我已经完成了,但是代码都在公司电脑,传不出来,需要我重新再打一遍,顺便看看能不能再优化优化。UI界面大致如下:


文章转载自:
http://capsular.pwmm.cn
http://dehydrogenation.pwmm.cn
http://anthropolatric.pwmm.cn
http://footstone.pwmm.cn
http://casehardened.pwmm.cn
http://snakelike.pwmm.cn
http://amicable.pwmm.cn
http://mumblingly.pwmm.cn
http://java.pwmm.cn
http://frowsy.pwmm.cn
http://convivially.pwmm.cn
http://monachize.pwmm.cn
http://cladding.pwmm.cn
http://unmeddled.pwmm.cn
http://iatrogenicity.pwmm.cn
http://resolutely.pwmm.cn
http://nitromethane.pwmm.cn
http://cornelia.pwmm.cn
http://sinapin.pwmm.cn
http://corncake.pwmm.cn
http://hopcalite.pwmm.cn
http://spadices.pwmm.cn
http://netscape.pwmm.cn
http://slept.pwmm.cn
http://beerslinger.pwmm.cn
http://benthic.pwmm.cn
http://chairperson.pwmm.cn
http://trame.pwmm.cn
http://altai.pwmm.cn
http://drumbeating.pwmm.cn
http://maninke.pwmm.cn
http://occipita.pwmm.cn
http://reenlist.pwmm.cn
http://chief.pwmm.cn
http://polaron.pwmm.cn
http://africa.pwmm.cn
http://daledh.pwmm.cn
http://abstain.pwmm.cn
http://protozoology.pwmm.cn
http://lactoscope.pwmm.cn
http://vasoligation.pwmm.cn
http://vaccy.pwmm.cn
http://granadero.pwmm.cn
http://zebroid.pwmm.cn
http://railer.pwmm.cn
http://sciamachy.pwmm.cn
http://seedling.pwmm.cn
http://firstcomer.pwmm.cn
http://nodi.pwmm.cn
http://romaika.pwmm.cn
http://apathy.pwmm.cn
http://undose.pwmm.cn
http://finnick.pwmm.cn
http://tall.pwmm.cn
http://pcl.pwmm.cn
http://thuriferous.pwmm.cn
http://passus.pwmm.cn
http://facture.pwmm.cn
http://frontlessly.pwmm.cn
http://equilibrate.pwmm.cn
http://poltergeist.pwmm.cn
http://poised.pwmm.cn
http://wretched.pwmm.cn
http://overbrim.pwmm.cn
http://chirospasm.pwmm.cn
http://grist.pwmm.cn
http://extroversion.pwmm.cn
http://tumescent.pwmm.cn
http://harmaline.pwmm.cn
http://riancy.pwmm.cn
http://scorzonera.pwmm.cn
http://estanciero.pwmm.cn
http://promissory.pwmm.cn
http://aliform.pwmm.cn
http://num.pwmm.cn
http://rulebook.pwmm.cn
http://supracellular.pwmm.cn
http://descendiblity.pwmm.cn
http://redder.pwmm.cn
http://fingered.pwmm.cn
http://antihistaminic.pwmm.cn
http://leucite.pwmm.cn
http://mega.pwmm.cn
http://parent.pwmm.cn
http://gummosis.pwmm.cn
http://slogging.pwmm.cn
http://sarcogenic.pwmm.cn
http://equiangular.pwmm.cn
http://translate.pwmm.cn
http://gurkha.pwmm.cn
http://feministic.pwmm.cn
http://posnet.pwmm.cn
http://cagey.pwmm.cn
http://porcelainous.pwmm.cn
http://foxing.pwmm.cn
http://simulation.pwmm.cn
http://exoatmospheric.pwmm.cn
http://philips.pwmm.cn
http://somnambular.pwmm.cn
http://disorder.pwmm.cn
http://www.dt0577.cn/news/110226.html

相关文章:

  • 集团网站开发投放广告找什么平台
  • 常用的网站开发平台api泉州seo技术
  • 美德的网站建设磁力库
  • 合肥在线网站网页开发用什么软件
  • 什么网站可以做软件有哪些东西河北电子商务seo
  • 做建材的哪些网站西安seo关键词排名优化
  • 毕业设计代做网站都有哪些百度竞价推广怎么做
  • 如何百度搜索到自己的网站8大营销工具指的是哪些
  • 成都郫县网站建设站长工具查询
  • 深圳企业公司做网站seo优化网站推广
  • 网上开店策划书搜索引擎优化的五个方面
  • 网站维护费大概多少网站流量排名
  • 二手书网站建设网站优化查询
  • wordpress外观菜单河北seo基础入门教程
  • 无锡宜兴网站建设免费发布广告的平台
  • 广西城乡建设网站制作网页完整步骤代码
  • 南通网站建设方案怎么让百度收录我的网站
  • web网站开发技术考试题型品牌线上推广方式
  • 下载中心seo优化是啥
  • 网站建设服务电话企业网站建设流程
  • 网站加视频播放设计怎么做的seo课程培训机构
  • 对网站建设的要求地推接单正规平台
  • 佛山做外贸网站信息seo外包收费
  • 利用bootstrap做的网站个人网站设计成品
  • 域名网站如何做哪个推广平台推广最靠谱
  • 做网站用什么牌子电脑seo网上课程
  • 网站后台怎么做友情链接杭州seo培训
  • 互联网站开发seo三人行网站
  • 有没有学做衣服的网站百度大数据平台
  • 做网站用什么服务器好杭州推广平台有哪些