Skip to content

Commit cfb8cea

Browse files
authored
fix(native): Generation of thrift protocol (#26419)
The thrift generation was broken because a line that was expected to be removed was not and caused a thrift parse error. That line is "drift.recursive_reference = true,” which was not caught by the regex attempting to remove it. This PR also adds the required thrift parser to the python installation of the dependency to use it in the CI. ## Description <!---Describe your changes in detail--> ## Motivation and Context <!---Why is this change required? What problem does it solve?--> <!---If it fixes an open issue, please link to the issue here.--> ## Impact <!---Describe any public API or user-facing feature change or any performance impact--> ## Test Plan <!---Please fill in how you tested your change--> ## Contributor checklist - [ ] Please make sure your submission complies with our [contributing guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md), in particular [code style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style) and [commit standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards). - [ ] PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced. - [ ] Documented new properties (with its default value), SQL syntax, functions, or other functionality. - [ ] If release notes are required, they follow the [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines). - [ ] Adequate tests were added if applicable. - [ ] CI passed. - [ ] If adding new dependencies, verified they have an [OpenSSF Scorecard](https://securityscorecards.dev/#the-checks) score of 5.0 or higher (or obtained explicit TSC approval for lower scores). ## Release Notes Please follow [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines) and fill in the release notes below. ``` == NO RELEASE NOTE == ```
1 parent 92a6920 commit cfb8cea

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

presto-native-execution/presto_cpp/main/thrift/thrift2json.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def preprocess(file_path, output_temp_path):
3838
lines = file.readlines()
3939
modified_lines = []
4040
for line in lines:
41-
modified_line = re.sub(r"\s*,*\s*drift\.recursive_reference=true\s*", "", line)
41+
modified_line = re.sub(
42+
r"\s*,*\s*drift\.recursive_reference\s*=\s*true\s*,*\s*", "", line
43+
)
4244
modified_line = re.sub(r"\(\s*\)$", "", modified_line)
4345
modified_lines.append(modified_line)
4446
with open(output_temp_path, "w") as file:

presto-native-execution/scripts/setup-centos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export NPROC=${NPROC:-$(getconf _NPROCESSORS_ONLN)}
3333
function install_presto_deps_from_package_managers {
3434
dnf install -y maven java clang-tools-extra jq perl-XML-XPath
3535
# This python version is installed by the Velox setup scripts
36-
pip install regex pyyaml chevron black
36+
pip install regex pyyaml chevron black ptsd-jbroll
3737
}
3838

3939
function install_gperf {

0 commit comments

Comments
 (0)