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

朝阳周边网站建设色盲测试图及答案大全

朝阳周边网站建设,色盲测试图及答案大全,太仓网页制作招聘,wordpress更新插件背景 大数据平台的租户要使用udf,他们用beeline连接, 意味着要通过hs2,但如果有多个hs2,各个hs2之间不能共享,需要先把文件传到hdfs,然后手动在各hs2上create function。之后就可以永久使用了,…

背景

大数据平台的租户要使用udf,他们用beeline连接,
意味着要通过hs2,但如果有多个hs2,各个hs2之间不能共享,需要先把文件传到hdfs,然后手动在各hs2上create function。之后就可以永久使用了,重启hs2也可以

调研

先查的hive官网

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-CreatingCustomUDFs
在这里插入图片描述
用beeline执行add jar 和create function,但发现只在当前的hs2生效

然后查cdh官网

cdh的官网上说配UDF,需要考虑是否重启hs2,是否启用sentry,列出了3种方案。
https://docs.cloudera.com/documentation/enterprise/latest/topics/cm_mc_hive_udf.html
在这里插入图片描述
Direct JAR reference configuration
Straight-forward, but recommended for development only. Does not support Sentry.
试了下,是永久的,重启仍然生效,但只对当前的hs2有效,如果有多个hs2,需要在每个hs2上都执行create function命令
虽然我们开了sentry,但没影响,sentry仍然有效

pom

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>org.example</groupId><artifactId>sm3UDF</artifactId><version>1.0</version><packaging>jar</packaging><name>sm3UDF</name><url>http://maven.apache.org</url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk15on</artifactId><version>1.68</version></dependency><dependency><groupId>org.apache.hadoop</groupId><artifactId>hadoop-common</artifactId><version>3.1.1</version></dependency>
<!--        <dependency>-->
<!--            <groupId>junit</groupId>-->
<!--            <artifactId>junit</artifactId>-->
<!--            <version>4.13.2</version>-->
<!--            <scope>test</scope>-->
<!--        </dependency>--><dependency><groupId>org.apache.hive</groupId><artifactId>hive-exec</artifactId><version>2.1.1-cdh6.3.2</version></dependency></dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.1</version><configuration><source>1.8</source><target>1.8</target></configuration></plugin></plugins></build>
</project>

java

package org.picc.encrypt;import org.apache.commons.codec.binary.Hex;
import org.apache.hadoop.io.Text;
import org.bouncycastle.crypto.digests.SM3Digest;
import org.apache.hadoop.hive.ql.exec.UDF;public class Sm3Fun extends UDF{public static String sm3(String saltBefore, String text, String saltAfter) {if (text == null) {return null;}Text result = new Text();SM3Digest digest = new SM3Digest();Text sb = new Text(saltBefore);Text value = new Text(text);Text sa = new Text(saltAfter);byte[] hashData = new byte[32];digest.reset();digest.update(sb.getBytes(), 0, sb.getLength());digest.update(value.getBytes(), 0, value.getLength());digest.update(sa.getBytes(), 0, sa.getLength());digest.doFinal(hashData, 0);String sm3Hex = Hex.encodeHexString(hashData);result.set(sm3Hex);return result.toString();}public String evaluate(String text) {if (text == null) {return null;}Text result = new Text();SM3Digest digest = new SM3Digest();Text value = new Text(text);byte[] hashData = new byte[32];digest.reset();digest.update(value.getBytes(), 0, value.getLength());digest.doFinal(hashData, 0);String sm3Hex = Hex.encodeHexString(hashData);result.set(sm3Hex);return result.toString();}
}
http://www.hkea.cn/news/136830/

相关文章:

  • 网站做cdn怎么弄百度推广怎么推广
  • 光谷做网站推广竞价服务托管公司
  • 网上商城网站建设方案书公众号seo排名
  • wordpress内网访问泰州百度关键词优化
  • 做淘客网站用备案网络营销计划书怎么写
  • 网站 公安 备案深圳百度推广客服电话多少
  • 北京米兰广告设计有限公司广州优化疫情防控举措
  • 汕头个人建站模板网站推广计划方法
  • php企业网站无限制源码网络营销方案设计
  • 动漫网站开发与建设百度网盘网页版入口官网
  • 咸阳做网站长沙网络营销外包哪家好
  • 专门做私人定制旅游的网站搜索引擎营销方法
  • 注册安全工程师管理系统网奇seo赚钱培训
  • 武汉市住房和城乡建设厅官方网站生猪价格今日猪价
  • 住房和城乡建设部网站诚信评价搜索引擎优化人员优化
  • 网站制作 太原网络营销专业课程
  • 做网站去哪个公司网络营销策划书的结构
  • 个人无网站怎样做cps广告深圳全网推广公司
  • 中国人可以做的c2c网站上海网站排名推广
  • 网站建设目标定位公司员工培训方案
  • 美工培训班学百度自然搜索排名优化
  • 网站建设自学多长时间搜索引擎营销的过程
  • 做cpa的网站源码seo的外链平台有哪些
  • 那个网站做外贸最好成都网站建设方案外包
  • 企业网站建设效益分析联合早报 即时消息
  • html5网页成品代码自媒体seo优化
  • 门户网站建设招投标网络seo啥意思
  • 游戏币销售网站建设百度热搜seo
  • 线上投票链接怎么做厦门搜索引擎优化
  • 网页设计课程主要内容seo学校