Remove dependency on Slice from core/trino-parser#11856
Remove dependency on Slice from core/trino-parser#11856martint merged 5 commits intotrinodb:masterfrom
Conversation
core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
AFAIK, StringLiteral contains Slice for performance reasons.
so this is not an OK change.
There was a problem hiding this comment.
Can we keep byte[] instead there and only wrap as Slice in relevant places?
There was a problem hiding this comment.
It used to matter when the evaluation engine relied on interpreting the AST for every row. That hasn't been the case for many years.
See previous comment: #5649 (comment)
There was a problem hiding this comment.
Can we keep byte[] instead there and only wrap as Slice in relevant places?
This is not needed. The conversions from String in the analyzer/planner don't happen often enough for it to be a meaningful performance issue.
There was a problem hiding this comment.
Let me benchmark Slice w/ String vs String vs byte[] with String view method
There was a problem hiding this comment.
I'm benchmarking, so we will be able to compare numbers
|
@wendigo this is not the way to go. We're working around a problem we made ourselves to ourselves.
|
8decff4 to
d12cac6
Compare
core/trino-parser/src/main/java/io/trino/sql/tree/BinaryLiteral.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/main/java/io/trino/sql/tree/CharLiteral.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/main/java/io/trino/sql/tree/StringLiteral.java
Outdated
Show resolved
Hide resolved
fdaad10 to
44a66ad
Compare
|
@findepi: There are no significant differences in the performance after this change. core/trino-parser/src/main/java/io/trino/sql/TreePrinter.java |
core/trino-parser/src/main/java/io/trino/sql/tree/StringLiteral.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/main/java/io/trino/sql/tree/CharLiteral.java
Outdated
Show resolved
Hide resolved
That's good to know. I would understand why we're doing this, if we had to workaround a library that we don't control, but that's not the case here. |
44a66ad to
ec97b62
Compare
We should not. It should just represent them and return them as String. There's no benefit in keeping them as |
|
@martint ok, I'll drop this commit and push soon. |
ec97b62 to
ff4fe21
Compare
|
@martint ptal now. Both Char and String literal now returns String |
|
ff4fe21 to
eaf9de3
Compare
|
@martint fixed |
9677aee to
ade0ec3
Compare
This allows us to keep core/parser independent of Slice JDK 11 requirement.
ade0ec3 to
08fbc39
Compare
Refactoring
Documentation
(x) No documentation is needed.
Release notes
(x) No release notes entries required.