上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 30 下一页
摘要: dayofweek在hive2.2.0开始支持低版本的sparksql和hive中可用以下方式实现 select 7- datediff(next_day('2018-03-12',"Sunday"),'2018-03-12'). select date_format('2018-03-12' ,' 阅读全文
posted @ 2020-09-29 15:34 PEAR2020 阅读(601) 评论(0) 推荐(0)
摘要: pom.xml中 <!-- https://mvnrepository.com/artifact/com.google.guava/guava --> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifa 阅读全文
posted @ 2020-09-29 15:21 PEAR2020 阅读(403) 评论(0) 推荐(0)
摘要: select * from global_temp.TABLE_NAME 阅读全文
posted @ 2020-09-29 14:48 PEAR2020 阅读(301) 评论(0) 推荐(0)
摘要: 一、Dataset 特定域对象中的强类型集合 // 1.DS=> RDD + schema val spark = SparkSession.builder().master("local[2]").appName("test").getOrCreate() val rdd = spark.spar 阅读全文
posted @ 2020-09-27 21:51 PEAR2020 阅读(281) 评论(0) 推荐(0)
摘要: val pi:Double = scala.math.Pi println pi #3.14159265358979 val pi1:String = pi.formatted("%.3f") #保留3位小数,3可随意指定 println pi1 #"3.142" val pi11:String = 阅读全文
posted @ 2020-09-26 18:11 PEAR2020 阅读(3106) 评论(0) 推荐(0)
摘要: 一、如何确定按姓分区的Partitioner?为什么不能用HashPartitioner? 1. 根据余数测试,得知: 结论:[1到num]% num 一定是不一样的分区值,[>num] % num 的分区一定会有重复 2. 为什么不能用HashPartitioner -> 应该取substring 阅读全文
posted @ 2020-09-25 17:37 PEAR2020 阅读(254) 评论(0) 推荐(0)
摘要: 可能是spark2.3.4版本和hive1.1.0不匹配,在环境变量里配置SPARK_HOME后hive启动会寻找到这个环境变量并且匹配什么的 所以解决办法就是把SPARK_HOME从环境变量里删掉! 阅读全文
posted @ 2020-09-25 14:47 PEAR2020 阅读(745) 评论(0) 推荐(0)
摘要: spark2.0版本之后,原有lib目录下的spark-assembly-*.jar包被拆成多个jar包,存放路径是在spark的jars目录下。解决方案:进入hive安装目录:(我的目录是/usr/local/hive)cd /usr/local/hivecd ./bin编辑hive >>> 将s 阅读全文
posted @ 2020-09-25 14:38 PEAR2020 阅读(671) 评论(0) 推荐(0)
摘要: 当我们输入./schematool -initSchema -dbType mysql的时候,会出现以下错误 Metastore connection URL: jdbc:mysql://192.168.*./hive?createDatabaseIfNotExist=trueMetastore C 阅读全文
posted @ 2020-09-25 14:36 PEAR2020 阅读(873) 评论(0) 推荐(0)
摘要: 1,setting.xml 文件需要先进记事本去掉中文空格,再写进来 2,先central镜像再nexus作为辅助 <mirrors> <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> 阅读全文
posted @ 2020-09-21 16:40 PEAR2020 阅读(145) 评论(0) 推荐(0)
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 30 下一页