%python
df =spark.sql(" select count(*) from sample.table_c")
count = df.first()[0]
spark.conf.set("myapp.count",count)
spark.conf.get("myapp.count")
i am getting count & saving it as variable for further use in sql..
the above code is working for int,string ..but when i am using it for timestamp,date instead of int..i am getting error
%python
import datetime as dt
c_time =dt.datetime.now()
spark.conf.set("myapp.ages",c_time)
the error is py4j.Py4JException: Method set([class java.lang.String, class java.sql.Timestamp]) does not exist
any way to solve this,please help me
i tried widgets concept...but not working
source https://stackoverflow.com/questions/76695280/how-to-pass-timestamp-between-python-sql
Comments
Post a Comment