You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "rawsun007 (via GitHub)" <gi...@apache.org> on 2026/10/12 10:15:33 UTC
[PR] docs: `#` is bitwise xor only in the PostgreSQL and Redshift dialects [datafusion]
rawsun007 opened a new pull request, #26224:
URL: https://github.com/apache/datafusion/pull/26224
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
- None; documentation fix. Follows up #22314.
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
Please explain the problem you are trying to solve in terms of the user-visible
behavior, rather than the implementation.
For example, "The code in `foo.rs` doesn't handle nulls" is a symptom of the
implementation. "COUNT(DISTINCT) returns wrong results when the column contains
nulls" is the user-visible problem.
-->
The operators page says `#` is bitwise xor, "interchangeable with `^`". On `main`, `SELECT 5 # 3;` fails with the default dialect (`ParserError("No infix parser for token Sharp ...")`), and since #22314 `^` is exponentiation in the PostgreSQL dialect, so the two are not interchangeable in any dialect. Running both in every dialect:
- `#` is xor in PostgreSQL and Redshift. In MySQL, Snowflake, Hive and BigQuery it starts a comment, so `SELECT 5 # 3` returns `5`. Every other dialect rejects it.
- `^` is xor everywhere except PostgreSQL, where `5 ^ 3` is `125.0`.
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here, but it is sometimes worth providing a summary of the individual changes in this PR.
-->
The `#` entry in `operators.md` now says which dialects parse it and points to `^` for the rest. The example sets the PostgreSQL dialect first and shows the current column name (`BIT_XOR`).
## What is the testing strategy for this PR?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
Briefly describe how this PR is tested, and point to the specific tests you added. For example: 'This new feature is covered by the `sqllogictest` cases added in `foo.slt`'.
If this PR does not add tests, explain why. For example, if the change is already covered by existing tests, please mention it.
You should also check the `codecov` bot reply on this PR to confirm the changed code is exercised.
-->
Ran the new example and the dialect checks above against `datafusion-cli` built from `main`; `./ci/scripts/doc_prettier_check.sh` passes. Docs only, no test.
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
If there are any breaking changes to public APIs, please add the `api change` label.
-->
Documentation only.
Generated with Claude Code (claude-opus-5-5). It came from running the documented SQL examples against `main`, not from an issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] docs: document ^ as the bitwise xor operator [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #26224:
URL: https://github.com/apache/datafusion/pull/26224
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] docs: `#` is bitwise xor only in the PostgreSQL and Redshift dialects [datafusion]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #26224:
URL: https://github.com/apache/datafusion/pull/26224#issuecomment-6124802973
## [Codecov](https://app.codecov.io/gh/apache/datafusion/pull/26224?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 82.82%. Comparing base ([`6663e43`](https://app.codecov.io/gh/apache/datafusion/commit/6663e4348049cc7b70109c9e0f8e39049794ea23?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`60dea1f`](https://app.codecov.io/gh/apache/datafusion/commit/60dea1f871faaabe4389f103801b7c2d9ec5db84?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #26224 +/- ##
==========================================
- Coverage 82.83% 82.82% -0.01%
==========================================
Files 1149 1149
Lines 452344 452344
Branches 452344 452344
==========================================
- Hits 374680 374672 -8
- Misses 54864 54871 +7
- Partials 22800 22801 +1
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion/pull/26224?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] docs: document ^ as the bitwise xor operator [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on PR #26224:
URL: https://github.com/apache/datafusion/pull/26224#issuecomment-6163244919
thanks @rawsun007 & @nuno-faria
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org