throws Exception
{
// TODO: support GROUP BY queries
assertEquals(actual.size(), 1, "approximate query returned more than one row");
MaterializedTuple actualRow = actual.get(0);
MaterializedTuple expectedRow = expected.get(0);
for (int i = 0; i < actualRow.getFieldCount(); i++) {
String actualField = (String) actualRow.getField(i);
double actualValue = Double.parseDouble(actualField.split(" ")[0]);
double error = Double.parseDouble(actualField.split(" ")[2]);
Object expectedField = expectedRow.getField(i);
assertTrue(expectedField instanceof String || expectedField instanceof Number);
double expectedValue;
if (expectedField instanceof String) {
expectedValue = Double.parseDouble((String) expectedField);
}