soda-sql icon indicating copy to clipboard operation
soda-sql copied to clipboard

Capture query for each metric

Open tombaeyens opened this issue 3 years ago • 3 comments

In the ScanResult, enable association of each metric with the query.

This could be an idea for the scan result structure:

measurements: [ {
  ..measurement details...
  query: '1'
}, {
  ..measurement details...
  query: '1'
}
],
queries: [{
  id: '1'
  sql: 'SELECT ....'
}
]

tombaeyens avatar Mar 29 '21 14:03 tombaeyens

What if we have the SQL query text to be part of the measurement payload?

AlessandroLollo avatar Mar 30 '21 15:03 AlessandroLollo

@AlessandroLollo Adding the SQL to the measurement is another option, but then we would duplicate the same (long) query a lot of times. As the first query combines all aggregations on all columns. That s the reason why I proposed to split it up. Makes sense or do you still see reasons to move it into measurements?

tombaeyens avatar Apr 02 '21 10:04 tombaeyens

I realized I never replied to your question @tombaeyens 😅 , sorry! Btw, I see your point and I agree with you. Your proposal works for me!

AlessandroLollo avatar Mar 22 '22 13:03 AlessandroLollo