Upgrade Pinot Connector Libraries to 0.8.0#9098
Conversation
|
Based on #7630 . |
|
Does the upgrade require the changes from #7630? |
684cef2 to
7ebd38e
Compare
hashhar
left a comment
There was a problem hiding this comment.
First pass. Didn't review PinotSqlFormatter yet.
Would appreciate someone familiar with Pinot to also review the changes in DynamicTableBuilder (and PinotSqlFormatter).
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/PinotMetadata.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/query/DynamicTableBuilder.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
The order of processing changed - filters before grouping. Was this intentional (I do think the operation doesn't matter but makes the change seem more involved than it actually was).
There was a problem hiding this comment.
I reverted the order of processing so the functionality is the same as it was with the following caveat:
A passthrough query with grouping columns but no aggregations is parsed by pinot 0.8.0 differently than other queries: it wraps the grouping columns in a distinct(col1, col2, ...) select list, returns a null list of grouping columns and a "distinct" aggregation function which does not support the Pinot AggregatationFunction::getFinalResultColumnType method.
I addressed this but it seems better to include it in a separate pr, as the previous functionality is preserved with this pr and rewriting would change how distinct aggregations are handled. wdyt?
There was a problem hiding this comment.
Makes sense, it's easier to review changes related to version bump separately from behaviour changes.
We can change the behaviour in follow-up PRs.
There was a problem hiding this comment.
Why is this nested inside the aggregations block?
I think it's possible for queries to have GROUP BY without aggregations.
SELECT 1 FROM t GROUP BY c?
There was a problem hiding this comment.
Let's add a test with this query:
- Ensure that the plan contains a TableScan (so that we are sure that the connector participated in the query and the engine didn't do it all itself).
- The results are correct.
There was a problem hiding this comment.
I created #9167 to test this in BaseConnectorTest as well.
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/query/DynamicTableBuilder.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/query/DynamicTableBuilder.java
Outdated
Show resolved
Hide resolved
aec35ea to
6151d53
Compare
|
Fixes #9133 |
hashhar
left a comment
There was a problem hiding this comment.
Let's extract until 5fc2a82 into a separate PR since those commits are all good and can be merged right now.
Let's also extract the below three into another PR since those look good and can be merged:
Add support for varbinary filters 93a80ca
Fix decoding real -INFINITY and +INFINITY e88b097
Fix decoding double -INFINITY and +INFINITY 82f2914
Let's extract "Fix in clause handling in filter pushdown e6ff226" into a separate PR (for the sake of release notes and people who'd want to look at the fix).
We can then focus on just the 0.8.0 upgrade commits here (which I still need to review some parts of).
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/decoders/DoubleDecoder.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/query/PinotQueryBuilder.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotIntegrationSmokeTest.java
Outdated
Show resolved
Hide resolved
|
Created #9178 for the first pr |
|
Created #9180 for the varbinary filter support + real/double fixes |
|
Pr for the in clause varchar handling: #9181 |
f4e02d2 to
e9e0f10
Compare
plugin/trino-pinot/pom.xml
Outdated
There was a problem hiding this comment.
how are we getting this during runtime?
There was a problem hiding this comment.
shall we make a noop implementation for this pinot-metrics interface ?
There was a problem hiding this comment.
how are we getting this during runtime?
Required by the PinotQueryClient which requires PinotMetricsFactory. Would it be ok to leave it, so that we can have broker metrics? The worker functions like a broker without a reducer service (soon we will put that in also). wdyt?
e9e0f10 to
d04ee23
Compare
|
@elonazoulay Please separate a PR if subsequent commits |
|
I wonder if anyone can let me know when this is expected to be released? thanks |
a594161 to
03f9d25
Compare
|
I removed them and pushed. Btw, the commit for handling null on empty group was reworded (and removed from this pr) - it fixes issues in #9137 - let me know if you would like me to restore the branch as it was. |
|
@ebyhr, I removed them and pushed. FYI, the commit for handling null on empty group was reworded to "Fix handling of complex aggregate expressions in passthrough queries" and removed from this pr - it fixes issues in #9137 - let me know if you would like me to add it back. If not I will create another pr for it now. Thanks! |
|
Looks like an unrelated failure. |
plugin/trino-pinot/src/test/resources/quotes_in_column_name_realtimeSpec.json
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/PinotColumnHandle.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestDynamicTable.java
Outdated
Show resolved
Hide resolved
d3664a2 to
f373703
Compare
hashhar
left a comment
There was a problem hiding this comment.
For "Remove PinotColumn":
Maybe reword message to Remove PinotColumn and moved used methods to PinotColumnHandle instead. to clarify it was a mechanical refactor - nothing actually changed.
hashhar
left a comment
There was a problem hiding this comment.
For "Upgrade libraries to pinot-0.8.0"
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/query/AggregateExpression.java
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/query/DynamicTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/query/DynamicTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/query/DynamicTableBuilder.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/query/DynamicTablePqlExtractor.java
Show resolved
Hide resolved
hashhar
left a comment
There was a problem hiding this comment.
Move "Update supported pinot version in documentation" into the commit that updates the library version.
|
LGTM % comments. Sorry about the long back and forth for this PR. |
This is groundwork for pinot-0.8.0 which uses PinotQuery in the broker request.
Remove PinotColumn and moved used methods to PinotColumnHandle instead
d556a42 to
791d47f
Compare
Use the QueryContext from the broker request to parse queries. Use FilterContext to parse filters in pinot-0.8.0. Pinot 0.8.0 supports native boolean types.
The offset is the first parameter in Pinot. Ensure that aggregations are not pushed down if there is an offset.
791d47f to
f02d3fe
Compare
No description provided.