Skip to content

Commit 88c3b34

Browse files
authored
Update parking_correspondence_performance_records_with_pcn_downtime_gds.py
Updated date format for downtime fields as changed in the source Google Sheet data
1 parent 0b45ad5 commit 88c3b34

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

scripts/jobs/parking/parking_correspondence_performance_records_with_pcn_downtime_gds.py

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -418,38 +418,38 @@ def sparkSqlQuery(glueContext, query, mapping, transformation_ctx) -> DynamicFra
418418
,liberator_system_username
419419
,liberator_system_id
420420
,cast(import_datetime as string) import_datetime
421-
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60) > 1440 then 1 else 0 end as string) as multiple_downtime_days_flag
422-
,cast(unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')) as string) as response_secs
423-
,cast(Case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' then (unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 end as string) as response_mins
424-
,cast(Case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' then (unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/3600 end as string) as response_hours
421+
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60) > 1440 then 1 else 0 end as string) as multiple_downtime_days_flag
422+
,cast(unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')) as string) as response_secs
423+
,cast(Case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' then (unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 end as string) as response_mins
424+
,cast(Case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' then (unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/3600 end as string) as response_hours
425425
426426
/*Downtime calendar days*/
427-
,cast(Case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' then datediff( cast(Substr(cast(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date) )+1 end as string) as response_days_plus_one -- downtime days plus one calendar day
427+
,cast(Case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' then datediff( cast(Substr(cast(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date) )+1 end as string) as response_days_plus_one -- downtime days plus one calendar day
428428
429429
/*Downtime non working mins*/
430-
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 948
431-
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) < 1440 then 948 end as string) as downtime_total_non_working_mins_with_lunch --if greater than 1440 mins then (days + 1) * 948 "
432-
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 1008
433-
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) < 1440 then 1008 end as string) as downtime_total_non_working_mins --if greater than 1440 mins then (days + 1) * 1008 "
430+
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 948
431+
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) < 1440 then 948 end as string) as downtime_total_non_working_mins_with_lunch --if greater than 1440 mins then (days + 1) * 948 "
432+
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 1008
433+
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) < 1440 then 1008 end as string) as downtime_total_non_working_mins --if greater than 1440 mins then (days + 1) * 1008 "
434434
435435
/*Downtime working mins*/
436-
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 492
437-
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) < 1440 then 492 end as string) as downtime_total_working_mins_with_lunch -- 492 mins = 8hrs 12 mins working day including lunch"
438-
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 432
439-
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) < 1440 then 432 end as string) as downtime_total_working_mins --432 mins = 7hrs 12mins working hours"
436+
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 492
437+
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) < 1440 then 492 end as string) as downtime_total_working_mins_with_lunch -- 492 mins = 8hrs 12 mins working day including lunch"
438+
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 432
439+
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) < 1440 then 432 end as string) as downtime_total_working_mins --432 mins = 7hrs 12mins working hours"
440440
441441
/*Downtime working mins net (less downtime mins)*/
442-
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 492
443-
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) < 1440 then 492 - /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) end as string) as downtime_total_working_mins_with_lunch_net -- 492 mins = 8hrs 12 mins working day including lunch less downtime"
444-
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 432
445-
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) < 1440 then 432 - (/* downtime mins (response_mins)*/ (unix_timestamp(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss')))/60 ) end as string) as downtime_total_working_mins_net --432 mins = 7hrs 12mins working hours"
442+
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 492
443+
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) < 1440 then 492 - /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) end as string) as downtime_total_working_mins_with_lunch_net -- 492 mins = 8hrs 12 mins working day including lunch less downtime"
444+
,cast(case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) > 1440 then /*response_days_plus_one*/(datediff( cast(Substr(cast(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date) )+1) * 432
445+
When parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' and /* downtime mins (response_mins)*/ ((unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) < 1440 then 432 - (/* downtime mins (response_mins)*/ (unix_timestamp(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss')) - unix_timestamp(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss')))/60 ) end as string) as downtime_total_working_mins_net --432 mins = 7hrs 12mins working hours"
446446
447447
,cast(substr(cast(start_date as string), 12, 5) as string) as start_date_time
448448
,cast(substr(cast(start_date as string), 1, 10) as string) as startdate
449-
,cast(Substr(cast(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,16) as string) as start_date_datetime
449+
,cast(Substr(cast(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,16) as string) as start_date_datetime
450450
,cast(substr(cast(end_date as string), 12, 5) as string) as end_date_time
451451
,cast(substr(cast(end_date as string), 1, 10) as string) as enddate
452-
,cast(Substr(cast(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,16) as string) as end_date_datetime
452+
,cast(Substr(cast(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,16) as string) as end_date_datetime
453453
,'Downtime' as response_status
454454
,cast(current_timestamp as string) as Current_time_stamp
455455
@@ -458,7 +458,7 @@ def sparkSqlQuery(glueContext, query, mapping, transformation_ctx) -> DynamicFra
458458
,'' as to_assigned_time
459459
,'' as assigned_in_progress_time
460460
,'' as assigned_response_time
461-
,(cast (cast(Substr(cast(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,16) as timestamp) - cast ( Substr(cast(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,16) as timestamp) as string) ) as response_time --as downtime_duration --line 30
461+
,(cast (cast(Substr(cast(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,16) as timestamp) - cast ( Substr(cast(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,16) as timestamp) as string) ) as response_time --as downtime_duration --line 30
462462
,'' as unassigned_days
463463
,'' as unassigned_days_group
464464
,'' as unassigned_days_kpiTotFiftySixLess
@@ -475,15 +475,15 @@ def sparkSqlQuery(glueContext, query, mapping, transformation_ctx) -> DynamicFra
475475
,'' as assignedResponseDays_group
476476
,'' as assignedResponseDays_kpiTotFiftySixLess
477477
,'' as assignedResponseDays_kpiTotFourteenLess
478-
,cast( Case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' then datediff( cast(Substr(cast(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,10) as date) ) end as string) as ResponseDays --as downtime_duration in days
478+
,cast( Case when parking_officer_downtime.timestamp not like '' and parking_officer_downtime.timestamp not like '#REF!' then datediff( cast(Substr(cast(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date), cast(Substr(cast(to_timestamp(start_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,10) as date) ) end as string) as ResponseDays --as downtime_duration in days
479479
,'' as ResponseDays_group
480480
,'' as ResponseDays_kpiTotFiftySixLess
481481
,'' as ResponseDays_kpiTotFourteenLess
482482
, end_date as Response_generated_at
483483
, start_date as Date_Received
484-
,concat(Substr(cast(to_timestamp(end_date,'dd/MM/yyyy HH:mm:ss') as varchar(30)),1,7), '-01') as MonthYear
484+
,concat(Substr(cast(to_timestamp(end_date,'yyyy-MM-dd HH:mm:ss') as varchar(30)),1,7), '-01') as MonthYear
485485
,'Downtime' as Type
486-
,'Downtime' as Serviceable -- downtime
486+
,parking_officer_downtime.Downtime as Serviceable -- downtime
487487
,'' as Service_category
488488
,concat(officer_s_first_name,' ',officer_s_last_name) as Response_written_by --downtime officer full name
489489
,'' as Letter_template
@@ -639,7 +639,8 @@ def sparkSqlQuery(glueContext, query, mapping, transformation_ctx) -> DynamicFra
639639
,'' as t_notes
640640
,'' as t_import_date
641641
642-
from parking_officer_downtime where import_date = (select max(import_date) from parking_officer_downtime) and timestamp not like '' and timestamp not like '#REF!'
642+
from parking_officer_downtime where import_date = (select max(import_date) from parking_officer_downtime) and timestamp not like '' and timestamp not like '#REF!'
643+
AND cast(Substr( cast(parking_officer_downtime.timestamp as string) ,1,10) as date) > current_date - interval '13' month --Last 13 months from todays date
643644
--order by timestamp desc
644645
"""
645646
SQLQuery_node1697453694651 = sparkSqlQuery(

0 commit comments

Comments
 (0)