-
Notifications
You must be signed in to change notification settings - Fork 267
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
base: main
Are you sure you want to change the base?
Add support for FLOAT for PostgreSQL Binary Arithmetic Operators #655
Conversation
@@ -58,15 +58,21 @@ public PostgresConstant apply(PostgresConstant left, PostgresConstant right) { | |||
private String textRepresentation; | |||
|
|||
private static PostgresConstant applyBitOperation(PostgresConstant left, PostgresConstant right, |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this 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, |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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
…bertZhangTJ/sqlancer into branch-FloatForPostgresBinaryOperator
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. |
No description provided.