当前位置:网站首页>Scala104 - Built-in datetime functions for Spark.sql
Scala104 - Built-in datetime functions for Spark.sql
2022-08-04 18:32:00 【51CTO】
Sometimes we use it directlydf.createOrReplaceTempView(temp)创建临时表,用sql去计算.sparkSQL有些语法和hql不一样,做个笔记.
- <scala.version>2.11.12</scala.version>
- <spark.version>2.4.3</spark.version>
timestamp转string
把timestampConvert to the corresponding format string
- date_format把timestamp转换成对应的字符串
- String format is used"yyyyMMdd"表示
timestamp转date
- to_date可以把timestamp转换成date类型
求时间差
- Day difference functiondatediff可以应用在timestamp中,Can also be applied in date类型中,The unit is natural days,而不是24小时
- month difference functionmonths_between同样可以,The monthly unit does not seem to be fixed,即31天or30天
Ref
2020-03-24 于南京市江宁区九龙湖
边栏推荐
- 股票开户广发证券,网上开户安全吗?
- 自己经常使用的三种调试:Pycharm、Vscode、pdb调试
- DHCP&OSPF组合实验演示(Huawei路由交换设备配置)
- PHP代码审计10—命令执行漏洞
- After EasyCVR is locally connected to the national standard device to map the public network, the local device cannot play and cascade the solution
- DHCP&OSPF combined experimental demonstration (Huawei routing and switching equipment configuration)
- 网页端IM即时通讯开发:短轮询、长轮询、SSE、WebSocket
- Flask框架实现注册加密功能详解【Flask企业课学习】
- 如何封装 svg
- How does EasyCVR call the double-speed playback of device recording through the interface?
猜你喜欢

老电脑怎么重装系统win10

阿里云国际版使用ROS搭建WordPress教程

浅谈web网站架构演变过程

CAN光纤转换器CAN光端机解决消防火灾报警

PHP代码审计9—代码执行漏洞

ptables基本语法使用规则

基于 eBPF 的 Kubernetes 可观测实践

How does the intelligent video surveillance platform EasyCVR use the interface to export iframe addresses in batches?

DHCP&OSPF combined experimental demonstration (Huawei routing and switching equipment configuration)

Flink / Scala - 使用 RedisSink 存储数据
随机推荐
The Industrial Metaverse Brings Changes to Industry
Introduction of three temperature measurement methods for PT100 platinum thermal resistance
图解LeetCode——899. 有序队列(难度:困难)
八猴渲染器是什么?它能干什么?八猴软件的界面讲解
离线同步odps到mysql 中文乱码是因为?mysql已是utf8mb4
flink-cdc支持并行读取一张mysql表的binlog不?
机器学习——线性回归
全球电子产品需求放缓:三星越南工厂大幅压缩产能
leetcode/含有所有字符的最短字符串
Literature Review on Involution of College Students
【杰神说说】物联大师2.0版本预告
巴比特 | 元宇宙每日必读:微博动漫将招募全球各类虚拟偶像并为其提供扶持...
OpenInfra Days China 2022 | SelectDB to share with you the Apache Doris in Internet advertising business practices
dotnet core 输出调试信息到 DebugView 软件
July 31, 2022 Summary of the third week of summer vacation
报道称任天堂在2023年3月前不会推出任何新硬件产品
Go language Go language, understand Go language file operation in one article
golang安装和基础配置
leetcode/有效的回文串,含有不需要判断回文的字符
DHCP&OSPF combined experimental demonstration (Huawei routing and switching equipment configuration)