hive hplsql语法
Last updated on January 17, 2025 am
🧙 Questions
☄️ Ideas
使用
vim script.sql
use ispong_db;
insert into users(username, age) values ('ispong', 18);
select * from users;
USE ispong_db;
DECLARE
ispong_age INT default 18;
BEGIN
SELECT * from users where age = ispong_age
END;
USE ispong_db;
DECLARE
DATE ispong_date = DATE(2021,'12-13');
BEGIN
SELECT * from users2 where lucky_date = ispong_date;
END;
USE ispong_db;
DECLARE ispong_age INT := 19;
DECLARE ispong_date STRING := '2021-12-13';
DECLARE ispong_name STRING;
BEGIN
SELECT username INTO ispong_name FROM users2 WHERE age = 19;
SELECT * from users2 where age = ispong_age and lucky_date = to_date(ispong_date) and username = ispong_name;
END
vim script.sql
hplsql -f script.sql
🔗 Links
hive hplsql语法
https://ispong.isxcode.com/hadoop/hive/hive hplsql语法/