Get.sql 808 B

12345678910111213141516171819202122232425
  1. /* syntax version 1 */
  2. $check = ($arg) -> {
  3. return <|
  4. ryear: DateTime::GetYear($arg),
  5. rdayofyear: DateTime::GetDayOfYear($arg),
  6. rmonth: DateTime::GetMonth($arg),
  7. rweekofyear: DateTime::GetWeekOfYear($arg),
  8. rweekofyeariso8601: DateTime::GetWeekOfYearIso8601($arg),
  9. rdayofmonth: DateTime::GetDayOfMonth($arg),
  10. rdayofweek: DateTime::GetDayOfWeek($arg),
  11. rtz: DateTime::GetTimezoneId($arg),
  12. |>
  13. };
  14. $typeDispatcher = ($row) -> {
  15. $tm = $row.tm;
  16. return <|
  17. explicit: $check(DateTime::Split($tm)),
  18. implicit: $check($tm),
  19. |>;
  20. };
  21. $input = SELECT CAST(ftimestamp64 AS Timestamp64) as tm FROM Input;
  22. PROCESS $input USING $typeDispatcher(TableRow());