%sql
INSERT INTO db.table_name1 info VALUES
('A','B','2019-01-01 00:00:00.000'),
('A','C', '2019-01-01 00:00:00.000'),
('A','D', '2019-01-01 00:00:00.000')
我想对所有相同的日期使用parameter。
INSERT INTO db.table_name1 info VALUES
('A','B',date),
('A','C',date),
('A','D',date)
尝试使用
val date = '2019-01-01 00:00:00.000'
和得到错误
%scala
val dt = "2019-01-01 00:00:00.000"
spark.conf.set("da.date", dt)
%sql
create table table_name1 (name string, name1 string, ts string)
INSERT INTO table_name1 VALUES
('A','C','${da.date}'),
('A','D','${da.date}')
select * from table_name1