-
Notifications
You must be signed in to change notification settings - Fork 0
Sync upstream up to version 27.1.0 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…obymao#5137) * fix(snowflake): Properly transpile ARRAY_AGG, IGNORE/RESPECT NULLS * Refactor into generator flag * Switch to type(expr).key
…o#5140) * feat(snowflake): Transpile ARRAY(SELECT AS STRUCT ...) * Reuse existing selection
* Fix: Refactor ALTER TABLE ADD parsing Temp * Simplify wrapped_csv to csv
tobymao#5151) Co-authored-by: WZHSENO <sergej.novik@rbinternational.com>
* Chore: compare performance on main vs pr branch * Temporarily reduce benchmarking surface
* feat: add DateStrToTime * Fix lint * Use TsOrDsToTime instead * Update tests
In PR tobymao#4704, support for OUT, OUTPUT, and READ_ONLY parameter modifiers. However, READ_ONLY is not correct -- it should be READONLY. See the documentation for procedures as functions: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-procedure-transact-sql?view=sql-server-ver16#readonly https://learn.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-sql?view=sql-server-ver17#readonly
* feat(snowflake): Support SEMANTIC_VIEW * Make parsing more lenient
…ion (tobymao#5418) * test: Added failing test for MAP datatype for risingwave dialect * fix!: Added datatype_sql method for RisingWave dialect to write valid MAP datatypes * test: Added tests for CREATE TABLE syntax with new MAP datatype_sql method * style: ran formatter
* feat(postgres): query placeholders * PR feedback 1 (george)
* feat(doris): enhance partitioning support with new parsing methods and SQL generation * address comments * fix expression
…cess (tobymao#5388) * fix(snowflake): transpile bigquery GENERATE_DATE_ARRAY with column access * column case * PR feedback 1 (george partial)
Co-authored-by: Mateusz Poleski <Mateusz.Poleski@imc.com>
* feat(doris): enhance partitioning support * fix syntax error * Update sqlglot/dialects/doris.py --------- Co-authored-by: Jo <46752250+georgesittas@users.noreply.github.com>
…5422) * feat(exasol): mapped exp.CurrentUser to exasol CURRENT_USER * Update sqlglot/dialects/exasol.py Co-authored-by: Jo <46752250+georgesittas@users.noreply.github.com> * fix(exasol): removed parsing "USER" * fix(exasol): fixed linting --------- Co-authored-by: Jo <46752250+georgesittas@users.noreply.github.com>
…5423) * fix(duckdb)!: make bracket parsing aware of duckdb MAP func * PR feedback 1 (george) * minor comment change * PR feedback 2 (george)
…YPE (tobymao#5430) * feat(optimizer)!: parse and annotate type support for bigquery JSON_TYPE * add doris * fix comments * refactor bigquery test
* fix(snowflake): ALTER TABLE ADD with multiple columns * fix style
…primary key alongside the INCLUDE keyword (tobymao#5425) * feat(postgresql): add support for table creation DDL that contains a primary key alongside the INCLUDE keyword * feat(postgresql): modify the code according to the PR review * feat(postgresql): annotate expression in primarykey_sql to be exp.PrimaryKey
* fix(snowflake): ALTER TABLE ADD with IF NOT EXISTS * refactor tests
Dependency ReviewThe following issues were found:
License Issuessqlglotrs/Cargo.lock
Allowed Licenses: 0BSD, AFL-2.1, Apache-2.0, BlueOak-1.0.0, BSD-2-Clause, BSD-3-Clause, CC-BY-3.0, CC-BY-4.0, CC0-1.0, EPL-2.0, ISC, MIT, MIT-0, MPL-2.0, PSF-2.0, Python-2.0, Unlicense, WTFPL, Zlib OpenSSF ScorecardScorecard details
Scanned Files
|
| name: run benchmark | ||
| runs-on: ubuntu-latest | ||
| if: | | ||
| (github.event_name == 'issue_comment' && | ||
| contains(github.event.comment.body, '/benchmark') && | ||
| github.event.issue.pull_request) || | ||
| (github.event_name == 'pull_request' && | ||
| contains(github.event.pull_request.body, '/benchmark')) | ||
| steps: | ||
| - name: Checkout PR branch | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Needed to fetch main branch too | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.13 | ||
| - name: Create a virtual environment | ||
| run: | | ||
| python -m venv .venv | ||
| source ./.venv/bin/activate | ||
| python -m pip install --upgrade pip | ||
| pip install pyperf | ||
| - name: Run benchmark on PR branch | ||
| run: | | ||
| source ./.venv/bin/activate | ||
| make install-dev | ||
| make install-dev-rs-release | ||
| python benchmarks/parse.py --quiet --output bench_parse_pr.json | ||
| python benchmarks/optimize.py --quiet --fast --output bench_optimize_pr.json | ||
| - name: Checkout main branch into subdir | ||
| run: | | ||
| git fetch origin main | ||
| git worktree add main-branch origin/main | ||
| - name: Reset virtual environment | ||
| run: | | ||
| rm -rf .venv | ||
| python -m venv .venv | ||
| source ./.venv/bin/activate | ||
| python -m pip install --upgrade pip | ||
| pip install pyperf | ||
| - name: Run benchmark on main branch | ||
| run: | | ||
| source ./.venv/bin/activate | ||
| cd main-branch | ||
| make install-dev | ||
| make install-dev-rs-release | ||
| python benchmarks/parse.py --quiet --output ../bench_parse_main.json | ||
| python benchmarks/optimize.py --quiet --fast --output ../bench_optimize_main.json | ||
| cd .. | ||
| - name: Compare benchmarks and save results | ||
| run: | | ||
| source ./.venv/bin/activate | ||
| python -m pyperf compare_to bench_parse_main.json bench_parse_pr.json --table --table-format=md > bench_parse_comparison_raw.txt | ||
| python -m pyperf compare_to bench_optimize_main.json bench_optimize_pr.json --table --table-format=md > bench_optimize_comparison_raw.txt | ||
|
|
||
| # Format with colors | ||
| python .github/scripts/format_benchmark.py bench_parse_comparison_raw.txt > bench_parse_comparison.txt | ||
| python .github/scripts/format_benchmark.py bench_optimize_comparison_raw.txt > bench_optimize_comparison.txt | ||
| - name: Combine benchmark outputs | ||
| run: | | ||
| echo "## Benchmark Results" > combined_benchmarks.md | ||
| echo "" >> combined_benchmarks.md | ||
| echo "**Legend:**" >> combined_benchmarks.md | ||
| echo "- 🟢🟢 = 2x+ faster" >> combined_benchmarks.md | ||
| echo "- 🟢 = 1.1x - 2x faster" >> combined_benchmarks.md | ||
| echo "- ⚪ = No significant change (< 1.1x)" >> combined_benchmarks.md | ||
| echo "- 🔴 = 1.1x - 2x slower" >> combined_benchmarks.md | ||
| echo "- 🔴🔴 = 2x+ slower" >> combined_benchmarks.md | ||
| echo "" >> combined_benchmarks.md | ||
| echo "### Parsing Benchmark" >> combined_benchmarks.md | ||
| cat bench_parse_comparison.txt >> combined_benchmarks.md | ||
| echo -e "\n---\n" >> combined_benchmarks.md | ||
| echo "### Optimization Benchmark" >> combined_benchmarks.md | ||
| cat bench_optimize_comparison.txt >> combined_benchmarks.md | ||
| - name: Comment on PR for parse benchmark results | ||
| uses: peter-evans/create-or-update-comment@v4 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| issue-number: ${{ github.event.issue.number || github.event.pull_request.number }} | ||
| body-file: combined_benchmarks.md |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 months ago
To fix the problem, you should add a permissions block to the workflow or to the specific job. The block should specify only the permissions required for the workflow to operate correctly. In this workflow, the main requirement is the ability to read repository contents (contents: read) and to write comments on issues or pull requests (issues: write and/or pull-requests: write). Since the workflow comments on PRs using the peter-evans/create-or-update-comment action, it needs at least issues: write (for issue comments) and pull-requests: write (for PR comments). To ensure least privilege, add the following block at the job level (under run-benchmark:):
permissions:
contents: read
issues: write
pull-requests: writeThis should be added just beneath the job name (after line 11) in .github/workflows/benchmark-sqlglot.yml.
-
Copy modified lines R12-R15
| @@ -9,6 +9,10 @@ | ||
| jobs: | ||
| run-benchmark: | ||
| name: run benchmark | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| pull-requests: write | ||
| runs-on: ubuntu-latest | ||
| if: | | ||
| (github.event_name == 'issue_comment' && |
No description provided.