[Feature][Metric] Custom SQL support export error data (#586)