Skip to content
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

Add support for FLOAT for PostgreSQL Binary Arithmetic Operators #655

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

albertZhangTJ
Copy link
Collaborator

No description provided.

@@ -58,15 +58,21 @@ public PostgresConstant apply(PostgresConstant left, PostgresConstant right) {
private String textRepresentation;

private static PostgresConstant applyBitOperation(PostgresConstant left, PostgresConstant right,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function name seems a bit confusing. Should it be applyBinaryOperation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, or perhaps applyBinaryArithmeticOperation - either would be better.

Copy link
Contributor

@mrigger mrigger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I'm wondering if we really need PQS support for floats for Postgres, as it might be difficult to get correct due to potential minor rounding differences. If we want to add support, we should make sure that it doesn't cause any false alarms (e.g., by testing corner cases).

@@ -58,15 +58,21 @@ public PostgresConstant apply(PostgresConstant left, PostgresConstant right) {
private String textRepresentation;

private static PostgresConstant applyBitOperation(PostgresConstant left, PostgresConstant right,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, or perhaps applyBinaryArithmeticOperation - either would be better.

@@ -58,15 +58,21 @@ public PostgresConstant apply(PostgresConstant left, PostgresConstant right) {
private String textRepresentation;

private static PostgresConstant applyBitOperation(PostgresConstant left, PostgresConstant right,
BinaryOperator<Long> op) {
BinaryOperator<Float> op) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using BinaryOperator<Float> in both an integer and floating-point context seems error-prone. Not sure if we should add another class instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I will handle this by adding common classes for these data types in a separate PR.

albertZhangTJ and others added 21 commits December 19, 2022 13:11
Signed-off-by: Yisong Han <yisong8686@gmail.com>

Signed-off-by: Yisong Han <yisong8686@gmail.com>
* tidb: add SHUFFLE_JOIN, BROADCAST_JOIN, LIMIT_TO_COP, MPP_1PHASE_AGG, MPP_2PHASE_AGG

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

* tidb: add SHUFFLE_JOIN, BROADCAST_JOIN, LIMIT_TO_COP, MPP_1PHASE_AGG, MPP_2PHASE_AGG

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

* improve code

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

* improve code

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
…ncer#608)

Bumps [spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.7.2.1 to 4.7.3.0.
- [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases)
- [Commits](spotbugs/spotbugs-maven-plugin@spotbugs-maven-plugin-4.7.2.1...spotbugs-maven-plugin-4.7.3.0)

---
updated-dependencies:
- dependency-name: com.github.spotbugs:spotbugs-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [mariadb-java-client](https://github.com/mariadb-corporation/mariadb-connector-j) from 3.0.8 to 3.1.0.
- [Release notes](https://github.com/mariadb-corporation/mariadb-connector-j/releases)
- [Changelog](https://github.com/mariadb-corporation/mariadb-connector-j/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mariadb-corporation/mariadb-connector-j/commits)

---
updated-dependencies:
- dependency-name: org.mariadb.jdbc:mariadb-java-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.5.0 to 42.5.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](pgjdbc/pgjdbc@REL42.5.0...REL42.5.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Manuel Rigger <rigger@nus.edu.sg>
* tidb: turn off bug switch

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

* improve code

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

* improve code

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

* improve code

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

* improve code

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

* improve code

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

* improve code

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
* bump SQLite to 3.40.0.0

* Support RIGHT/FULL JOINs
* opt: support maximum number of table/index

* opt: support explain interface
* opt: maximum number of tables/indexes in CockroachDB

* opt: support drop table/view

* opt: update Actions
@albertZhangTJ
Copy link
Collaborator Author

My apologies for my carelessness. I will update to try to handle the rounding error.

I will also add some test cases to validate the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants