[BugFix] Fixed a bug in starrocks.filter.query and Spark pushdown filters merging#149
Open
monchickey wants to merge 2 commits intoStarRocks:mainfrom
Open
[BugFix] Fixed a bug in starrocks.filter.query and Spark pushdown filters merging#149monchickey wants to merge 2 commits intoStarRocks:mainfrom
monchickey wants to merge 2 commits intoStarRocks:mainfrom
Conversation
…ters merging Signed-off-by: monchickey <monchickey@gmail.com>
Signed-off-by: monchickey <monchickey@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this:
Which issues of this PR fixes :
There are currently no related issues.
Problem Summary(Required) :
StarRocks version: 3.4.9
Spark version: 3.5.6
Spark Connector version: 1.1.3
Reproduction steps:
Create a test table:
Write test data:
Query test data:
We have prepared the following test cases:
After execution, Spark reported the following error:
The StarRocks FE log output is as follows:
The error can be seen to be caused by a problem with the SQL concatenation.
starrocks-connector-for-apache-spark/src/main/scala/com/starrocks/connector/spark/sql/StarrocksRelation.scala
Lines 89 to 93 in 9f0fb19
Concatenation was not handled correctly when the pushback result of
DialectUtils.compileFilterreturned an empty string.The following changes should be made:
After fixing the issue and re-executing the test cases, the FE logs are as follows:
This is because StarRocks does not support MySQL's "LIKE ... ESCAPE ..." search method. Furthermore, the conditions passed by the user using
starrocks.filter.querywere also overridden.starrocks-connector-for-apache-spark/src/main/scala/com/starrocks/connector/spark/read/StarRocksBatchScan.scala
Lines 61 to 76 in 9f0fb19
The current method should return an unsupported predicate, modifications are as follows:
The generated SQL is now correct:
Checklist: