<commit_before>(ns main 

  (:gen-class
   :methods [^:static 
             [handler 
              [Object 
               com.amazonaws.services.lambda.runtime.Context] 
              Object]]))

(require 'athena-cmd.core)

(defn -handler 
  [obj ctx] 

  (let [query (.get obj "query")
        request_id (.getAwsRequestId ctx)]

    (print (str request_id ": "))
    (println query)

    {"res" (athena-cmd.core/exec query :folder request_id)
     "request_id" request_id}))
<commit_msg>json logging and time<commit_after>(ns main 
  (:require [cheshire.core :refer :all])
  (:gen-class
   :methods [^:static 
             [handler 
              [Object 
               com.amazonaws.services.lambda.runtime.Context] 
              Object]]))

(require 'athena-cmd.core)

(defn -handler 
  [obj ctx] 

  (let [query (.get obj "query")
        request_id (.getAwsRequestId ctx)]

    (print (str request_id ": "))
    (println (generate-string {"query" query}))

    (time {"res" (athena-cmd.core/exec query :folder request_id)
     "request_id" request_id})))

{'fraction_non_alphanumeric': 0.13990610328638498, 'fraction_numerical': 0.0, 'mean_word_length': 2.31055900621118, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6132432', 'n_tokens_mistral': 364, 'n_tokens_neox': 336, 'n_words': 80}