Task: Text to Code
Input (English): select the rows whose tournament record fuzzily matches to japan . select the row whose date record of these rows is 2nd minimum . the surface record of this row is carpet ( i ) .
Output (English): eq { hop { nth_argmin { filter_eq { all_rows ; tournament ; japan } ; date ; 2 } ; surface } ; carpet ( i ) }