当前位置:网站首页>Impala common commands (continuous updating)
Impala common commands (continuous updating)
2022-04-21 13:53:00 【Big meow who wants to lie flat every day】
impala Common commands
1, Table field
see
- Check the contents of the table , Field type , Field description, etc
describe TableName
conditional
Null Judge
NVL(X, Y)/ ifnull(X, Y)/isnull(X, Y)
When X Not NULL When to return to X Value , Otherwise return to Y Value .coalesce(X, Y, Z, ...)
Returns the first non in the input parameter NULL value , If all input parameters areNULL, Then return toNULL.nullif(X, Y)
If two expressions are equal , Then return to NULL. If two expressions are not equal , Returns the value of the first expression . The data types of the two expressions must remain compatible . in addition , The first expression cannot be null NULL, If it is NULL, Will never match the second expression .
This function is usually used in division expressions to prevent the divisor from being zero . for exampleselect 1.0 /nullif(expr,0) as rate from table_xxxxx
Numerical expression
nullifzero(numeric expr)
If the expression is 0, Then return to NULL; If the expression is non-zero , Returns the expression itself . The return type is the same as the original return value type . If the return value is an integer, it will be promoted to BIGINT type , if FLOAT Type I will be promoted to DOUBLE type . If the corresponding column is not allowed to be like BIGINT perhaps DOUBLE Such a high-precision type , Need to use CAST() Function to cast .zeroifnull(numeric expr)
If the expression is NULL, Then return to 0, If the expression is not NULL, Returns the expression itself . Note that the expression type should be numeric.
Boolean value
if(boolean expression , Return value when true , False or null Return value at time )istrue(boolean), isfalse(boolean), isnottrue(boolean), isnotfalse(boolean)
To choice
case when ... then ... [else when ... then ...] else ... end
Mathematical functions
Type conversion
cast(X as type)
Type conversionto_date(string)
String to date
Statistics
NDV()
Returns a value similar to COUNT(DISTINCT col ) The approximate value of the result .
2, Lookup table
Find all tables containing some strings in the stock out
show tables in DataBase like '*abc*'
3, Table partitioning
Check the partition
show partitions TableName;
Reference resources :
https://blog.csdn.net/zy103118/article/details/101028394
版权声明
本文为[Big meow who wants to lie flat every day]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211348394602.html
边栏推荐
猜你喜欢

Vagrant detailed tutorial

Vagrant detailed tutorial

POI and easyexcel reading and writing test

STM32单片机初学5-IIC通信驱动OLED屏幕

Esp32 development learning based on vscode (V): detailed explanation of user-defined event cycle and dedicated task

基于数值微分和误差反向传播的比较

New technology is coming again, embrace agp7 0, are you ready to say goodbye to transform?

招聘-长期有效

CDH5删除数据节点

Sqlyog import SQL file
随机推荐
mysql-连接查询成本和成本统计数据辨析
Web -- user registration interface
Character sorting in the string (10 points): please write the function fun to sort the strings with a length of 8 characters in descending order.
并发锁机制之synchronized
mysql-慢查询日志与索引合并解析
Tool function - decimal place processing
Improving the efficiency of randomly generated sphere interference inspection by block division
Detailed explanation of JVM memory allocation mechanism
SECOND: Sparsely Embedded Convolutional Detection
山东大学项目实训树莓派提升计划二期(五)book1内容分析与整理
并发编程之JMM模型和并发三大特性
CAS and atomic atomic operation classes for concurrent programming
POI与EasyExcel读写测试
Flex item properties
2021-10-19性能测试
MySQL mvcc multi version concurrent version control and bufferpool caching mechanism
Introduction and practice of automatic monitoring system Prometheus & grafana
<2021SC@SDUSC>山东大学软件工程应用与实践JPress代码分析(十三)
[special topic of stack and queue] - Dual queue simulation stack
EsgynDB 清理不一致对象