Skip to content

Commit

Permalink
Fix testFilterWithUdf
Browse files Browse the repository at this point in the history
This is due to differences in how Pinot handles IEEE-754
approximate numerics pre/post Pinot 0.12.1.

See apache/pinot#10637
  • Loading branch information
elonazoulay authored and hashhar committed Apr 20, 2023
1 parent de4cbc3 commit 6cb5e7f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ public void testFilterWithPushdownConstraint()
public void testFilterWithUdf()
{
String tableName = realtimeOnlyTable.getTableName();
String query = format("select FlightNum from %s where DivLongestGTimes = FLOOR(EXP(2 * LN(3))) AND 5 < EXP(CarrierDelay) limit 60", tableName.toLowerCase(ENGLISH));
// Note: before Pinot 0.12.1 the below query produced different results due to handling IEEE-754 approximate numerics
// See https://github.com/apache/pinot/issues/10637
String query = format("select FlightNum from %s where DivLongestGTimes = FLOOR(EXP(2 * LN(3)) + 0.1) AND 5 < EXP(CarrierDelay) limit 60", tableName.toLowerCase(ENGLISH));
DynamicTable dynamicTable = buildFromPql(pinotMetadata, new SchemaTableName("default", query), mockClusterInfoFetcher, TESTING_TYPE_CONVERTER);
String expectedPql = "select \"FlightNum\" from realtimeOnly where AND((\"DivLongestGTimes\") = '9.0', (exp(\"CarrierDelay\")) > '5') limit 60";
assertEquals(extractPql(dynamicTable, TupleDomain.all()), expectedPql);
Expand Down

0 comments on commit 6cb5e7f

Please sign in to comment.