Outils pour utilisateurs

Outils du site


dse:data_query_expression_language

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
dse:data_query_expression_language [2025/03/19 15:09] – nicoantodse:data_query_expression_language [2025/03/19 15:14] (Version actuelle) – nicoanto
Ligne 6: Ligne 6:
  
 ===== Examples ===== ===== Examples =====
 +==== Divers ====
  
 <code> <code>
Ligne 24: Ligne 25:
 </code> </code>
  
-==== toMap ====+====  stateful map() ====
  
 <code> <code>
-transitionsMap : Map<String, Tuple<event: String, datetime: DateTime, current: String>> = List.range(startInclusive: 0, endExclusive: issue._history_event.length, step: 1 ) +snapshotTuples : List<Tuple<week: String, current: String>> =  
-    .map(index => issue._history_event[index] IN ["create", "promote","demote"]? +    $Year_Weeks 
-        {event: issue._history_event[index], datetime:issue._history_time[index], current: issue._history_state[index]} +        .map( 
-        :NULL) +            initialState: issue.current 
-    .filter(x => x IS NOT NULL) +            , updateState: (x, previousState) => transitionsMap[x].current IS NOT NULL?transitionsMap[x].current:previousState 
-    .toMap( +            , function: (x, currentState) => {week:x, current:x>=originatedWeek?currentState:NULL} 
-        keyFunction: x => Date.format(date: x.datetime, format:"yyyy_ww") +        ) 
-        , valueFunction: x => x +        .filter(x => x.current IS NOT NULL); 
-    );+</code>
  
 +==== toMap ====
 +
 +<code>
 +transitionsMap : Map<String, Tuple<event: String, datetime: DateTime, current: String>> =
 +    List.range(startInclusive: 0, endExclusive: issue._history_event.length, step: 1 )
 +        .map(index => issue._history_event[index] IN ["create", "promote","demote"]?
 +            {event: issue._history_event[index], datetime:issue._history_time[index], current: issue._history_state[index]}
 +            :NULL)
 +        .filter(x => x IS NOT NULL)
 +        .toMap(
 +            keyFunction: x => Date.format(date: x.datetime, format:"yyyy_ww")
 +            , valueFunction: x => x
 +        );
 </code> </code>
 ==== Map.mapValues ==== ==== Map.mapValues ====
dse/data_query_expression_language.1742396989.txt.gz · Dernière modification : (modification externe)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki