- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 05:53 AM
I have two variables StartTimeStmp and EndTimeStmp, i am going to assign the Start timestamp to it based on Last Successful Job Runtime and EndTimeStamp would be current time of system.
SET StartTimeStmp = '2022-03-24 15:40:00.000';
SET EndTimeStmp = '2022-03-24 20:00:00.000';
I need to pass these two variables to Query String defined in a cell. How to pass these Values. The following is not a complete Query. Just snippet of query.
qrystr=('''
SELECT *
FROM (
SELECT
CI.CORPORATE_ITEM_INTEGRATION_ID , CI.CORPORATE_ITEM_CD where CI.DW_CREATE_TS < '2022-02-23 20:00:00.000' ) ''')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 06:05 AM
@Srinivas Gannavaram , in python:
spark.sql(f"""
SELECT
CI.CORPORATE_ITEM_INTEGRATION_ID ,
CI.CORPORATE_ITEM_CD
WHERE
CI.DW_CREATE_TS < '{my_timestamp_variable}' ;
""")
My blog: https://databrickster.medium.com/