@@ -653,7 +653,7 @@ object WorkflowsTransforms extends SparkSessionWrapper {
653653 ' jobId .cast(" long" ).alias(" submissionJobId" ),
654654 ' runId .alias(" jobRunId" ),
655655 ' timestamp .alias(" submissionTime" ),
656- ' jobTriggerType ,
656+ ' jobTriggerType .alias( " jobTriggerType_Triggered " ) ,
657657 ' requestId .alias(" submitRequestID" ),
658658 ' response .alias(" submitResponse" ),
659659 ' userIdentity .alias(" submittedBy" )
@@ -833,7 +833,7 @@ object WorkflowsTransforms extends SparkSessionWrapper {
833833 coalesce(' parentRunId_Started , ' parentRunId_Completed ).cast(" long" ).alias(" parentRunId" ),
834834 coalesce(' taskRunId , ' idInJob ).cast(" long" ).alias(" idInJob" ),
835835 TransformFunctions .subtractTime(
836- ' submissionTime ,
836+ ' startTime ,
837837 array_max(array(' completionTime , ' cancellationTime )) // endTS must remain null if still open
838838 ).alias(" TaskRunTime" ), // run launch time until terminal event
839839 TransformFunctions .subtractTime(
@@ -843,7 +843,7 @@ object WorkflowsTransforms extends SparkSessionWrapper {
843843 ' run_name ,
844844 coalesce(' jobClusterType_Started , ' jobClusterType_Completed ).alias(" clusterType" ),
845845 coalesce(' jobTaskType_Started , ' jobTaskType_Completed ).alias(" taskType" ),
846- coalesce(' jobTriggerType_Started , ' jobTriggerType_Completed , ' jobTriggerType_runNow ).alias(" jobTriggerType" ),
846+ coalesce(' jobTriggerType_Triggered , ' jobTriggerType_Started , ' jobTriggerType_Completed , ' jobTriggerType_runNow ).alias(" jobTriggerType" ),
847847 when(' cancellationRequestId .isNotNull, " Cancelled" )
848848 .otherwise(' jobTerminalState )
849849 .alias(" terminalState" ),
@@ -1221,6 +1221,8 @@ object WorkflowsTransforms extends SparkSessionWrapper {
12211221 .withColumn(" runtime_in_cluster_state" , // all runs have an initial cluster state
12221222 when(' state .isin(" CREATING" , " STARTING" ) || ' cluster_type === " new" , ' uptime_in_state_H * 1000 * 3600 ) // get true cluster time when state is guaranteed fully initial
12231223 .otherwise(runStateFirstToEnd - $" task_runtime.startEpochMS" )) // otherwise use jobStart as beginning time and min of stateEnd or jobEnd for end time )
1224+ .withColumn(" hourly_core_potential" , ' cluster_state_worker_potential_core_H / ' uptime_in_state_H ) // executor potential per hour
1225+ .withColumn(" worker_potential_core_H" , (' runtime_in_cluster_state / 1000.0 / 60.0 / 60.0 ) * ' hourly_core_potential )
12241226 .withColumn(" lifecycleState" , lit(" init" ))
12251227 }
12261228
@@ -1256,6 +1258,8 @@ object WorkflowsTransforms extends SparkSessionWrapper {
12561258 )
12571259 .join(jobRunInitialStates.select(stateLifecycleKeys map col : _* ), stateLifecycleKeys, " leftanti" ) // filter out beginning states
12581260 .withColumn(" runtime_in_cluster_state" , taskRunEndOrPipelineEnd - runStateLastToStart)
1261+ .withColumn(" hourly_core_potential" , ' cluster_state_worker_potential_core_H / ' uptime_in_state_H ) // executor potential per hour
1262+ .withColumn(" worker_potential_core_H" , (' runtime_in_cluster_state / 1000.0 / 60.0 / 60.0 ) * ' hourly_core_potential )
12591263 .withColumn(" lifecycleState" , lit(" terminal" ))
12601264 }
12611265
@@ -1295,6 +1299,8 @@ object WorkflowsTransforms extends SparkSessionWrapper {
12951299 .join(jobRunInitialStates.select(stateLifecycleKeys map col : _* ), stateLifecycleKeys, " leftanti" ) // filter out beginning states
12961300 .join(jobRunTerminalStates.select(stateLifecycleKeys map col : _* ), stateLifecycleKeys, " leftanti" ) // filter out ending states
12971301 .withColumn(" runtime_in_cluster_state" , ' unixTimeMS_state_end - ' unixTimeMS_state_start )
1302+ .withColumn(" hourly_core_potential" , ' cluster_state_worker_potential_core_H / ' uptime_in_state_H ) // executor potential per hour
1303+ .withColumn(" worker_potential_core_H" , (' runtime_in_cluster_state / 1000.0 / 60.0 / 60.0 ) * ' hourly_core_potential )
12981304 .withColumn(" lifecycleState" , lit(" intermediate" ))
12991305
13001306 }
@@ -1327,7 +1333,7 @@ object WorkflowsTransforms extends SparkSessionWrapper {
13271333 $" workerSpecs.vCPUs" .alias(" worker_cores" ),
13281334 ' isAutomated ,
13291335 ' dbu_rate ,
1330- ' worker_potential_core_H ,
1336+ ' worker_potential_core_H .alias( " cluster_state_worker_potential_core_H " ) ,
13311337 ' driver_compute_cost ,
13321338 ' worker_compute_cost ,
13331339 ' driver_dbu_cost ,
0 commit comments